예제 #1
0
        private void btnQuery_Click(object sender, System.EventArgs e)
        {
            strBeginDate = Request.Form["txtBegin"].ToString();
            strEndDate   = Request.Form["txtEnd"].ToString();
            if (strBeginDate == "" || strEndDate == "" || strBeginDate == null || strEndDate == null)
            {
                this.SetErrorMsgPageBydir("时间不能为空,请重新选择时间!");
                return;
            }
            string strPoEnterID = this.txtPoEnterID.Text.Trim();
            string strWHouse    = this.ddlWhouse.SelectedValue;
            string strDept      = this.ddlDept.SelectedValue;
            string strState     = this.ddlState.SelectedValue;

            if (strWHouse == "全部")
            {
                strWHouse = "";
            }
            if (strDept == "全部")
            {
                strDept = "";
            }

            Hashtable htPara = new Hashtable();

            htPara.Add("strPoEnterID", strPoEnterID);
            htPara.Add("strDept", strDept);
            htPara.Add("strWHouse", strWHouse);
            htPara.Add("strState", strState);
            htPara.Add("strBeginDate", strBeginDate);
            htPara.Add("strEndDate", strEndDate);
            htPara.Add("strPoID", this.txtPoID.Text.Trim());

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

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                DataTable dtout = StoBusi.GetPoStockEnterMain(htPara);
                if (dtout == null)
                {
                    this.SetErrorMsgPageBydir("查询出错,请重试!");
                    return;
                }
                else
                {
                    this.TableConvert(dtout, "部门", "NewDept");
                    this.TableConvert(dtout, "仓库", "Warehouse");
                    dtout.TableName = "采购入库单列表";
                    DataTable dtexcel = dtout.Copy();
                    Session["QUERY"] = dtout;
                }

                UcPageView1.MyDataGrid.PageSize = 20;
                DataView dvOut = new DataView(dtout);
                this.UcPageView1.MyDataSource = dvOut;
                this.UcPageView1.BindGrid();
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }