private void btnQuery_Click(object sender, System.EventArgs e)
        {
            string strDeptID   = this.ddlValidDept.SelectedValue;
            string strAssignID = this.txtAssignID.Text.Trim();

            if (strAssignID == "")
            {
                this.SetErrorMsgPageBydirHistory("生产序号不能为空!");
                return;
            }

            Hashtable htPara = new Hashtable();

            htPara.Add("strDeptID", strDeptID);
            htPara.Add("strAssignID", strAssignID);

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

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                DataTable dtout = StoBusi.GetAssignToValidEnter(htPara);
                if (dtout == null)
                {
                    this.lblAssignID.Text = "";
                    this.SetErrorMsgPageBydir("查询出错,请重试!");
                    return;
                }
                else
                {
                    this.TableConvert(dtout, "cnvcShipDeptID", "NewDept");
                    this.TableConvert(dtout, "cnvcProductType", "tbNameCodeToStorage", "vcCommSign='PRODUCTTYPE'");
                    this.lblAssignID.Text = strAssignID;
                    dtout.TableName       = "验收信息表";
                    DataTable dtexcel = dtout.Copy();
                    Session["QUERY"] = dtout;
                }

                //				this.DataGrid1.PageSize = 30;
                this.DataGrid1.DataSource = dtout;
                this.DataGrid1.DataBind();
            }
            catch (Exception er)
            {
                this.lblAssignID.Text = "";
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
Esempio n. 2
0
        protected void btnQuery_Click(object sender, System.EventArgs e)
        {
            Session.Remove("QUERY");
            string strDeptID        = this.ddlValidDept.SelectedValue;
            string strAssignID      = this.txtAssignID.Text.Trim();
            string strOrderSerialNo = this.txtOrderSerialNo.Text.Trim();

            if (strAssignID == "")
            {
                this.SetErrorMsgPageBydirHistory("分货流水不能为空!");
                return;
            }

            if (strOrderSerialNo == "")
            {
                this.SetErrorMsgPageBydirHistory("订单流水不能为空!");
                return;
            }

            Hashtable htPara = new Hashtable();

            htPara.Add("strDeptID", strDeptID);
            htPara.Add("strAssignID", strAssignID);
            htPara.Add("strOrderSerialNo", strOrderSerialNo);

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

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                DataTable dtout = StoBusi.GetAssignToValidEnter(htPara);
                if (dtout == null)
                {
                    this.lblAssignID.Text      = "";
                    this.lblOrderSerialNo.Text = "";
                    this.SetErrorMsgPageBydir("查询出错,请重试!");
                    return;
                }
                else
                {
                    if (dtout.Rows.Count > 0)
                    {
                        this.btnEdit.Enabled = true;
                    }
                    else
                    {
                        this.btnEdit.Enabled = false;
                    }
                    this.TableConvert(dtout, "cnvcShipDeptName", "NewDept");
                    this.TableConvert(dtout, "cnvcProductTypeName", "tbNameCodeToStorage", "vcCommSign='PRODUCTTYPE'");
                    this.lblAssignID.Text      = strAssignID;
                    this.lblOrderSerialNo.Text = strOrderSerialNo;
                    dtout.TableName            = "验收信息表";
                    DataTable dtexcel = dtout.Copy();
                    Session["QUERY"] = dtout;
                }

                //				this.DataGrid1.PageSize = 30;
                this.DataGrid1.DataSource = dtout;
                this.DataGrid1.DataBind();
                this.btnEdit.Text          = "编辑";
                this.btnValidEnter.Enabled = false;

                this.DataGrid1.Columns[14].Visible = true;
                this.DataGrid1.Columns[15].Visible = true;
                this.DataGrid1.Columns[16].Visible = true;
                this.DataGrid1.Columns[17].Visible = false;
                this.DataGrid1.Columns[18].Visible = false;
                this.DataGrid1.Columns[19].Visible = false;
            }
            catch (Exception er)
            {
                this.lblAssignID.Text = "";
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }