Ejemplo n.º 1
0
        protected 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 strOutDept = this.ddlOutDept.SelectedValue;
            string strInDept  = this.ddlInDept.SelectedValue;

            Hashtable htPara = new Hashtable();

            htPara.Add("strOutDept", strOutDept);
            htPara.Add("strInDept", strInDept);
            htPara.Add("strBeginDate", strBeginDate);
            htPara.Add("strEndDate", strEndDate);

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

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                DataTable dtout = StoBusi.GetProductMoveLog(htPara);
                if (dtout == null)
                {
                    this.SetErrorMsgPageBydir("查询出错,请重试!");
                    return;
                }
                else
                {
                    this.TableConvert(dtout, "cnvcOutDeptID", "NewDept", "vcCommSign='SalesRoom'");
                    this.TableConvert(dtout, "cnvcInDeptID", "NewDept", "vcCommSign='SalesRoom'");
                    this.TableConvert(dtout, "cnvcBillState", "tbNameCodeToStorage", "vcCommSign='MOVE_OS'");
                    dtout.TableName = "调拨单";
                }

                this.DataGrid1.DataSource = dtout;
                this.DataGrid1.DataBind();
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }