예제 #1
0
        private void GetList()
        {
            var list = new List <string>();

            if (txtorderno.Text.Trim() != "")
            {
                string[] OrderNo = txtorderno.Text.Trim().Split(new string[] { "\r\n" }, StringSplitOptions.None);
                OrderNo = OrderNo.Where(s => !string.IsNullOrEmpty(s)).ToArray();
                if (OrderNo.Length > 0)
                {
                    for (int i = 0; i < OrderNo.Length; i++)
                    {
                        list.Add(OrderNo[i]);
                    }
                }
            }

            var strOrder = string.Empty;

            if (list.Count > 0)
            {
                strOrder = "'" + string.Join("','", list.ToArray()) + "'";
            }

            string jh_dt     = cbx_jh.Checked == true ? txtStart.Value : "";    //计划日期
            string xq_dt     = cbx_xq.Checked == true ? txtEnd.Value : "";      //需求日期
            string orderkssj = cbxtb_DT.Checked == true ? txttbkssj.Value : ""; //提报开始时间
            string orderjssj = cbxtb_DT.Checked == true ? txttbjssj.Value : ""; //提报结束时间
            string shkssj    = cbxsh_DT.Checked == true ? txtshkssj.Value : ""; //审核开始时间
            string shjssj    = cbxsh_DT.Checked == true ? txtshjssj.Value : ""; //审核结束时间

            string pj = dropPJ.SelectedItem.Text == "全部" ? "" : dropPJ.SelectedItem.Value;

            string exestatus = dropStatus.SelectedItem.Value == "全部" ? "-1,0, 2, 6" : dropStatus.SelectedItem.Value;

            DataTable dt = tmo_order.GetOrderPlan(txtStlGrd.Text, dropSpec.SelectedItem.Value, txtMatCode.Text, txtcon.Text, txtCust.Text, txtSaleEmp.Text, dropOrderType.SelectedItem.Value == "全部" ? "" : dropOrderType.SelectedItem.Value, exestatus, dropArea.SelectedItem.Value, jh_dt, xq_dt, dropMatName.SelectedItem.Value, dropPack.SelectedItem.Value, txtstdcode.Text, orderkssj, orderjssj, shkssj, shjssj, strOrder, pj).Tables[0];

            if (dt.Rows.Count > 0)
            {
                dtOrderEx = dt;//导出文件

                rptList.DataSource = dt;
                rptList.DataBind();
                ltlsumwgt.Text = dt.Compute("sum(N_WGT)", "true").ToString();
                //ltlsumwgt_wg.Text = dt.Compute("sum(WG_WGT)", "true").ToString();
                //ltlsumwgt_fp.Text = dt.Compute("sum(N_LINE_MATCH_WGT)", "true").ToString();
            }
            else
            {
                rptList.DataSource = null;
                rptList.DataBind();
                ltlsumwgt.Text = "";
                //ltlsumwgt_wg.Text = "";
                //ltlsumwgt_fp.Text = "";
            }
        }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
         {
             DataTable dt = tmo_order.GetOrderPlan(Request.QueryString["ID"]).Tables[0];
             if (dt.Rows.Count > 0)
             {
                 rptList.DataSource = dt;
                 rptList.DataBind();
             }
             else
             {
                 rptList.DataSource = null;
                 rptList.DataBind();
             }
         }
     }
 }