//设置总计信息和跑钩数 private void SetSumInfo() { if (this.grvWGD.Rows.Count > 0) { this.labCount.Text = PageControl1.GetRecordCount().ToString(); try { this.lblPaoGou.Text = WGDQuery.GetPaoGouCount(GetSqlWhere()).ToString(); } catch { this.lblPaoGou.Text = "0"; } } }
//导出EXCEL protected void imgBtnExcel_Click(object sender, ImageClickEventArgs e) { if (this.grvWGD.Rows.Count < 1) { this.PrintfError("没有要导出的数据!"); } try { string sqlWhere = GetSqlWhere(); DataSet ds = WGDQuery.QueryWGDExcel(sqlWhere); if (ds != null) { this.CreateExcel(ds.Tables[0], "WGD.xls", PageControl1.GetRecordCount()); } } catch { this.PrintfError("数据访问错误,请重试!"); return; } }
//查询 protected void imgBtnQuery_Click(object sender, ImageClickEventArgs e) { try { if (checksj()) { SetPageCountView(); BindGridView(); lblSUM.Text = PageControl1.GetRecordCount().ToString(); lblZL.Text = GetckdJHZL().ToString(); } else { PrintfError("输入日期有误!"); return; } } catch { this.PrintfError("数据访问失败!"); return; } }
//查询 protected void imgBtnQuery_Click(object sender, ImageClickEventArgs e) { try { if (checksj()) { string sql = GetSqlZKD(); if (!string.IsNullOrEmpty(sql)) { //Response.Write(sql); SetPageCountView(); BindGridView(); lblSUM.Text = PageControl1.GetRecordCount().ToString(); lblSL.Text = GetckdSL().ToString(); lblZL.Text = GetckdZL().ToString(); lblJHSL.Text = GetckdJHSL().ToString(); lblJHZL.Text = GetckdJHZL().ToString(); //lblCount.Text = PageControl1.GetRecordCount().ToString(); } else { this.PrintfError("请输入查询条件!"); return; } } else { this.PrintfError("时间有误,请重新输入"); return; } } catch { this.PrintfError("数据访问失败!"); return; } }