Exemplo n.º 1
0
 public void ChildDataBindBank(string strPK)
 {
     try
     {
         this.dbo = new DB_OPT();
         this.dbo.Open();
         DataSet list = new BankDal().GetList(" pk_corp='" + strPK + "'", this.dbo);
         if ((list != null) && (list.Tables[0].Rows.Count > 0))
         {
             this.gvResult_child_bank.DataSource = list;
             this.gvResult_child_bank.DataBind();
         }
         else
         {
             DataTable table = list.Tables[0];
             DataRow row = table.NewRow();
             table.Rows.Add(row);
             this.gvResult_child_bank.DataSource = table.DefaultView;
             this.gvResult_child_bank.DataBind();
         }
     }
     catch (Exception exception)
     {
         this.el = new ExceptionLog.ExceptionLog();
         this.el.ErrClassName = base.GetType().ToString();
         this.el.ErrMessage = exception.Message.ToString();
         this.el.ErrMethod = "ChildDataBindBank()";
         this.el.WriteExceptionLog(true);
         Const.OpenErrorPage("获取数据失败,请联系系统管理员!", this.Page);
     }
     finally
     {
         if (this.dbo != null)
         {
             this.dbo.Close();
         }
     }
 }
Exemplo n.º 2
0
 private void BindDropDown(DB_OPT dbo)
 {
     DataSet list = new BankDal().GetList("", dbo);
     if ((list != null) && (list.Tables[0].Rows.Count > 0))
     {
         this.dropBankPK.DataSource = list;
         this.dropBankPK.DataTextField = "BankName";
         this.dropBankPK.DataValueField = "BankPK";
         this.dropBankPK.DataBind();
     }
 }