Exemplo n.º 1
0
        private void BindData()
        {
            string          id   = Request.QueryString["id"];
            QualityCheckBLL bll  = null;
            WHQualityCheck  info = new WHQualityCheck();
            DataGridResult <WHQualityCheckResult> pList = new DataGridResult <WHQualityCheckResult>();

            try
            {
                bll = BLLFactory.CreateBLL <QualityCheckBLL>();
                int seq = 1;
                if (string.IsNullOrEmpty(id) == false)
                {
                    info.ID = id;
                    info    = bll.Get(info);

                    UIBindHelper.BindForm(this.Page, info);
                    if (info.CheckResult == "0")
                    {
                        RB1.Checked = true;
                    }
                    else
                    {
                        RB2.Checked = true;
                    }
                    this.BillNoList.Items.Add(new ListItem(info.InStockBillNo, info.BillID));
                    this.BillNoList.SelectedValue = info.BillID;
                    this.BillNoList.Enabled       = false;
                    this.hiID.Value         = info.ID;
                    this.HiCREATEUSER.Value = info.CREATEUSER;
                    this.HiCREATETIME.Value = info.CREATETIME.ToString();
                    List <WHQualityCheckResult> list = bll.GetResultList(id);
                    foreach (WHQualityCheckResult detail in list)
                    {
                        detail.DeleteAction = "deleteF(\'" + detail.FileName + "\')";

                        detail.DetailAction = "viewF(\'" + detail.FileName + "\')";
                        detail.SEQ          = seq++;
                    }
                    pList.Total = list.Count;
                    pList.Rows  = list;
                }
                else
                {
                    info             = new WHQualityCheck();
                    this.BillNO.Text = bll.GetNewBillNO();
                    info.CheckPerson = GetLoginInfo().UserName;
                    pList.Total      = 0;
                    pList.Rows       = new List <WHQualityCheckResult>();
                    UIBindHelper.BindForm(this.Page, info);
                }

                this.hiPList.Value = pList.GetJsonSource();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        private void BindData()
        {
            string           id   = Request.QueryString["id"];
            QualityCheckBLL  bll  = null;
            QualityCheckInfo info = new QualityCheckInfo();
            DataGridResult <QualityCheckResult> pList = new DataGridResult <QualityCheckResult>();

            try
            {
                bll = BLLFactory.CreateBLL <QualityCheckBLL>();
                int seq = 0;
                if (string.IsNullOrEmpty(id) == false)
                {
                    info.ID = id;
                    info    = bll.Get(info);
                    if (!string.IsNullOrEmpty(info.BatchNumber))
                    {
                        QualityCheckBLL  qcBll            = BLLFactory.CreateBLL <QualityCheckBLL>();
                        QualityCheckInfo qualityCheckInfo = qcBll.GetPDInfo(info.BatchNumber);
                        if (qualityCheckInfo != null)
                        {
                            info.PDDATE = qualityCheckInfo.PDDATE;
                            info.PDCODE = qualityCheckInfo.PDCODE;
                            info.PDNAME = qualityCheckInfo.PDNAME;
                        }
                    }
                    UIBindHelper.BindForm(this.Page, info);
                    if (info.CheckResult == "0")
                    {
                        RB1.Checked = true;
                    }
                    else
                    {
                        RB2.Checked = true;
                    }
                    this.BatchNumber.Enabled = false;
                    this.hiID.Value          = info.ID;
                    this.HiCREATEUSER.Value  = info.CREATEUSER;
                    this.HiCREATETIME.Value  = info.CREATETIME.ToString();
                    List <QualityCheckResult> list = bll.GetResultList(id);
                    foreach (QualityCheckResult detail in list)
                    {
                        detail.DeleteAction = "deleteF(\'" + detail.FileName + "\')";

                        detail.DetailAction = "viewF(\'" + detail.FileName + "\')";
                        detail.SEQ          = seq++;
                    }
                    pList.Total = list.Count;
                    pList.Rows  = list;
                }
                else
                {
                    info = new QualityCheckInfo();

                    info.CheckPerson = GetLoginInfo().UserName;
                    pList.Total      = 0;
                    pList.Rows       = new List <QualityCheckResult>();
                    UIBindHelper.BindForm(this.Page, info);
                }

                this.hiPList.Value = pList.GetJsonSource();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }