Exemple #1
0
 public void Delete(Model.PCBoxFootCheck PCBoxFootCheck)
 {
     if (PCBoxFootCheck != null)
     {
         this.Delete(PCBoxFootCheck.PCBoxFootCheckId);
     }
 }
Exemple #2
0
        public RO(Model.PCBoxFootCheck model)
            : this()
        {
            if (model != null)
            {
                this.lblCompanyName.Text = BL.Settings.CompanyChineseName;
                this.lblReportName.Text  = Properties.Resources.PCBoxFootCheck;
                this.lblPrintDate.Text  += DateTime.Now.ToString("yyyy-MM-dd");

                this.lblId.Text              = model.PCBoxFootCheckId;
                this.lblCheckDate.Text       = model.CheckDate == null ? null : model.CheckDate.Value.ToString("yyyy-MM-dd");
                this.lblProductName.Text     = model.Product == null ? null : model.Product.ProductName;
                this.lblInvoiceXO.Text       = model.InvoiceXO == null ? null : model.InvoiceXO.CustomerInvoiceXOId;
                this.lblPronoteHeader.Text   = model.PronoteHeaderId;
                this.lblEmployee.Text        = model.Employee == null ? null : model.Employee.EmployeeName;
                this.xrRichTextNote.Rtf      = model.Note;
                this.lbl_quyangshuliang.Text = model.GetNum.HasValue ? model.GetNum.ToString() : string.Empty;
                this.lbl_shouceshuliang.Text = model.CheckNum.HasValue ? model.CheckNum.ToString() : string.Empty;
                this.lbl_hegeshuliang.Text   = model.PassNum.HasValue ? model.PassNum.ToString() : string.Empty;
                this.lbl_buhegeshuliang.Text = model.NoPassNum.HasValue ? model.NoPassNum.ToString() : string.Empty;

                //this.DataSource = model;
                //this.TCFlap.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheck.PRO_Flap);
                //this.TCExterior.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheck.PRO_Exterior);
                this.TCFlap.Text           = Trans(model.Flap);
                this.TCExterior.Text       = Trans(model.Exterior);
                this.TCOfColor.Text        = Trans(model.OfColor);
                this.TCHeightFootL.Text    = Trans(model.HeightFootL);
                this.TCHeightFootR.Text    = Trans(model.HeightFootR);
                this.TCFootElasticL.Text   = Trans(model.HeightFootL);
                this.TCFootElasticR.Text   = Trans(model.HeightFootR);
                this.TCImpactTest.Text     = Trans(model.ImpactTest);
                this.TCAceticacidTest.Text = Trans(model.AceticacidTest);
            }
        }
Exemple #3
0
 protected override void MoveLast()
 {
     if (this.LastFlag == 1)
     {
         this.LastFlag = 0;
         return;
     }
     this._pcBoxFootCheck = this._pcBoxFootCheckManager.GetLast();
 }
