protected override void AddNew() { this._PCOPC = new Book.Model.PCOpticsCheck(); this._PCOPC.PCOpticsCheckId = this._PCOCManager.GetId(); this._PCOPC.PCOpticsCheckDate = DateTime.Now.Date; this._PCOPC.PCOpticsCheckQuantity = 1; //默认检测数量为1 }
public void Insert(Model.PCOpticsCheck pCOpticsCheck) { Validate(pCOpticsCheck); try { BL.V.BeginTransaction(); pCOpticsCheck.InsertTime = DateTime.Now; pCOpticsCheck.UpdateTime = DateTime.Now; TiGuiExists(pCOpticsCheck); string invoiceKind = this.GetInvoiceKind().ToLower(); string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, pCOpticsCheck.InsertTime.Value.Year); string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, pCOpticsCheck.InsertTime.Value.Year, pCOpticsCheck.InsertTime.Value.Month); string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, pCOpticsCheck.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(pCOpticsCheck); BL.V.CommitTransaction(); } catch { BL.V.RollbackTransaction(); throw; } }
protected override void MoveLast() { if (this.LastFlag == 1) { this.LastFlag = 0; return; } this._PCOPC = this._PCOCManager.Get(this._PCOCManager.GetLast() == null ? "" : this._PCOCManager.GetLast().PCOpticsCheckId); }
protected override void AddNew() { this._PCOPC = new Book.Model.PCOpticsCheck(); this._PCOPC.PCOpticsCheckId = this._PCOCManager.GetId(); this._PCOPC.PCOpticsCheckDate = DateTime.Now.Date; this._PCOPC.PCOpticsCheckQuantity = 1; //默认检测数量为1 this._PCOPC.Employee = BL.V.ActiveOperator.Employee; this._PCOPC.EmployeeId = BL.V.ActiveOperator.EmployeeId; }
protected override void MovePrev() { Model.PCOpticsCheck pcopc = this._PCOCManager.GetPrev(this._PCOPC); if (pcopc == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this._PCOPC = this._PCOCManager.Get(pcopc.PCOpticsCheckId); }
public void Update(Model.PCOpticsCheck pCOpticsCheck) { if (pCOpticsCheck != null) { Validate(pCOpticsCheck); pCOpticsCheck.UpdateTime = DateTime.Now; accessor.Update(pCOpticsCheck); } }
public EditForm(Model.PCOpticsCheck mPCOC, string action) : this() { this._PCOPC = mPCOC; this.action = action; if (this.action == "view") { LastFlag = 1; } }
private void barBtn_Search_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ListForm f = new ListForm(); if (f.ShowDialog(this) == DialogResult.OK) { this._PCOPC = f.SelectItem as Model.PCOpticsCheck; this.action = "view"; this.Refresh(); } f.Dispose(); GC.Collect(); }
public EditForm(string invoiceId) : this() { this._PCOPC = this._PCOCManager.Get(invoiceId); if (this._PCOPC == null) { throw new ArithmeticException("invoiceid"); } this.action = "view"; if (this.action == "view") { LastFlag = 1; } }
public EditForm(Model.PCOpticsCheck mPCOC) : this() { if (mPCOC == null) { throw new ArithmeticException("invoiceid"); } this._PCOPC = mPCOC; this.action = "view"; if (this.action == "view") { LastFlag = 1; } }
protected override void Delete() { if (this._PCOPC == null) { return; } if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) { return; } this._PCOCManager.Delete(this._PCOPC.PCOpticsCheckId); this._PCOPC = this._PCOCManager.GetNext(this._PCOPC); if (this._PCOPC == null) { this._PCOPC = this._PCOCManager.GetLast(); } }
private void TiGuiExists(Model.PCOpticsCheck model) { if (this.ExistsPrimary(model.PCOpticsCheckId)) { //设置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.PCOpticsCheckId = this.GetId(model.InsertTime.Value); TiGuiExists(model); } }
private void Validate(Model.PCOpticsCheck mPCOptics) { if (string.IsNullOrEmpty(mPCOptics.PCOpticsCheckId)) { throw new Helper.RequireValueException(Model.PCOpticsCheck.PRO_PCOpticsCheckId); } if (string.IsNullOrEmpty(mPCOptics.ProductId)) { throw new Helper.RequireValueException(Model.PCOpticsCheck.PRO_ProductId); } if (string.IsNullOrEmpty(mPCOptics.PCOpticsCheckDate.ToString())) { throw new Helper.RequireValueException(Model.PCOpticsCheck.PRO_PCOpticsCheckDate); } if (string.IsNullOrEmpty(mPCOptics.EmployeeId)) { throw new Helper.RequireValueException(Model.PCOpticsCheck.PRO_EmployeeId); } }
public override void Refresh() { if (this._PCOPC == null) { this.AddNew(); this.action = "insert"; } else { if (this.action == "view") { this._PCOPC = this._PCOCManager.Get(this._PCOPC.PCOpticsCheckId); } } this.txtPCOpticsCheckId.Text = this._PCOPC.PCOpticsCheckId; this.txtInvoiceCusXOId.Text = this._PCOPC.InvoiceCusXOId; this.txtPCOpticsCheckDesc.Text = this._PCOPC.PCOpticsCheckDesc; this.DE_JYDRQ.EditValue = this._PCOPC.PCOpticsCheckDate; this.txtProduct.Text = this._PCOPC.Product == null ? "" : this._PCOPC.Product.ToString(); this.CE_PCOpticsCheckQuantity.EditValue = this._PCOPC.PCOpticsCheckQuantity.HasValue ? this._PCOPC.PCOpticsCheckQuantity.Value : 0; this.CE_InvoiceXOQuantity.EditValue = this._PCOPC.InvoiceXOQuantity.HasValue ? this._PCOPC.InvoiceXOQuantity.Value : 0; this.txtPronoteHeaderId.Text = this._PCOPC.PronoteHeaderId; this.nccEmployee0.EditValue = this._PCOPC.Employee; this.chkZiWaiXian.Checked = this._PCOPC.IsZiWaiXian.HasValue ? this._PCOPC.IsZiWaiXian.Value : false; this.chkKeJianGuang.Checked = this._PCOPC.IsKeJianGuang.HasValue ? this._PCOPC.IsKeJianGuang.Value : false; this.newChooseContorlAuditEmp.EditValue = this._PCOPC.AuditEmp; this.txt_AuditState.EditValue = this.GetAuditName(this._PCOPC.AuditState); this.lookUpEditUnit.EditValue = this._PCOPC.ProductUnitId; base.Refresh(); this.CE_InvoiceXOQuantity.Enabled = false; this.txtPCOpticsCheckId.Properties.ReadOnly = true; }
public void Update(Model.PCOpticsCheck e) { this.Update <Model.PCOpticsCheck>(e); }
public bool HasRowsBefore(Model.PCOpticsCheck e) { return(accessor.HasRowsBefore(e)); }
public bool HasRowsBefore(Model.PCOpticsCheck e) { return(sqlmapper.QueryForObject <bool>("PCOpticsCheck.has_rows_before", e)); }
public bool HasRowsAfter(Model.PCOpticsCheck e) { return(accessor.HasRowsAfter(e)); }
public Model.PCOpticsCheck GetPrev(Model.PCOpticsCheck e) { return(accessor.GetPrev(e)); }
public Model.PCOpticsCheck GetNext(Model.PCOpticsCheck e) { return(accessor.GetNext(e)); }
public RO(Model.PCOpticsCheck _pcopc) { InitializeComponent(); if (_pcopc == null) { return; } //CompanyInfo this.lblCompanyName.Text = BL.Settings.CompanyChineseName; this.lblDataName.Text = Properties.Resources.PCOpticsCheck; //this.lblPrintDate.Text += DateTime.Now.ToShortDateString(); //Details Controls this.lblPCOpticsCheckId.Text = _pcopc.PCOpticsCheckId; this.lblPCOpticsCheckDate.Text = _pcopc.PCOpticsCheckDate.HasValue ? _pcopc.PCOpticsCheckDate.Value.ToString("yyyy-MM-dd") : ""; this.lblPronoteHeardId.Text = _pcopc.PronoteHeaderId; this.lblProductName.Text = _pcopc.Product == null ? "" : _pcopc.Product.ToString(); this.lblInvoiceCusXOId.Text = _pcopc.InvoiceCusXOId; this.lblInvoiceXOQuantity.Text = _pcopc.InvoiceXOQuantity.HasValue ? _pcopc.InvoiceXOQuantity.Value.ToString() : "0"; this.lblPCOpticsCheckQuantity.Text = _pcopc.PCOpticsCheckQuantity.HasValue ? _pcopc.PCOpticsCheckQuantity.Value.ToString() : "0"; this.chkZiWaiXian.Checked = _pcopc.IsZiWaiXian.HasValue ? _pcopc.IsZiWaiXian.Value : false; this.chkKeJianGuang.Checked = _pcopc.IsKeJianGuang.HasValue ? _pcopc.IsKeJianGuang.Value : false; this.lblPCOpticsCheckDesc.Text = _pcopc.PCOpticsCheckDesc; this.lblEmployee.Text = _pcopc.Employee.ToString(); this.lbl_ProductUnit.Text = _pcopc.ProductUnit == null ? "" : _pcopc.ProductUnit.ToString(); //this.lblPCOpticsCheckId.Text = _pcfc.PCFinishCheckID; //this.lblPCOpticsCheckDate.Text = _pcfc.PCFinishCheckDate.HasValue ? _pcfc.PCFinishCheckDate.Value.ToShortDateString() : ""; //this.lblProductName.Text = _pcfc.Product == null ? "" : _pcfc.Product.ToString(); //this.lblBuMen.Text = _pcfc.WorkHouse == null ? "" : _pcfc.WorkHouse.ToString(); //this.lblInvoiceCusXOId.Text = _pcfc.InvoiceCusXOId; //this.lblPCFinishCheckCount.Text = _pcfc.PCFinishCheckCount.ToString(); //this.lblPCFinishCheckInCoiunt.Text = _pcfc.PCFinishCheckInCoiunt.HasValue ? _pcfc.PCFinishCheckInCoiunt.Value.ToString() : ""; //this.lblPCFinishCheckDesc.Text = _pcfc.PCFinishCheckDesc; //this.lblEmployee0.Text = _pcfc.Employee0 == null ? "" : _pcfc.Employee0.ToString(); //this.lblEmployee1.Text = _pcfc.Employee1 == null ? "" : _pcfc.Employee1.ToString(); //this.lblCustomerProductName.Text = _pcfc.Product.CustomerProductName; //this.lblPronoteHeardId.Text = _pcfc.PronoteHeaderID; //this.lblCustomerProductName.Text = _pcfc.CustomerProductName; //details //this.lblDZDWQDW.Text = Trans(_pcfc.AttrDZDWQDW); //this.lblJWYHWRL.Text = Trans(_pcfc.AttrJWYHWRL); //this.lblGZBKYRL.Text = Trans(_pcfc.AttrGZBKYRL); //this.lblZZWBXGJ.Text = Trans(_pcfc.AttrZZWBXGJ); //this.lblJPBKGCS.Text = Trans(_pcfc.AttrJPBKGS); //this.lblJPJJHZQ.Text = Trans(_pcfc.AttrJPJHZQ); //this.lblJPJSX.Text = Trans(_pcfc.AttrJPSX); //this.lblJJSFTSYH.Text = Trans(_pcfc.AttrJJSFTSYH); //this.lblGX.Text = Trans(_pcfc.AttrGX); //this.lblTSL.Text = Trans(_pcfc.AttrTSL); //this.lblCJBZ.Text = Trans(_pcfc.AttrCJBZ); //this.lblWXTB.Text = Trans(_pcfc.AttrWXTB); //this.lblZMCM.Text = Trans(_pcfc.AttrZMCM); //this.lblSLDKSFMF.Text = Trans(_pcfc.AttrSLDSFMF); //this.lblNHDQSFZQ.Text = Trans(_pcfc.AttrNHDQSFZQ); //this.lblNHTB.Text = Trans(_pcfc.AttrNHTB); //this.lblJSSFZQ.Text = Trans(_pcfc.AttrJSSFZQ); //this.lblJDZRFS.Text = Trans(_pcfc.AttrJDZRFS); //this.lblPKZRFS.Text = Trans(_pcfc.AttrPKZRFS); //this.lblSLDNHWXTMTBSFZQ.Text = Trans(_pcfc.AttrSLDNHWXTMSFZQ); }
public Model.PCOpticsCheck GetNext(Model.PCOpticsCheck e) { return(sqlmapper.QueryForObject <Model.PCOpticsCheck>("PCOpticsCheck.get_next", e)); }
public bool HasRowsAfter(Model.PCOpticsCheck e) { return(sqlmapper.QueryForObject <bool>("PCOpticsCheck.has_rows_after", e)); }
public Model.PCOpticsCheck GetPrev(Model.PCOpticsCheck e) { return(sqlmapper.QueryForObject <Model.PCOpticsCheck>("PCOpticsCheck.get_prev", e)); }
protected override void MoveFirst() { this._PCOPC = this._PCOCManager.Get(this._PCOCManager.GetFirst() == null ? "" : this._PCOCManager.GetFirst().PCOpticsCheckId); }
public void Insert(Model.PCOpticsCheck e) { this.Insert <Model.PCOpticsCheck>(e); }