Esempio n. 1
0
        /// <summary>
        /// 绑定列表
        /// </summary>
        private void BindList()
        {
            using (PurProvider purProvider = new PurProvider())
            {
                string prNo = PRNo.Text.Trim();
                if (prNo.Length > 0)
                {
                    var pur = purProvider.GetPRDetail(prNo);
                    if (pur != null)
                    {
                        ORDNO.Text    = pur["PRHSORD"].ToString();
                        DRAWNO.Text   = pur["PRHMNO"].ToString();
                        PRType.Text   = pur["prhpgm"].ToString();
                        PRStatus.Text = pur["PRHSTAT"].ToString();

                        DataTable table;
                        if (ORDNO.Text.Trim().Length > 0) //非材料请购
                        {
                            table = purProvider.GetPRDetailNotMat(prNo);
                        }
                        else  //材料请购
                        {
                            table = purProvider.GetPRDetailMat(prNo);
                        }

                        List.DataSource = table;
                        List.DataBind();

                        PostButton.Enabled = true;
                    }
                    else
                    {
                        this.Initialize();
                        List.DataSource = null;
                        List.DataBind();
                    }
                }
                else
                {
                    this.Initialize();
                    List.DataSource = null;
                    List.DataBind();
                }
            }
        }