Exemple #4
0
 protected override void MovePrev()
 {
     Model.PCBoxFootCheck pcBoxFootCheck = this._pcBoxFootCheckManager.GetPrev(this._pcBoxFootCheck);
     if (pcBoxFootCheck == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this._pcBoxFootCheck = pcBoxFootCheck;
 }
Exemple #5
0
        public override void Refresh()
        {
            if (this._pcBoxFootCheck == null)
            {
                this.AddNew();
            }
            else
            {
                if (this.action == "view")
                {
                    this._pcBoxFootCheck = this._pcBoxFootCheckManager.Get(this._pcBoxFootCheck.PCBoxFootCheckId);
                }
            }

            this.txt_Id.EditValue            = this._pcBoxFootCheck.PCBoxFootCheckId;
            this.date_Check.EditValue        = this._pcBoxFootCheck.CheckDate;
            this.newChooseEmployee.EditValue = this._pcBoxFootCheck.Employee;
            this.txt_Product.EditValue       = this._pcBoxFootCheck.Product == null ? null : this._pcBoxFootCheck.Product.ToString();

            if (this._pcBoxFootCheck.InvoiceXO != null)
            {
                this.txt_InvoiceXO.EditValue = this._pcBoxFootCheck.InvoiceXO.CustomerInvoiceXOId;
            }
            else if (this._pcBoxFootCheck.PronoteHeader != null)
            {
                this.txt_InvoiceXO.EditValue = this._pcBoxFootCheck.PronoteHeader.InvoiceXO == null ? "" : this._pcBoxFootCheck.PronoteHeader.InvoiceXO.CustomerInvoiceXOId;
            }
            this.txt_PronoteHeader.EditValue        = this._pcBoxFootCheck.PronoteHeaderId;
            this.richTextNote.Rtf                   = this._pcBoxFootCheck.Note;
            this.spinEditGetNum.EditValue           = this._pcBoxFootCheck.GetNum;
            this.spinEditCheckNum.EditValue         = this._pcBoxFootCheck.CheckNum;
            this.spinEditPassNum.EditValue          = this._pcBoxFootCheck.PassNum;
            this.spinEditNoPassNum.EditValue        = this._pcBoxFootCheck.NoPassNum;
            this.newChooseContorlAuditEmp.EditValue = this._pcBoxFootCheck.AuditEmp;
            this.txt_AuditState.EditValue           = this.GetAuditName(this._pcBoxFootCheck.AuditState);
            this.cobUnit.EditValue                  = this._pcBoxFootCheck.ProductUnit;
            this._pcBoxFootCheck.Details            = this._detailManager.SelectByPCBoxFootCheckId(this._pcBoxFootCheck.PCBoxFootCheckId);
            this.bindingSourceDetail.DataSource     = this._pcBoxFootCheck.Details;
            //GetRadioGroup();
            base.Refresh();

            switch (this.action)
            {
            case "view":
                this.gridView1.OptionsBehavior.Editable = false;
                break;

            default:
                this.gridView1.OptionsBehavior.Editable = true;
                break;
            }

            this.txt_Id.Properties.ReadOnly = true;
        }
Exemple #6
0
        private void barButtonItemSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ListForm f = new ListForm();

            if (f.ShowDialog(this) == DialogResult.OK)
            {
                this._pcBoxFootCheck = f.SelectItem as Model.PCBoxFootCheck;
                this.action          = "view";
                this.Refresh();
            }
        }
Exemple #7
0
 protected override void AddNew()
 {
     this._pcBoxFootCheck = new Book.Model.PCBoxFootCheck();
     this._pcBoxFootCheck.PCBoxFootCheckId = this._pcBoxFootCheckManager.GetId();
     this._pcBoxFootCheckManager.TiGuiExists(this._pcBoxFootCheck);
     this._pcBoxFootCheck.CheckNum  = 1;  //检测数量默认为一
     this._pcBoxFootCheck.CheckDate = DateTime.Now;
     this._pcBoxFootCheck.Employee  = BL.V.ActiveOperator.Employee;
     if (this._pcBoxFootCheck.Employee != null)
     {
         this._pcBoxFootCheck.EmployeeId = this._pcBoxFootCheck.Employee.EmployeeId;
     }
     this.action = "insert";
 }
Exemple #8
0
 public EditForm(Model.PCBoxFootCheck PCBoxFootCheck)
     : this()
 {
     if (PCBoxFootCheck == null)
     {
         throw new ArithmeticException("PCBoxFootCheckId");
     }
     this._pcBoxFootCheck = PCBoxFootCheck;
     this.action          = "view";
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
Exemple #9
0
 int LastFlag = 0; //页面载 入时是否执行 last方法
 public EditForm(string PCBoxFootCheckId)
     : this()
 {
     this._pcBoxFootCheck = this._pcBoxFootCheckManager.Get(PCBoxFootCheckId);
     if (this._pcBoxFootCheck == null)
     {
         throw new ArithmeticException("PCBoxFootCheckId");
     }
     this.action = "view";
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
Exemple #10
0
        /// <summary>
        /// Update a PCBoxFootCheck.
        /// </summary>
        public void Update(Model.PCBoxFootCheck pCBoxFootCheck)
        {
            //
            // todo: add other logic here.
            //
            pCBoxFootCheck.UpdateTime = DateTime.Now;
            accessor.Update(pCBoxFootCheck);

            DetailAccessor.DeleteByPCBoxFootCheckId(pCBoxFootCheck.PCBoxFootCheckId);
            foreach (var item in pCBoxFootCheck.Details)
            {
                item.PCBoxFootCheckId = pCBoxFootCheck.PCBoxFootCheckId;
                DetailAccessor.Insert(item);
            }
        }
Exemple #11
0
 protected override void Delete()
 {
     if (this._pcBoxFootCheck == null)
     {
         return;
     }
     if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
     {
         return;
     }
     this._pcBoxFootCheckManager.Delete(this._pcBoxFootCheck.PCBoxFootCheckId);
     this._pcBoxFootCheck = this._pcBoxFootCheckManager.GetNext(this._pcBoxFootCheck);
     if (this._pcBoxFootCheck == null)
     {
         this._pcBoxFootCheck = this._pcBoxFootCheckManager.GetLast();
     }
 }
Exemple #12
0
 /// <summary>
 /// Update a PCBoxFootCheck.
 /// </summary>
 public void Update(Model.PCBoxFootCheck pCBoxFootCheck)
 {
     //
     // todo: add other logic here.
     //
     try
     {
         BL.V.BeginTransaction();
         pCBoxFootCheck.UpdateTime = DateTime.Now;
         accessor.Update(pCBoxFootCheck);
         BL.V.CommitTransaction();
     }
     catch
     {
         BL.V.RollbackTransaction();
         throw;
     }
 }
Exemple #13
0
 public void TiGuiExists(Model.PCBoxFootCheck model)
 {
     if (this.ExistsPrimary(model.PCBoxFootCheckId))
     {
         //设置KEY值
         string invoiceKind   = this.GetInvoiceKind().ToLower();
         string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, DateTime.Now.Year);
         string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, DateTime.Now.Year, DateTime.Now.Month);
         string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, DateTime.Now.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.PCBoxFootCheckId = this.GetId(DateTime.Now);
         TiGuiExists(model);
         //throw new Helper.InvalidValueException(Model.Product.PRO_Id);
     }
 }
Exemple #14
0
        public override void Refresh()
        {
            if (this._pcBoxFootCheck == null)
            {
                this.AddNew();
            }
            else
            {
                if (this.action == "view")
                {
                    this._pcBoxFootCheck = this._pcBoxFootCheckManager.Get(this._pcBoxFootCheck.PCBoxFootCheckId);
                }
            }

            this.txt_Id.EditValue                   = this._pcBoxFootCheck.PCBoxFootCheckId;
            this.date_Check.EditValue               = this._pcBoxFootCheck.CheckDate;
            this.newChooseEmployee.EditValue        = this._pcBoxFootCheck.Employee;
            this.txt_Product.EditValue              = this._pcBoxFootCheck.Product == null ? null : this._pcBoxFootCheck.Product.ToString();
            this.txt_InvoiceXO.EditValue            = this._pcBoxFootCheck.InvoiceXO == null ? null : this._pcBoxFootCheck.InvoiceXO.CustomerInvoiceXOId;
            this.txt_PronoteHeader.EditValue        = this._pcBoxFootCheck.PronoteHeaderId;
            this.richTextNote.Rtf                   = this._pcBoxFootCheck.Note;
            this.spinEditGetNum.EditValue           = this._pcBoxFootCheck.GetNum;
            this.spinEditCheckNum.EditValue         = this._pcBoxFootCheck.CheckNum;
            this.spinEditPassNum.EditValue          = this._pcBoxFootCheck.PassNum;
            this.spinEditNoPassNum.EditValue        = this._pcBoxFootCheck.NoPassNum;
            this.newChooseContorlAuditEmp.EditValue = this._pcBoxFootCheck.AuditEmp;
            this.txt_AuditState.EditValue           = this.GetAuditName(this._pcBoxFootCheck.AuditState);
            this.txt_CheckStandard.EditValue        = this._pcBoxFootCheck.CheckStandard;
            this.newChooseContorlCustomer.EditValue = this._pcBoxFootCheck.Customer;
            this.newChooseContorlSupplier.EditValue = this._pcBoxFootCheck.Supplier;
            this.richTextBox1.Rtf                   = this._pcBoxFootCheck.Product == null ? null : this._pcBoxFootCheck.Product.ProductDescription;

            GetRadioGroup();
            base.Refresh();

            this.txt_Id.Enabled             = true;
            this.txt_Id.Properties.ReadOnly = true;
        }
Exemple #15
0
 protected override void MoveFirst()
 {
     this._pcBoxFootCheck = this._pcBoxFootCheckManager.GetFirst();
 }
Exemple #16
0
 public Model.PCBoxFootCheck GetPrev(Model.PCBoxFootCheck e)
 {
     return(sqlmapper.QueryForObject <Model.PCBoxFootCheck>("PCBoxFootCheck.get_prev", e));
 }
Exemple #17
0
 public Model.PCBoxFootCheck GetNext(Model.PCBoxFootCheck e)
 {
     return(sqlmapper.QueryForObject <Model.PCBoxFootCheck>("PCBoxFootCheck.get_next", e));
 }
Exemple #18
0
 public bool HasRowsAfter(Model.PCBoxFootCheck e)
 {
     return(sqlmapper.QueryForObject <bool>("PCBoxFootCheck.has_rows_after", e));
 }
Exemple #19
0
 public bool HasRowsBefore(Model.PCBoxFootCheck e)
 {
     return(sqlmapper.QueryForObject <bool>("PCBoxFootCheck.has_rows_before", e));
 }
Exemple #20
0
 public void Update(Model.PCBoxFootCheck e)
 {
     this.Update <Model.PCBoxFootCheck>(e);
 }
Exemple #21
0
 public bool HasRowsBefore(Model.PCBoxFootCheck e)
 {
     return(accessor.HasRowsBefore(e));
 }
Exemple #22
0
 public Model.PCBoxFootCheck GetNext(Model.PCBoxFootCheck e)
 {
     return(accessor.GetNext(e));
 }
Exemple #23
0
 public Model.PCBoxFootCheck GetPrev(Model.PCBoxFootCheck e)
 {
     return(accessor.GetPrev(e));
 }
Exemple #24
0
 public bool HasRowsAfter(Model.PCBoxFootCheck e)
 {
     return(accessor.HasRowsAfter(e));
 }
Exemple #25
0
 public void Insert(Model.PCBoxFootCheck e)
 {
     this.Insert <Model.PCBoxFootCheck>(e);
 }
Exemple #26
0
        public RO(Model.PCBoxFootCheck model)
            : this()
        {
            this.DataSource = model.Details.OrderBy(d => d.CheckDate).ToList();

            foreach (var detail in model.Details)
            {
                foreach (var item in detail.GetType().GetProperties())
                {
                    if (item.Name == "Flap" || item.Name == "Exterior" || item.Name == "OfColor" || item.Name == "HeightFootL" || item.Name == "HeightFootR" || item.Name == "FootElasticL" || item.Name == "FootElasticR" || item.Name == "ImpactTest" || item.Name == "AceticacidTest" || item.Name == "Houdu" || item.Name == "Guangxue" || item.Name == "Jihao")
                    {
                        if (item.GetValue(detail, null) != null)
                        {
                            switch (item.GetValue(detail, null).ToString())
                            {
                            case "0":
                                item.SetValue(detail, "√", null);
                                break;

                            case "1":
                                item.SetValue(detail, "X", null);
                                break;

                            case "2":
                                item.SetValue(detail, "△", null);
                                break;
                            }
                        }
                    }
                }
            }
            if (model != null)
            {
                this.lblCompanyName.Text = BL.Settings.CompanyChineseName;
                //this.lblReportName.Text = Properties.Resources.PCBoxFootCheck;
                this.lblReportName.Text = "品管线上检查表";
                //this.lblPrintDate.Text += DateTime.Now.ToString("yyyy-MM-dd");

                this.lblId.Text          = model.PCBoxFootCheckId;
                this.lblCheckDate.Text   = model.CheckDate == null ? null : model.CheckDate.Value.ToString("yyyy-MM-dd");
                this.lblProductName.Text = model.Product == null ? null : model.Product.ProductName;
                if (model.InvoiceXO != null)
                {
                    this.lblInvoiceXO.Text = model.InvoiceXO.CustomerInvoiceXOId;
                }
                else if (model.PronoteHeader != null)
                {
                    this.lblInvoiceXO.Text = model.PronoteHeader.InvoiceXO == null ? "" : model.PronoteHeader.InvoiceXO.CustomerInvoiceXOId;
                }
                this.lblPronoteHeader.Text = model.PronoteHeaderId;
                this.lblEmployee.Text      = model.Employee == null ? null : model.Employee.EmployeeName;
                this.xrRichTextNote.Rtf    = model.Note;
                this.lblGetNum.Text        = model.GetNum.ToString();
                this.lblCheckNum.Text      = model.CheckNum.ToString();
                this.lblPassNum.Text       = model.PassNum.ToString();
                this.lblProductUnit.Text   = model.ProductUnit;
                if (model.Product != null)
                {
                    if (string.IsNullOrEmpty(model.Product.CustomerProductName))
                    {
                        this.lbl_CustomerProductName.Text = CommonHelp.GetCustomerProductNameByPronoteHeaderId(model.PronoteHeaderId, model.ProductId);
                    }
                    else
                    {
                        this.lbl_CustomerProductName.Text = model.Product.CustomerProductName;
                    }
                }

                //this.DataSource = model;
                //this.TCFlap.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheck.PRO_Flap);
                //this.TCExterior.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheck.PRO_Exterior);
                this.TCCheckDate.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheckDetail.PRO_CheckDate, "{0:yyyy-MM-dd HH:mm:ss}");
                this.TCFlap.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheckDetail.PRO_Flap);
                this.TCExterior.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheckDetail.PRO_Exterior);
                this.TCOfColor.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheckDetail.PRO_OfColor);
                this.TCHeightFootL.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheckDetail.PRO_HeightFootL);
                //this.TCHeightFootR.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheckDetail.PRO_HeightFootR);
                this.TCFootElasticL.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheckDetail.PRO_FootElasticL);
                //this.TCFootElasticR.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheckDetail.PRO_FootElasticR);
                this.TCImpactTest.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheckDetail.PRO_ImpactTest);
                this.TCAceticacidTest.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheckDetail.PRO_AceticacidTest);

                this.xrTBusinessHours.DataBindings.Add("Text", this.DataSource, "BusinessHours." + Model.BusinessHours.PROPERTY_BUSINESSHOURSNAME);
                this.TCAbnormal.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheckDetail.PRO_Abnormal);

                this.TCHoudu.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheckDetail.PRO_Houdu);
                this.TCGuangxue.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheckDetail.PRO_Guangxue);
                this.TCJihao.DataBindings.Add("Text", this.DataSource, Model.PCBoxFootCheckDetail.PRO_Jihao);
            }
        }