當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。