Esempio n. 1
0
        private void GetStlGrd()
        {
            DataTable dt = new DataTable();

            if (cbxmatcode.Checked)
            {
                var list = new List <string>();

                if (txtmatcode.Text.Trim() != "")
                {
                    string[] OrderNo = txtmatcode.Text.Trim().Split(new string[] { "\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()) + "'";
                }

                dt = tb_matrl_main.GetTWC_StlGrd(strOrder).Tables[0];
            }
            else
            {
                dt = tb_matrl_main.GetTWC_StlGrd(txtmatcode.Text, txtstlgrd.Text, tstspec.Text).Tables[0];
            }
            if (dt.Rows.Count > 0)
            {
                rptList.DataSource = dt;
                rptList.DataBind();
            }
            else
            {
                ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "", "alert('暂无头尾材产品')", true);
                rptList.DataSource = null;
                rptList.DataBind();
            }
        }