当前位置: 首页>>代码示例>>C#>>正文


C# WebControls.DataGridCommandEventArgs类代码示例

本文整理汇总了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();
 }
开发者ID:ChuckLafferty,项目名称:bugnet,代码行数:30,代码来源:ProjectPriorities.ascx.cs

示例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;
 }
开发者ID:inspire88,项目名称:TcportGroupOA,代码行数:7,代码来源:SendDoc_Flag.aspx.cs

示例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();
     }
 }
开发者ID:inspire88,项目名称:TcportGroupOA,代码行数:26,代码来源:Caw_CompanyServerShip.aspx.cs

示例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();
 }
开发者ID:ChuckLafferty,项目名称:bugnet,代码行数:30,代码来源:ProjectStatus.ascx.cs

示例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;
     }
 }
开发者ID:HoangNgocThin,项目名称:thietbimoitruong,代码行数:32,代码来源:Language.aspx.cs

示例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);
            }
        }
开发者ID:carriercomm,项目名称:BillingSystem,代码行数:29,代码来源:Loan.aspx.cs

示例7: dgResellers_DeleteCommand

        private void dgResellers_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            int id = int.Parse(e.CommandArgument.ToString());
            CManage.DeleteReseller(id);

            BindDGResellers();
        }
开发者ID:0anion0,项目名称:IBN,代码行数:7,代码来源:Resellers.ascx.cs

示例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();
        }
开发者ID:inspire88,项目名称:TcportGroupOA,代码行数:27,代码来源:AssetsType_List.aspx.cs

示例9: Grid_CartCommand

 protected void Grid_CartCommand(Object sender, DataGridCommandEventArgs e)
 {
     if(e.CommandName == "Edit")
     {
         ((AdminUsers)Parent).EditUser(userList.User[e.Item.ItemIndex].login);
     }
 }
开发者ID:dineshkummarc,项目名称:DotNetPortalSrc-102,代码行数:7,代码来源:UserList.ascx.cs

示例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();
                }

            }
        }
开发者ID:hkiaipc,项目名称:yh,代码行数:34,代码来源:dhxxx.aspx.cs

示例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();

            }

        }
开发者ID:lincoln56,项目名称:robinerp,代码行数:35,代码来源:Qyhy.aspx.cs

示例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);
        }
开发者ID:TalAcademic,项目名称:FinalProject,代码行数:7,代码来源:SearchUser.aspx.cs

示例13: DeleteUser

        protected void DeleteUser(object source, DataGridCommandEventArgs e)
        {
            var id = EntitiesGrid.DataKeys[e.Item.ItemIndex];
            PersonEdit.Instance.Delete((int)id);

            GetByFilter();
        }
开发者ID:TalAcademic,项目名称:FinalProject,代码行数:7,代码来源:SearchUser.aspx.cs

示例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;
     }
 }
开发者ID:HoangNgocThin,项目名称:thietbimoitruong,代码行数:33,代码来源:Customers.aspx.cs

示例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("有资产外借未处理,不能删除.");
            //}
        }
开发者ID:inspire88,项目名称:TcportGroupOA,代码行数:26,代码来源:ReportInfo_List.aspx.cs


注:本文中的System.Web.UI.WebControls.DataGridCommandEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。