本文整理汇总了C#中System.Web.UI.WebControls.DataGridCommandEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataGridCommandEventArgs类的具体用法?C# DataGridCommandEventArgs怎么用?C# DataGridCommandEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridCommandEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了DataGridCommandEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: grdPriorities_ItemCommand
/// <summary>
/// Handles the ItemCommand event of the grdPriorities control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.Web.UI.WebControls.DataGridCommandEventArgs"/> instance containing the event data.</param>
protected void grdPriorities_ItemCommand(object sender, DataGridCommandEventArgs e)
{
Priority p;
var itemIndex = e.Item.ItemIndex;
switch (e.CommandName)
{
case "up":
//move row up
if (itemIndex == 0)
return;
p = PriorityManager.GetById(Convert.ToInt32(grdPriorities.DataKeys[e.Item.ItemIndex]));
p.SortOrder -= 1;
PriorityManager.SaveOrUpdate(p);
break;
case "down":
//move row down
if (itemIndex == grdPriorities.Items.Count - 1)
return;
p = PriorityManager.GetById(Convert.ToInt32(grdPriorities.DataKeys[e.Item.ItemIndex]));
p.SortOrder += 1;
PriorityManager.SaveOrUpdate(p);
break;
}
BindPriorities();
}
示例2: GridView1_EditCommand
protected void GridView1_EditCommand(object source, DataGridCommandEventArgs e)
{
this.GridView1.EditItemIndex = e.Item.DataSetIndex;
InitiData();
DL.InitGroupDrgList((DropDownList)this.GridView1.Items[e.Item.ItemIndex].Cells[3].FindControl("drgDept"), Session["ORGID"].ToString());
((CheckBox)this.GridView1.Items[e.Item.ItemIndex].Cells[4].FindControl("chkAll")).Checked = ((Label)e.Item.Cells[12].FindControl("lblAll")).Text == "1" ? true : false;
}
示例3: GridView1_ItemCommand
protected void GridView1_ItemCommand(object source, DataGridCommandEventArgs e)
{
if (e.CommandName == "DEL")
{
int intFlag = CSSD.Delete(((Label)e.Item.FindControl("lbl_ID")).Text);
if (intFlag < 1)
{
CallJsFun("alert('由于网络原因,本次删除失败,请联系信息中心技术支持人员!');");
return;
}
CallJsFun("alert('删除成功!');");
this.IntiData();
}
if (e.CommandName == "SUBMIT")
{
bool IsPause = ((Label)e.Item.FindControl("lbl_Status")).Text == "4" ? true : false;
int flag = CSSD.Submit("Caw_CompanyServerShip_Add.aspx", ((Label)e.Item.FindControl("lbl_ID")).Text, Session["UserID"].ToString(), Session["RealName"].ToString(), Session["ORGID"].ToString(), Session["CompanyName"].ToString(), "1", IsPause);
if (flag < 1)
{
CallJsFun("alert('由于网络原因,本次提交失败,请联系信息中心技术支持人员!');");
return;
}
CallJsFun("alert('成功提交');window.close();");
this.IntiData();
}
}
示例4: grdStatus_ItemCommand
/// <summary>
/// Handles the ItemCommand event of the grdStatus control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.Web.UI.WebControls.DataGridCommandEventArgs"/> instance containing the event data.</param>
protected void grdStatus_ItemCommand(object sender, DataGridCommandEventArgs e)
{
Status s;
var itemIndex = e.Item.ItemIndex;
switch (e.CommandName)
{
case "up":
//move row up
if (itemIndex == 0)
return;
s = StatusManager.GetById(Convert.ToInt32(grdStatus.DataKeys[e.Item.ItemIndex]));
s.SortOrder -= 1;
StatusManager.SaveOrUpdate(s);
break;
case "down":
//move row down
if (itemIndex == grdStatus.Items.Count - 1)
return;
s = StatusManager.GetById(Convert.ToInt32(grdStatus.DataKeys[e.Item.ItemIndex]));
s.SortOrder += 1;
StatusManager.SaveOrUpdate(s);
break;
}
BindStatus();
}
示例5: grdLanguage_ItemCommand
protected void grdLanguage_ItemCommand(object source, DataGridCommandEventArgs e)
{
string strCA = e.CommandArgument.ToString();
switch (e.CommandName)
{
case "Edit":
Insert = false;
Id = strCA;
List<Data.Language> listE = LanguageService.Language_GetById(Id);
txtName.Text = listE[0].Name;
txtFolder.Text = listE[0].Folder;
chkDefault.Checked = listE[0].Default == "1" || listE[0].Default == "True";
txtImage.Text = listE[0].Image;
imgImage.ImageUrl = listE[0].Image.Length > 0 ? listE[0].Image : "";
chkActive.Checked = listE[0].Active == "1" || listE[0].Active == "True";
pnView.Visible = false;
pnUpdate.Visible = true;
break;
case "Active":
string strA = "";
string str = e.Item.Cells[2].Text;
strA = str == "1" ? "0" : "1";
SqlDataProvider sql = new SqlDataProvider();
sql.ExecuteNonQuery("Update Language set Active=" + strA + " Where Id='" + strCA + "'");
BindGrid();
break;
case "Delete":
LanguageService.Language_Delete(strCA);
BindGrid();
break;
}
}
示例6: LoanListDataGrid_ItemCommand
protected void LoanListDataGrid_ItemCommand(object source, DataGridCommandEventArgs e)
{
string id = string.Empty;
if (e.CommandName == "LoanImageDelete")
{
int selectindex = e.Item.ItemIndex;
id = this.LoanListDataGrid.Items[selectindex].Cells[0].Text;
}
// Response.Write("<script> if(confirm('是否删除')) document.getElementById('HidderField2').value='1';</script>");
if (!string.IsNullOrEmpty(id) && this.deleteflag == true)
{
int iSuccess = LoanMethods.DeleteLoanById(Convert.ToInt32(id));
if (iSuccess > 0)
{
Alert.Show(this, "删除成功!");
}
else
{
Alert.Show(this, "删除失败!");
}
if (queryList == null)
{
queryList = new List<QueryElement>();
}
BindLoanListDataGrid(queryList);
this.ClientScript.RegisterStartupScript(this.GetType(), "", "HideORShowColumn();", true);
}
}
示例7: dgResellers_DeleteCommand
private void dgResellers_DeleteCommand(object source, DataGridCommandEventArgs e)
{
int id = int.Parse(e.CommandArgument.ToString());
CManage.DeleteReseller(id);
BindDGResellers();
}
示例8: GridView1_UpdateCommand
protected void GridView1_UpdateCommand(object source, DataGridCommandEventArgs e)
{
TextBox txtName = (TextBox)GridView1.Items[e.Item.ItemIndex].FindControl("txtTypeName");
TextBox txtNote = (TextBox)GridView1.Items[e.Item.ItemIndex].FindControl("txtTypeNote");
if (txtName.Text.Trim() == "")
{
ShowJsMessage("�������Ʊ�����д��");
return;
}
string TypeGuid = GridView1.DataKeys[e.Item.ItemIndex].ToString();
//�ж��Ƿ���ڣ�ֻ�в����ڲ��ܸ���
if (!AM.IsAssetsTypeExists(txtName.Text.Trim(), TypeGuid))
{
AM.UpdateAssetsType(TypeGuid, txtName.Text.Trim(), txtNote.Text.Trim());
}
else
{
ShowJsMessage("�����������Ѿ����ڣ���ʹ���������ƣ�");
return;
}
GridView1.EditItemIndex = -1;
this.Refresh();
}
示例9: Grid_CartCommand
protected void Grid_CartCommand(Object sender, DataGridCommandEventArgs e)
{
if(e.CommandName == "Edit")
{
((AdminUsers)Parent).EditUser(userList.User[e.Item.ItemIndex].login);
}
}
示例10: DataGrid1_ItemCommand
protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e)
{
DataTable dt1 = new DataTable();
if (e.CommandName == "select")
{
TableRow a = new TableRow();
a = e.Item;
dt1 = gcgl.dhx_query(a.Cells[1].Text);
if (dt1.Rows.Count > 0)
{
DataRow dr = dt1.Rows[0];
Session["id"] = a.Cells[1].Text;
this.qsmc.Text = dr["倒虹吸名称"].ToString();
this.dlwz.Text = dr["所属渠道"].ToString();
this.gclx.Text = dr["起始桩号"].ToString();
this.sqsy.Text = dr["倒虹吸长度(米)"].ToString();
this.qsll.Text = dr["设计流量(立方米/秒)"].ToString();
this.qszc.Text = dr["布置型式"].ToString();
this.gj.Text = dr["管径(米)"].ToString();
this.cz.Text = dr["材质"].ToString();
this.lx.Text = dr["断面类型"].ToString();
this.dc.Text = dr["洞长(米)"].ToString();
this.dg.Text = dr["洞高(米)"].ToString();
this.dk.Text = dr["洞宽(米)"].ToString();
this.bj.Text = dr["半径(米)"].ToString();
this.xc.Text = dr["吸差(米)"].ToString();
this.gldw.Text = dr["管理单位"].ToString();
this.jssj.Text = dr["建设时间"].ToString();
this.yxzk.Text = dr["运行状况"].ToString();
this.bzsm.Text = dr["备注说明"].ToString();
}
}
}
示例11: dgExamProj_ItemCommand
//生成事件时
protected void dgExamProj_ItemCommand(object source, DataGridCommandEventArgs e)
{
string strArgument = e.CommandArgument.ToString();
if (e.CommandName == "delete")
{
string id = e.CommandArgument.ToString();
QPS.NEW.BLL.Enterprise ep = new QPS.NEW.BLL.Enterprise();
try
{
ep.DeleteById(Convert.ToInt32(id));
Bind();
}
catch (Exception ex)
{ }
}
if (e.CommandName == "LinkTo")
{
//Label lab = ((Label)e.Item.FindControl("lblPack"));
Response.Redirect("RoomUpdate.aspx?id=" + e.CommandArgument.ToString());
}
if (e.CommandName == "Ifchecked")
{
string[] Argument = strArgument.Split('|');
string id = Argument[0].ToString();
string examine = Argument[1].ToString();
NEW.BLL.Enterprise ep = new QPS.NEW.BLL.Enterprise();
ep.UpdateChecked(id, examine);
Bind();
}
}
示例12: EditUser
protected void EditUser(object source, DataGridCommandEventArgs e)
{
var id = EntitiesGrid.DataKeys[e.Item.ItemIndex];
var url = ResolveUrl("../User/AddUser.aspx?code=" + id);
Response.Redirect(url);
}
示例13: DeleteUser
protected void DeleteUser(object source, DataGridCommandEventArgs e)
{
var id = EntitiesGrid.DataKeys[e.Item.ItemIndex];
PersonEdit.Instance.Delete((int)id);
GetByFilter();
}
示例14: grdtbCUSTOMERS_ItemCommand
protected void grdtbCUSTOMERS_ItemCommand(object source, DataGridCommandEventArgs e)
{
string strCA = e.CommandArgument.ToString();
switch (e.CommandName)
{
case "Edit":
Insert = false;
Id = strCA;
List<Data.tbCUSTOMERS> listE = tbCUSTOMERSService.tbCUSTOMERS_GetById(Id);
txtvpassword.Text = listE[0].vpassword;
txtvcusname.Text = listE[0].vcusname;
txtdbirthday.Text = listE[0].dbirthday;
txtvprovince.Text = listE[0].vprovince;
txtvaddress.Text = listE[0].vaddress;
txtvmobile.Text = listE[0].vmobile;
txtvemail.Text = listE[0].vemail;
pnView.Visible = false;
pnUpdate.Visible = true;
break;
case "Delete":
try
{
tbCUSTOMERSService.tbCUSTOMERS_Delete(strCA);
}
catch
{
Common.WebMsgBox.Show("Khách hàng đã từng mua hàng không thể xóa");
return;
}
BindGrid();
break;
}
}
示例15: DataGrid1_Command
protected void DataGrid1_Command(object source, DataGridCommandEventArgs e)
{
string Guid = DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
if (e.CommandName == "Delete")
{
new ReportUpload().DeleteReport(Guid);
ShowJsMessage("删除成功 .");
}
else if (e.CommandName == "UpLoad") //上传口岸委
{
new ReportUpload().UpdateTableStatus(Guid, "1");
}
Refresh();
//string AssetsGuid = GridView1.DataKeys[e.Item.ItemIndex].ToString();
//if (!AM.HasAssetsOut(AssetsGuid))
//{
// AM.DeleteAssetsItem(AssetsGuid);
// this.Refresh();
//}
//else
//{
// ShowJsMessage("有资产外借未处理,不能删除.");
//}
}