コード例 #1
0
 protected void btnDelAll_Click(object sender, EventArgs e)
 {
     try
     {
         StringBuilder sb = new StringBuilder();
         foreach (int row in gvList.SelectedRowIndexArray)
         {
             sb.Append(gvList.DataKeys[row][0].ToString());
             subCompany.SubCompanyId = Convert.ToDouble(gvList.DataKeys[row][0].ToString());
             subCompany = companyService.GetDictSubcompanyById(subCompany);
         }
         var library = new DictSubCompanyService();
         int nflag   = library.DelSubcompanyById(sb.ToString().TrimEnd(','));
         if (nflag > 0)
         {
             MessageBoxShow("所选项已成功删除", MessageBoxIcon.Information);
             BindGrid();
             subCompanyId = 0;
             LoadEditDate();
         }
     }
     catch (Exception ex)
     {
         MessageBoxShow(ex.Message);
     }
 }
コード例 #2
0
 private void LoadEditDate()
 {
     subCompany.SubCompanyId = subCompanyId;
     daan.domain.DictSubCompany dictsubfo = new DictSubCompanyService().GetDictSubcompanyById(subCompany);
     if (dictsubfo == null)
     {
         subCompany                  = new daan.domain.DictSubCompany();
         SimpleFormEdit.Title        = "当前状态-新增";
         this.tbxSUBCOMPANYNAME.Text = subCompany.SubCompanyName;
         this.tbxADDRES.Text         = subCompany.Addres;
         this.tbxDISPLAYORDER.Text   = subCompany.Displayorder.ToString();
         this.tbxPHONE.Text          = subCompany.Phone;
         this.TbsREMARK.Text         = subCompany.Remark;
     }
     else
     {
         this.tbxSUBCOMPANYNAME.Text = dictsubfo.SubCompanyName;
         this.tbxADDRES.Text         = dictsubfo.Addres;
         this.tbxDISPLAYORDER.Text   = dictsubfo.Displayorder.ToString();
         this.tbxPHONE.Text          = dictsubfo.Phone;
         this.TbsREMARK.Text         = dictsubfo.Remark;
     }
 }