📄 sourcemanage.aspx.cs
字号:
namespace PowerEasy.WebSite.Admin.Accessories
{
using PowerEasy.Accessories;
using PowerEasy.Controls;
using PowerEasy.ExtendedControls;
using PowerEasy.Model.Accessories;
using PowerEasy.Web.UI;
using System;
using System.Text;
using System.Web.UI.WebControls;
public class SourceManage : AdminPage
{
protected Button EBtnAdd;
protected ExtendedButton EBtnBatchDelete;
protected ExtendedGridView GdvSourceList;
protected ObjectDataSource Ods1;
protected ExtendedSiteMapPath SmpNavigator;
protected void EBtnAdd_Click(object sender, EventArgs e)
{
BasePage.ResponseRedirect("Source.aspx");
}
protected void EBtnBatchDelete_Click(object sender, EventArgs e)
{
string str = string.Empty;
StringBuilder builder = new StringBuilder(string.Empty);
for (int i = 0; i < this.GdvSourceList.Rows.Count; i++)
{
CheckBox box = (CheckBox) this.GdvSourceList.Rows[i].Cells[0].FindControl("CheckBoxButton");
if (box.Checked)
{
str = this.GdvSourceList.DataKeys[i].Value.ToString();
builder.Append(str);
builder.Append(",");
}
}
builder.Remove(builder.Length - 1, 1);
if (builder.Length == 0)
{
AdminPage.WriteErrMsg("对不起,您还没选择要删除的项!");
}
else if (Source.Delete(builder.ToString()))
{
this.GdvSourceList.DataBind();
}
else
{
AdminPage.WriteErrMsg("删除失败!");
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
protected void SourceList_RowCommand(object sender, CommandEventArgs e)
{
bool flag = false;
string commandName = e.CommandName;
if (commandName != null)
{
SourceInfo sourceInfoById;
if (!(commandName == "Elite"))
{
if (commandName == "OnTop")
{
sourceInfoById = Source.GetSourceInfoById(Convert.ToInt32(e.CommandArgument));
sourceInfoById.OnTop = !sourceInfoById.OnTop;
flag = Source.Update(sourceInfoById);
goto Label_00E1;
}
if (commandName == "Passed")
{
sourceInfoById = Source.GetSourceInfoById(Convert.ToInt32(e.CommandArgument));
sourceInfoById.Passed = !sourceInfoById.Passed;
flag = Source.Update(sourceInfoById);
goto Label_00E1;
}
if (commandName == "Deleted")
{
flag = Source.Delete(Convert.ToString(Convert.ToInt32(e.CommandArgument), (IFormatProvider) null));
goto Label_00E1;
}
}
else
{
sourceInfoById = Source.GetSourceInfoById(Convert.ToInt32(e.CommandArgument));
sourceInfoById.Elite = !sourceInfoById.Elite;
flag = Source.Update(sourceInfoById);
goto Label_00E1;
}
}
flag = false;
Label_00E1:
if (flag)
{
this.GdvSourceList.DataBind();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -