예제 #1
0
        private void btnQuery_Click(object sender, System.EventArgs e)
        {
            string strSendSerial = this.txtSendSerial.Text.Trim();

            if (strSendSerial == "")
            {
                this.SetErrorMsgPageBydirHistory("出货单号不能为空!");
                return;
            }

            DataTable dtSendLog = new DataTable("dtSendLog");

            dtSendLog.Columns.Add("cnnSendSerialNo");
            DataRow dr = dtSendLog.NewRow();

            dr["cnnSendSerialNo"] = strSendSerial;
            dtSendLog.Rows.Add(dr);

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

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                DataTable dtout = StoBusi.GetBillOfReceiveSendPrint(strSendSerial);
                if (dtout == null)
                {
                    this.btnPrint.Enabled = false;
                    this.SetErrorMsgPageBydir("查询出错,请重试!");
                    return;
                }
                else
                {
                    dtout.TableName = "dtSendDetail";
                    Session.Remove("BillPrint");
                    DataSet dsout = new DataSet("领料发货单");
                    dsout.Tables.Add(dtout.Copy());
                    dsout.Tables.Add(dtSendLog);
                    Session["BillPrint"]  = dsout;
                    this.btnPrint.Enabled = true;
                }

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