private void Button1_Click(object sender, System.EventArgs e) { try { //根据新油价重算 if (this.txtBeginDate.Text.Trim().Length == 0) { this.Popup("请输入开始日期!"); return; } if (this.txtEndDate.Text.Trim().Length == 0) { this.Popup("请输入结束日期!"); return; } DataTable dtPrice = ReportQueryFacade.CommonQuery("select count(*) from tbOilPrice where convert(varchar(10),cndpricedate,121) between '" + this.txtBeginDate.Text + "' and '" + this.txtEndDate.Text + "'"); int icount = Convert.ToInt32(dtPrice.Rows[0][0].ToString()); if (icount == 0) { this.Popup("选定的时间段油价未变动!"); return; } Dept curDept = Session[ConstValue.LOGIN_DEPT_SESSION] as Dept; Oper curOper = Session[ConstValue.LOGIN_USER_SESSION] as Oper; BusiLog busiLog = new BusiLog(); busiLog.cnvcOperName = curOper.cnvcOperName; busiLog.cnvcComments = "重算:" + this.txtBeginDate.Text + "-" + this.txtEndDate.Text; busiLog.cnvcDeptID = curDept.cnvcDeptID; busiLog.cnvcDeptName = curDept.cnvcDeptName; busiLog.cnvcOperType = "BS016"; busiLog.cnvcSource = "网站"; ReportQueryFacade.AgainComp(this.txtBeginDate.Text, this.txtEndDate.Text, busiLog); this.Popup("重算成功"); } catch (Exception ex) { this.Popup(ex.Message); } }