Ejemplo n.º 1
0
        protected void btQuery_Click(object sender, EventArgs e)
        {
            if (this.txtBegin.Text == "" || this.txtEnd.Text == "")
            {
                this.SetErrorMsgPageBydir("时间不能为空,请重新选择时间!");
                return;
            }

            string strBeginDate = Convert.ToDateTime(this.txtBegin.Text).ToString("yyyy-MM-dd");
            string strEndDate   = Convert.ToDateTime(this.txtEnd.Text).AddDays(1).ToString("yyyy-MM-dd");


            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            busiq = new BusiComm.BusiQuery(strcons);

            string strSerial   = txtSerial.Text.Trim();
            string strOperName = ddlOper.SelectedValue;
            string strDeptID   = ddlDept.SelectedValue;
            string strIsUndo   = this.DropDownList1.SelectedValue;

            try
            {
                DataTable dtout = busiq.ConsItemUndoQuery(strSerial, strBeginDate, strEndDate, strOperName, strDeptID, strIsUndo, "0");
                if (dtout == null)
                {
                    this.SetErrorMsgPageBydir("查询出错,请重试!");
                    return;
                }
                else
                {
                    this.GridView1.DataSource = dtout;
                    this.GridView1.DataBind();
                    Session["ConsItemUndo"] = dtout;
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }