Beispiel #1
0
 protected override void MoveNext()
 {
     Model.PCPGOnlineCheck pcpgoc = this._pcpgocManager.GetNext(this._pcpgoc);
     if (pcpgoc == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this._pcpgoc = this._pcpgocManager.Get(pcpgoc.PCPGOnlineCheckId);
 }
Beispiel #2
0
 public EditForm(Model.PCPGOnlineCheck pcpgoc, string action)
     : this()
 {
     this._pcpgoc = pcpgoc;
     this.action  = action;
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
Beispiel #3
0
        public override void Refresh()
        {
            if (this._pcpgoc == null)
            {
                this.AddNew();
                this.action = "insert";
            }
            else
            {
                if (this.action == "view")
                {
                    this._pcpgoc = this._pcpgocManager.GetDetail(this._pcpgoc.PCPGOnlineCheckId);
                }
            }
            this.txtPCPGOnlineCheckId.Text        = this._pcpgoc.PCPGOnlineCheckId;
            this.txtPCImpactCheckDesc.Text        = this._pcpgoc.PCPGOnlineCheckDesc;
            this.DE_PCPGOnlineCheckDate.EditValue = this._pcpgoc.PCPGOnlineCheckDate.Value;
            //this.txtInvoiceCusXOId.Text = this._pcpgoc.InvoiceCusXOId;
            this.txtInvoiceCusXOId.Text          = this._pcpgoc.InvoiceXO == null ? "" : this._pcpgoc.InvoiceXO.CustomerInvoiceXOId;
            this.layoutDanJuBianHao.Text         = this._pcpgoc.PCPGOnlineCheckType < 0 ? "加工單編號:" : "委外單編號:";
            this.txtDatnJuBianHao.Text           = this._pcpgoc.FromPCId;
            this.nccCHCustomer.EditValue         = this._pcpgoc.Customer;
            this.nccWorkHouse.EditValue          = this._pcpgoc.WorkHouse;
            this.txtCheckStandard.Text           = this._pcpgoc.Customer == null ? "" : this._pcpgoc.Customer.CheckedStandard;
            this.nccEmployee0.EditValue          = this._pcpgoc.Employee;
            this.txtProductName.Text             = this._pcpgoc.Product == null ? "" : this._pcpgoc.Product.ToString();
            this.txtProductDescription.Rtf       = this._pcpgoc.Product == null ? "" : this._pcpgoc.Product.ProductDescription;
            this.calcInvoiceXOQuantity.EditValue = this._pcpgoc.InvoiceXOQuantity;

            this.newChooseContorlAuditEmp.EditValue = this._pcpgoc.AuditEmp;
            this.txt_AuditState.EditValue           = this.GetAuditName(this._pcpgoc.AuditState);

            this.bsPCPGOnlineCheckDetail.DataSource = this._pcpgoc.Details;

            base.Refresh();
            switch (this.action)
            {
            case "insert":
                this.gridView1.OptionsBehavior.Editable = true;
                break;

            case "update":
                this.gridView1.OptionsBehavior.Editable = true;
                break;

            case "view":
                this.gridView1.OptionsBehavior.Editable = false;
                break;
            }

            this.txtPCPGOnlineCheckId.Properties.ReadOnly = false;
            this.calcInvoiceXOQuantity.Enabled            = false;
            this.txtProductDescription.Enabled            = false;
        }
Beispiel #4
0
        protected override void AddNew()
        {
            this._pcpgoc = new Book.Model.PCPGOnlineCheck();
            this._pcpgoc.PCPGOnlineCheckId   = this._pcpgocManager.GetId();
            this._pcpgoc.PCPGOnlineCheckDate = DateTime.Now.Date;
            this._pcpgoc.PCPGOnlineCheckType = -1;
            this._pcpgoc.Employee            = BL.V.ActiveOperator.Employee;
            this._pcpgoc.EmployeeId          = BL.V.ActiveOperator.EmployeeId;

            //初始化一条详细
            this._pcpgoc.Details = new List <Model.PCPGOnlineCheckDetail>();
            //this.AddDataRows();
        }
Beispiel #5
0
 public EditForm(string invoiceId)
     : this()
 {
     this._pcpgoc = this._pcpgocManager.GetDetail(invoiceId);
     if (this._pcpgoc == null)
     {
         throw new ArithmeticException("invoiceid");
     }
     this.action = "view";
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
        public void Update(Model.PCPGOnlineCheck pCPGOnlineCheck)
        {
            Validate(pCPGOnlineCheck);
            if (pCPGOnlineCheck != null)
            {
                try
                {
                    BL.V.BeginTransaction();

                    //修改详细
                    IList <Model.PCPGOnlineCheckDetail> DBDetails = PCPGOCDManager.Select(pCPGOnlineCheck.PCPGOnlineCheckId);
                    foreach (Model.PCPGOnlineCheckDetail d in DBDetails)
                    {
                        if (pCPGOnlineCheck.Details.Any(ind => d.PCPGOnlineCheckDetailId == ind.PCPGOnlineCheckDetailId))
                        {
                            //Update
                            PCPGOCDManager.Update(pCPGOnlineCheck.Details.First(ind => d.PCPGOnlineCheckDetailId == ind.PCPGOnlineCheckDetailId));
                        }
                        else
                        {
                            //Delete
                            opticsTestManager.DeleteByPCPGOnlineCheckDetailId(d.PCPGOnlineCheckDetailId);
                            thicknessManager.DeleteByPCPGOnlineCheckDetailId(d.PCPGOnlineCheckDetailId);

                            PCPGOCDManager.Delete(d.PCPGOnlineCheckDetailId);
                        }
                    }

                    foreach (Model.PCPGOnlineCheckDetail d in pCPGOnlineCheck.Details)
                    {
                        if (!DBDetails.Any(ind => ind.PCPGOnlineCheckDetailId == d.PCPGOnlineCheckDetailId))
                        {
                            d.PCPGOnlineCheckId = pCPGOnlineCheck.PCPGOnlineCheckId;
                            PCPGOCDManager.Insert(d);
                        }
                    }

                    //修改头
                    pCPGOnlineCheck.UpdateTime = DateTime.Now;
                    accessor.Update(pCPGOnlineCheck);

                    BL.V.CommitTransaction();
                }
                catch
                {
                    BL.V.RollbackTransaction();
                    throw;
                }
            }
        }
Beispiel #7
0
 public EditForm(Model.PCPGOnlineCheck pcpgoc)
     : this()
 {
     if (pcpgoc == null)
     {
         throw new ArithmeticException("invoiceid");
     }
     this._pcpgoc = pcpgoc;
     this.action  = "view";
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
 private void Validate(Model.PCPGOnlineCheck pcpgoc)
 {
     if (string.IsNullOrEmpty(pcpgoc.PCPGOnlineCheckId))
     {
         throw new Helper.RequireValueException(Model.PCPGOnlineCheck.PRO_PCPGOnlineCheckId);
     }
     if (string.IsNullOrEmpty(pcpgoc.PCPGOnlineCheckDate.Value.ToString()))
     {
         throw new Helper.RequireValueException(Model.PCPGOnlineCheck.PRO_PCPGOnlineCheckDate);
     }
     if (string.IsNullOrEmpty(pcpgoc.EmployeeId))
     {
         throw new Helper.RequireValueException(Model.PCPGOnlineCheck.PRO_EmployeeId);
     }
 }
Beispiel #9
0
        //选择单据
        private void barBtnSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ListForm form = new ListForm();

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                Model.PCPGOnlineCheck currentModel = form.SelectItem as Model.PCPGOnlineCheck;
                if (currentModel != null)
                {
                    this._pcpgoc = currentModel;
                    this._pcpgoc = this._pcpgocManager.GetDetail(this._pcpgoc.PCPGOnlineCheckId);
                    this.Refresh();
                }
            }
            form.Dispose();
            GC.Collect();
        }
Beispiel #10
0
 protected override void Delete()
 {
     if (this._pcpgoc == null)
     {
         return;
     }
     if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
     {
         return;
     }
     this._pcpgocManager.Delete(this._pcpgoc);
     this._pcpgoc = this._pcpgocManager.GetNext(this._pcpgoc);
     if (this._pcpgoc == null)
     {
         this._pcpgoc = this._pcpgocManager.GetLast();
     }
 }
 private void TiGuiExists(Model.PCPGOnlineCheck model)
 {
     if (this.ExistsPrimary(model.PCPGOnlineCheckId))
     {
         //设置KEY值
         string invoiceKind   = this.GetInvoiceKind().ToLower();
         string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, model.InsertTime.Value.Year);
         string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, model.InsertTime.Value.Year, model.InsertTime.Value.Month);
         string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, model.InsertTime.Value.ToString("yyyy-MM-dd"));
         string sequencekey   = string.Format(invoiceKind);
         SequenceManager.Increment(sequencekey_y);
         SequenceManager.Increment(sequencekey_m);
         SequenceManager.Increment(sequencekey_d);
         SequenceManager.Increment(sequencekey);
         model.PCPGOnlineCheckId = this.GetId(model.InsertTime.Value);
         TiGuiExists(model);
     }
 }
Beispiel #12
0
        //查询
        private void barBtnSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ListForm form = new ListForm();

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                //Model.PCPGOnlineCheck currentModel = form.SelectItem as Model.PCPGOnlineCheck;
                DataRowView dv = form.SelectItem as DataRowView;
                if (dv != null)
                {
                    //this._pcpgoc = currentModel;
                    this._pcpgoc = this._pcpgocManager.GetDetail(dv.Row[0].ToString());
                    this.Refresh();
                }
            }
            form.Dispose();
            GC.Collect();
        }
        public void Insert(Model.PCPGOnlineCheck pCPGOnlineCheck)
        {
            Validate(pCPGOnlineCheck);
            try
            {
                BL.V.BeginTransaction();
                pCPGOnlineCheck.InsertTime = DateTime.Now;
                pCPGOnlineCheck.UpdateTime = DateTime.Now;
                TiGuiExists(pCPGOnlineCheck);

                string invoiceKind   = this.GetInvoiceKind().ToLower();
                string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, pCPGOnlineCheck.InsertTime.Value.Year);
                string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, pCPGOnlineCheck.InsertTime.Value.Year, pCPGOnlineCheck.InsertTime.Value.Month);
                string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, pCPGOnlineCheck.InsertTime.Value.ToString("yyyy-MM-dd"));
                string sequencekey   = string.Format(invoiceKind);

                SequenceManager.Increment(sequencekey_y);
                SequenceManager.Increment(sequencekey_m);
                SequenceManager.Increment(sequencekey_d);
                SequenceManager.Increment(sequencekey);

                accessor.Insert(pCPGOnlineCheck);

                foreach (Model.PCPGOnlineCheckDetail detail in pCPGOnlineCheck.Details)
                {
                    detail.PCPGOnlineCheckId = pCPGOnlineCheck.PCPGOnlineCheckId;
                    PCPGOCDManager.Insert(detail);
                }
                BL.V.CommitTransaction();
            }
            catch (Exception ex)
            {
                BL.V.RollbackTransaction();
                throw;
            }
        }
 public Model.PCPGOnlineCheck GetNext(Model.PCPGOnlineCheck e)
 {
     return(accessor.GetNext(e));
 }
Beispiel #15
0
 public void Update(Model.PCPGOnlineCheck e)
 {
     this.Update <Model.PCPGOnlineCheck>(e);
 }
Beispiel #16
0
 public bool HasRowsBefore(Model.PCPGOnlineCheck e)
 {
     return(sqlmapper.QueryForObject <bool>("PCPGOnlineCheck.has_rows_before", e));
 }
Beispiel #17
0
 public void Insert(Model.PCPGOnlineCheck e)
 {
     this.Insert <Model.PCPGOnlineCheck>(e);
 }
 public Model.PCPGOnlineCheck GetPrev(Model.PCPGOnlineCheck e)
 {
     return(accessor.GetPrev(e));
 }
Beispiel #19
0
        public override void Refresh()
        {
            if (this._pcpgoc == null)
            {
                this.AddNew();
                this.action = "insert";
            }
            else
            {
                if (this.action == "view")
                {
                    this._pcpgoc = this._pcpgocManager.GetDetail(this._pcpgoc.PCPGOnlineCheckId);
                }
            }
            this.txtPCPGOnlineCheckId.Text        = this._pcpgoc.PCPGOnlineCheckId;
            this.txtPCImpactCheckDesc.Text        = this._pcpgoc.PCPGOnlineCheckDesc;
            this.DE_PCPGOnlineCheckDate.EditValue = this._pcpgoc.PCPGOnlineCheckDate.Value;
            this.txtInvoiceCusXOId.Text           = this._pcpgoc.InvoiceCusXOId;
            //this.layoutDanJuBianHao.Text = this._pcpgoc.PCPGOnlineCheckType < 0 ? "加工單編號:" : "委外單編號:";
            this.txtDatnJuBianHao.Text = this._pcpgoc.FromPCId;
            //this.nccCHCustomer.EditValue = this._pcpgoc.Customer;
            this.nccWorkHouse.EditValue = this._pcpgoc.WorkHouse;
            //this.txtCheckStandard.Text = this._pcpgoc.Customer == null ? "" : this._pcpgoc.Customer.CheckedStandard;
            this.nccEmployee0.EditValue = this._pcpgoc.Employee;
            //this.txtProductName.Text = this._pcpgoc.Product == null ? "" : this._pcpgoc.Product.ToString();
            //this.txtProductDescription.Rtf = this._pcpgoc.Product == null ? "" : this._pcpgoc.Product.ProductDescription;
            this.calcInvoiceXOQuantity.EditValue = this._pcpgoc.InvoiceXOQuantity;

            this.newChooseContorlAuditEmp.EditValue = this._pcpgoc.AuditEmp;
            this.txt_AuditState.EditValue           = this.GetAuditName(this._pcpgoc.AuditState);
            this.lookUpEditBusinessHours.EditValue  = this._pcpgoc.BusinessHoursId;

            this.bsPCPGOnlineCheckDetail.DataSource = this._pcpgoc.Details;

            #region LookUpEditor

            DataTable  dt  = new DataTable();
            DataColumn dc  = new DataColumn("id", typeof(string));
            DataColumn dc1 = new DataColumn("name", typeof(string));
            dt.Columns.Add(dc);
            dt.Columns.Add(dc1);
            DataRow dr;
            dr    = dt.NewRow();
            dr[0] = "-1";
            dr[1] = string.Empty;
            dt.Rows.Add(dr);
            dr    = dt.NewRow();
            dr[0] = "0";
            dr[1] = "√";
            dt.Rows.Add(dr);
            dr    = dt.NewRow();
            dr[0] = "1";
            dr[1] = "△";
            dt.Rows.Add(dr);
            dr    = dt.NewRow();
            dr[0] = "2";
            dr[1] = "X";
            dt.Rows.Add(dr);

            for (int i = 0; i < this.gridView1.Columns.Count; i++)
            {
                if (this.gridView1.Columns[i].ColumnEdit is DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit)
                {
                    if (this.gridView1.Columns[i].Name == "colattrUVChengFen" || this.gridView1.Columns[i].Name == "attrTouShiLv" || this.gridView1.Columns[i].Name == "attrFangWuMoYingDu" || this.gridView1.Columns[i].Name == "colattrQiangHuaMo" || this.gridView1.Columns[i].Name == "colattrZhePian" || this.gridView1.Columns[i].Name == "colattrMaoBian" || this.gridView1.Columns[i].Name == "ImpactCheck" || this.gridView1.Columns[i].Name == "attrExterior" || this.gridView1.Columns[i].Name == "attrDianDuPDSLv" || this.gridView1.Columns[i].Name == "attrDianDuBOLiTest" || this.gridView1.Columns[i].Name == "attrGaoDiJiaoL" || this.gridView1.Columns[i].Name == "attrGaoDiJiaoR" || this.gridView1.Columns[i].Name == "gridColumn1" || this.gridView1.Columns[i].Name == "colattrFangWuMoYingDu" || this.gridView1.Columns[i].Name == "colattrTouShiLv")
                    {
                        ((DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit) this.gridView1.Columns[i].ColumnEdit).DataSource = dt;
                        ((DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit) this.gridView1.Columns[i].ColumnEdit).Columns.Clear();
                        ((DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit) this.gridView1.Columns[i].ColumnEdit).NullText = "";
                        ((DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit) this.gridView1.Columns[i].ColumnEdit).Columns.AddRange(new DevExpress.XtraEditors.Controls.LookUpColumnInfo[] {
                            new DevExpress.XtraEditors.Controls.LookUpColumnInfo("name", 25, "標誌"),
                        });
                        ((DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit) this.gridView1.Columns[i].ColumnEdit).DisplayMember = "name";
                        ((DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit) this.gridView1.Columns[i].ColumnEdit).ValueMember   = "name";
                    }
                }
            }

            #endregion

            base.Refresh();
            //switch (this.action)
            //{
            //    case "insert":
            //        this.gridView1.OptionsBehavior.Editable = true;
            //        break;
            //    case "update":
            //        this.gridView1.OptionsBehavior.Editable = true;
            //        break;
            //    case "view":
            //        this.gridView1.OptionsBehavior.Editable = false;
            //        break;
            //}

            this.txtPCPGOnlineCheckId.Properties.ReadOnly = true;
            this.calcInvoiceXOQuantity.Enabled            = false;
            this.txtProductDescription.Enabled            = false;
        }
Beispiel #20
0
 public Model.PCPGOnlineCheck GetPrev(Model.PCPGOnlineCheck e)
 {
     return(sqlmapper.QueryForObject <Model.PCPGOnlineCheck>("PCPGOnlineCheck.get_prev", e));
 }
Beispiel #21
0
 public Model.PCPGOnlineCheck GetNext(Model.PCPGOnlineCheck e)
 {
     return(sqlmapper.QueryForObject <Model.PCPGOnlineCheck>("PCPGOnlineCheck.get_next", e));
 }
Beispiel #22
0
 public bool HasRowsAfter(Model.PCPGOnlineCheck e)
 {
     return(sqlmapper.QueryForObject <bool>("PCPGOnlineCheck.has_rows_after", e));
 }
 public bool HasRowsAfter(Model.PCPGOnlineCheck e)
 {
     return(accessor.HasRowsAfter(e));
 }
 public bool HasRowsBefore(Model.PCPGOnlineCheck e)
 {
     return(accessor.HasRowsBefore(e));
 }
Beispiel #25
0
 protected override void MoveFirst()
 {
     this._pcpgoc = this._pcpgocManager.Get(this._pcpgocManager.GetFirst() == null ? "" : this._pcpgocManager.GetFirst().PCPGOnlineCheckId);
 }
 public Model.PCPGOnlineCheck GetDetail(string PCPGOCId)
 {
     Model.PCPGOnlineCheck pcpgoc = accessor.Get(PCPGOCId);
     pcpgoc.Details = PCPGOCDManager.Select(PCPGOCId);
     return(pcpgoc);
 }
Beispiel #27
0
        public Ro(Model.PCPGOnlineCheck pcpgoc)
        {
            InitializeComponent();
            if (pcpgoc == null)
            {
                return;
            }

            this._DDetails  = this._pcpgcDetailm.SelectByFromInvoiceId(pcpgoc.PCPGOnlineCheckId);
            this.DataSource = this._DDetails.OrderBy(d => d.PCPGOnlineCheckDetailDate).ToList();

            //CompanyInfo
            this.lblCompanyInfoName.Text = BL.Settings.CompanyChineseName;
            this.lblDataName.Text        = Properties.Resources.PCPGOnlineCheck;
            //this.lblPrintDate.Text += DateTime.Now.ToShortDateString();

            //Control
            this.lblFromInvoiceId.Text     = pcpgoc.FromPCId;
            this.lblCHCustomer.Text        = pcpgoc.Customer == null ? "" : pcpgoc.Customer.ToString();
            this.lblCheckStandard.Text     = pcpgoc.Customer == null ? "" : pcpgoc.Customer.CheckedStandard;
            this.lblCustomerInvoiceId.Text = pcpgoc.InvoiceXO == null ? "" : pcpgoc.InvoiceXO.CustomerInvoiceXOId;
            this.lblEmployee.Text          = pcpgoc.Employee == null ? "" : pcpgoc.Employee.ToString();
            this.lblProductName.Text       = pcpgoc.Product == null ? "" : pcpgoc.Product.ToString();
            this.lblInvoiceXOQuantity.Text = pcpgoc.InvoiceXOQuantity.HasValue ? pcpgoc.InvoiceXOQuantity.Value.ToString() : "";
            if (pcpgoc.PCPGOnlineCheckType.Value > 0)
            {
                if (this._pocm.Get(pcpgoc.FromPCId) != null)
                {
                    this.lblSupplier.Text = this._pocm.Get(pcpgoc.FromPCId).Supplier == null ? "" : this._pocm.Get(pcpgoc.FromPCId).Supplier.ToString();
                }
            }
            else
            {
                this.lblSupplier.Text = "";
            }
            if (pcpgoc.Details.Count > 0)
            {
                this.lblOrderCount.Text = pcpgoc.Details[0].CheckQuantity.HasValue ? pcpgoc.Details[0].CheckQuantity.Value.ToString() : "0";
            }
            if (pcpgoc.PCPGOnlineCheckType > 0)
            {
                this.lblFromInvoiceIDText.Text = "ίÍâ†Î¾ŽÌ–";
            }
            else
            {
                this.lblFromInvoiceIDText.Text = "¼Ó¹¤†Î¾ŽÌ–";
            }
            this.RichTextProductDesc.Rtf = pcpgoc.Product == null ? "" : pcpgoc.Product.ProductDescription;
            //this.lbl_CustomerProductName.Text = pcpgoc.Product == null ? "" : pcpgoc.Product.CustomerProductName;
            if (pcpgoc.Product != null)
            {
                if (string.IsNullOrEmpty(pcpgoc.Product.CustomerProductName))
                {
                    this.lbl_CustomerProductName.Text = CommonHelp.GetCustomerProductNameByPronoteHeaderId(pcpgoc.FromPCId, pcpgoc.ProductId);
                }
                else
                {
                    this.lbl_CustomerProductName.Text = pcpgoc.Product.CustomerProductName;
                }
            }


            //Detail
            this.TCPCPGOnlineCheckId.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_PCPGOnlineCheckId);
            this.TCattrDianDuBOLiTest.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrDianDuBOLiTest);
            this.TCattrDianDuPDSLv.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrDianDuPDSLv);
            this.TCattrExterior.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrExterior);
            this.TCattrQiangHuaMo.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrQiangHuaMo);
            //this.TCattrQiangHuaMoYingdu.DataBindings.Add("Text",this.DataSource,Model.PCPGOnlineCheckDetail.PRO_attrQiangHuaMoYingDu);
            this.TCFangWuMo.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrFangWuMo);
            //this.TCattrFangWuMoYingDu.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrFangWuMoYingDu);
            this.TCattrGaoDiJiaoL.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrGaoDiJiaoL);
            this.TCattrGaoDiJiaoR.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrGaoDiJiaoR);
            this.TCattrGuanXue.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrGuanXue);
            this.TCattrHouDu.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrHouDu);
            this.TCattrMaoBian.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrMaoBian);
            this.TCattrTouShiLv.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrTouShiLv);
            this.TCattrUVChengFen.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrUVChengFen);
            //this.TCattrZhePian.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrZhePian);
            this.TCattrZhuangJiaoSJDL.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrZhuangJiaoSJDL);
            this.TCCheckQuantity.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_CheckQuantity);
            this.TCImpactCheck.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_ImpactCheck);
            this.TCPCPGOnlineCheckDetailDate.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_PCPGOnlineCheckDetailDate, "{0:yyyy-MM-dd HH:mm:ss}");
            this.xrtBusinessHours.DataBindings.Add("Text", this.DataSource, "BusinessHours." + Model.BusinessHours.PROPERTY_BUSINESSHOURSNAME);

            this.subReportGX.ReportSource = new subReportGX();
            this.subReportHD.ReportSource = new subReportHD();
        }
Beispiel #28
0
        public Ro(Model.PCPGOnlineCheck pcpgoc)
        {
            InitializeComponent();
            if (pcpgoc == null)
            {
                return;
            }

            this._DDetails  = this._pcpgcDetailm.SelectByFromInvoiceId(pcpgoc.PCPGOnlineCheckId);
            this.DataSource = this._DDetails;

            //CompanyInfo
            this.lblCompanyInfoName.Text = BL.Settings.CompanyChineseName;
            this.lblDataName.Text        = Properties.Resources.PCPGOnlineCheck;
            this.lblPrintDate.Text      += DateTime.Now.ToShortDateString();

            //Control
            this.lblPCPGOnlineCheckId.Text = pcpgoc.PCPGOnlineCheckId;
            this.lblDate.Text = pcpgoc.PCPGOnlineCheckDate == null ? "" : pcpgoc.PCPGOnlineCheckDate.Value.ToString("yyyy-MM-dd");
            //this.lblCheckStandard.Text = pcpgoc.Customer == null ? "" : pcpgoc.Customer.CheckedStandard;
            this.lblEmployee.Text = pcpgoc.Employee == null ? "" : pcpgoc.Employee.ToString();
            //this.lblProductName.Text = pcpgoc.Product == null ? "" : pcpgoc.Product.ToString();
            //this.lblInvoiceXOQuantity.Text = pcpgoc.InvoiceXOQuantity.HasValue ? pcpgoc.InvoiceXOQuantity.Value.ToString() : "";
            //if (pcpgoc.PCPGOnlineCheckType.Value > 0)
            //    this.lblSupplier.Text = this._pocm.Get(pcpgoc.FromPCId) == null ? "" : (this._pocm.Get(pcpgoc.FromPCId).Supplier == null ? "" : this._pocm.Get(pcpgoc.FromPCId).Supplier.ToString());
            //else
            //    this.lblSupplier.Text = "";
            //this.lblOrderCount.Text = pcpgoc.Details[0].CheckQuantity.HasValue ? pcpgoc.Details[0].CheckQuantity.Value.ToString() : "0";
            if (pcpgoc.PCPGOnlineCheckType == 1)
            {
                this.lblFromInvoice.Text = "委外合同單";
            }
            else if (pcpgoc.PCPGOnlineCheckType == -1)
            {
                this.lblFromInvoice.Text = "生產加工單";
            }
            else if (pcpgoc.PCPGOnlineCheckType == 0)
            {
                this.lblFromInvoice.Text = "採購單";
            }
            this.lblBusinessHours.Text = pcpgoc.BusinessHours == null ? null : pcpgoc.BusinessHours.BusinessHoursName;
            this.lblWorkHouse.Text     = pcpgoc.WorkHouse == null ? null : pcpgoc.WorkHouse.ToString();

            //Detail
            this.TCProduct.DataBindings.Add("Text", this.DataSource, Model.Product.PRO_ProductName);
            this.TCattrDianDuBOLiTest.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrDianDuBOLiTest);
            this.TCattrDianDuPDSLv.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrDianDuPDSLv);
            this.TCattrExterior.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrExterior);
            this.TCattrFangWuMoYingDu.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrFangWuMoYingDu);
            this.TCattrGaoDiJiaoL.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrGaoDiJiaoL);
            this.TCattrGaoDiJiaoR.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrGaoDiJiaoR);
            this.TCattrGuanXue.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrGuanXue);
            this.TCattrHouDu.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrHouDu);
            this.TCattrMaoBian.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrMaoBian);
            this.TCattrQiangHuaMo.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrQiangHuaMo);
            this.TCattrTouShiLv.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrTouShiLv);
            this.TCattrUVChengFen.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrUVChengFen);
            this.TCattrZhePian.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrZhePian);
            this.TCattrZhuangJiaoSJDL.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_attrZhuangJiaoSJDL);
            this.TCCheckQuantity.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_CheckQuantity);
            this.TCImpactCheck.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_ImpactCheck);
            this.TCPCPGOnlineCheckDetailDate.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_PCPGOnlineCheckDetailDate, "{0:yyyy-MM-dd HH:mm:ss}");
            this.TCFromInvoiceId.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_FromInvoiceId);
            this.TCCheckStandard.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_CheckedStandard);
            this.TCInvoiceCusId.DataBindings.Add("Text", this.DataSource, Model.PCPGOnlineCheckDetail.PRO_InvoiceCusXOId);

            this.subReportGX.ReportSource = new subReportGX();
            this.subReportHD.ReportSource = new subReportHD();
        }