Exemplo n.º 1
0
 private void BindGridView(string strFydh)
 {
     try
     {
         DataSet ds    = FYDList.GetFYDDetail(strFydh);
         decimal strSL = 0;
         decimal strZL = 0;
         if (ds != null)
         {
             foreach (DataRow row in ds.Tables[0].Rows)
             {
                 if (!string.IsNullOrEmpty(row["sl"].ToString()))
                 {
                     strSL += Convert.ToDecimal(row["sl"]);
                 }
                 if (!string.IsNullOrEmpty(row["zl"].ToString()))
                 {
                     strZL += Convert.ToDecimal(row["zl"].ToString());
                 }
             }
         }
         this.lblSL.Text             = Convert.ToInt32(strSL).ToString();
         this.lblZL.Text             = strZL.ToString("#0.0000");
         this.grdFYDetail.DataSource = ds;
         this.grdFYDetail.DataBind();
     }
     catch
     {
         this.PrintfError("数据访问错误!");
         return;
     }
 }
Exemplo n.º 2
0
 private void BindGrid()
 {
     try
     {
         DataSet ds = FYDList.GetKHInfo(GetSqlWhere());
         this.grvKHList.DataSource = ds;
         this.grvKHList.DataBind();
     }
     catch
     {
         this.PrintfError("数据访问错误,请重试!");
         return;
     }
 }
Exemplo n.º 3
0
 //设置分页控件显示
 private void SetPageCountView()
 {
     try
     {
         string sqlWhere = GetSqlWhere();
         int    outCount;
         int    pageCount = FYDList.GetPageCount(sqlWhere, PageControl1.GetPageSize(), out outCount);
         PageControl1.SetInitView(pageCount, outCount);
     }
     catch
     {
         this.PrintfError("数据访问错误,请重试!");
         return;
     }
 }
Exemplo n.º 4
0
 //绑定GridView
 private void BindGridView()
 {
     try
     {
         string  sql        = GetSqlWhere();
         string  sortEx     = this.grvFYDList.Attributes["SortExpression"];
         string  sortDirect = this.grvFYDList.Attributes["SortDirection"];
         string  strSort    = (!string.IsNullOrEmpty(sortEx)) ? sortEx + " " + sortDirect : "";
         DataSet ds         = FYDList.QueryFYQD(sql, strSort, PageControl1.GetPageSize(), PageControl1.GetCurrPage());
         this.grvFYDList.DataSource = ds;
         this.grvFYDList.DataBind();
     }
     catch (Exception ex)
     {
         String strEx = ex.Message;
         this.PrintfError("数据访问错误,请重试!");
     }
 }