protected override void MoveLast() { if (this.ProceduresPrice == null) { this.ProceduresPrice = this.ProceduresPriceManager.GetLast(); } }
/// <summary> /// Update a ProceduresPrice. /// </summary> public void Update(Model.ProceduresPrice proceduresPrice) { // // todo: add other logic here. // Validate(proceduresPrice); proceduresPrice.UpdateTime = DateTime.Now; accessor.Update(proceduresPrice); }
protected override void MoveNext() { Model.ProceduresPrice ProceduresPrice = this.ProceduresPriceManager.GetNext(this.ProceduresPrice); if (ProceduresPrice == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this.ProceduresPrice = ProceduresPrice; }
/// <summary> /// Insert a ProceduresPrice. /// </summary> public void Insert(Model.ProceduresPrice proceduresPrice) { // // todo:add other logic here // Validate(proceduresPrice); proceduresPrice.InsertTime = DateTime.Now; proceduresPrice.ProceduresPriceId = Guid.NewGuid().ToString(); accessor.Insert(proceduresPrice); }
private void Validate(Model.ProceduresPrice proceduresPrice) { if (string.IsNullOrEmpty(proceduresPrice.SupplierId)) { throw new Helper.RequireValueException(Model.ProceduresPrice.PRO_SupplierId); } if (string.IsNullOrEmpty(proceduresPrice.BomId)) { throw new Helper.RequireValueException(Model.ProceduresPrice.PRO_BomId); } if (string.IsNullOrEmpty(proceduresPrice.ProceduresId)) { throw new Helper.RequireValueException(Model.ProceduresPrice.PRO_ProceduresId); } }
protected override void Delete() { if (this.ProceduresPrice == null) { return; } if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) { return; } this.ProceduresPriceManager.Delete(this.ProceduresPrice.ProceduresPriceId); this.ProceduresPrice = this.ProceduresPriceManager.GetNext(this.ProceduresPrice); if (this.ProceduresPrice == null) { this.ProceduresPrice = this.ProceduresPriceManager.GetLast(); } }
public ProceduresPriceEditForm(Model.ProceduresPrice ProceduresPrice, string action) : this() { this.ProceduresPrice = ProceduresPrice; this.action = action; }
public ProceduresPriceEditForm(Model.ProceduresPrice ProceduresPrice) : this() { this.ProceduresPrice = ProceduresPrice; this.action = "update"; }
public override void Refresh() { if (this.ProceduresPrice == null) { this.ProceduresPrice = new Book.Model.ProceduresPrice(); this.action = "insert"; } this.newChooseContorlSupplierId.EditValue = this.ProceduresPrice.Supplier; //this.newChooseContorlPriceUnit.EditValue= if (this.ProceduresPrice.Bom != null) { this.buttonEditBom.EditValue = this.ProceduresPrice.Bom; if (this.ProceduresPrice.Bom.Product != null) { this.textEditBom.Text = this.ProceduresPrice.Bom.Product.ProductName; this.textEditBomCode.Text = this.ProceduresPrice.Bom.Product.Id; this.textEdit4.Text = this.ProceduresPrice.Bom.Product.ProductSpecification; } } if (this.ProceduresPrice.Procedures != null) { this.buttonEditProcedure.Text = this.ProceduresPrice.Procedures.Id; this.richTextBox1.Rtf = this.ProceduresPrice.Procedures.Procedurename; } this.comboBoxEditUnit.EditValue = this.ProceduresPrice.ProductUnit; this.comboBoxEditPriceUnit.EditValue = this.ProceduresPrice.PriceUnit; this.spinEditConversionRate.EditValue = this.ProceduresPrice.ConversionRate; this.spinEditChargePrice.EditValue = this.ProceduresPrice.ChargePrice; this.spinEditTaxRate.EditValue = this.ProceduresPrice.TaxRate; this.comboBoxEditPriceTag.SelectedIndex = this.ProceduresPrice.PriceTag == null ? -1 : this.ProceduresPrice.PriceTag.Value; this.comboBoxEditObsolescenceDoMode.SelectedIndex = this.ProceduresPrice.ObsolescenceDoMode == null?-1:this.ProceduresPrice.ObsolescenceDoMode.Value; this.comboBoxEditWasteDoMode.SelectedIndex = this.ProceduresPrice.WasteDoMode == null?-1:this.ProceduresPrice.WasteDoMode.Value; this.comboBoxEditNotReasonLossDoMode.SelectedIndex = this.ProceduresPrice.NotReasonLossDoMode == null?-1:this.ProceduresPrice.NotReasonLossDoMode.Value; this.spinEditObsolescencePrice.EditValue = this.ProceduresPrice.ObsolescencePrice; this.spinEditWastePrice.EditValue = this.ProceduresPrice.WastePrice; this.spinEditNotReasonLossPrice.EditValue = this.ProceduresPrice.NotReasonLossPrice; if (global::Helper.DateTimeParse.DateTimeEquls(this.ProceduresPrice.StartDate, global::Helper.DateTimeParse.NullDate)) { this.dateEditStartDate.EditValue = null; } else { this.dateEditStartDate.EditValue = this.ProceduresPrice.StartDate; } if (global::Helper.DateTimeParse.DateTimeEquls(this.ProceduresPrice.EndDate, global::Helper.DateTimeParse.NullDate)) { this.dateEditEndDate.EditValue = null; } else { this.dateEditEndDate.EditValue = this.ProceduresPrice.EndDate; } this.memoEditDescription.Text = this.ProceduresPrice.Description; switch (this.action) { case "insert": break; case "update": break; case "view": break; default: break; } base.Refresh(); }
protected override void MoveFirst() { this.ProceduresPrice = this.ProceduresPriceManager.GetFirst(); }
protected override void AddNew() { this.ProceduresPrice = new Model.ProceduresPrice(); }
public Model.ProceduresPrice GetNext(Model.ProceduresPrice e) { return(accessor.GetNext(e)); }
public Model.ProceduresPrice GetPrev(Model.ProceduresPrice e) { return(accessor.GetPrev(e)); }
public bool HasRowsAfter(Model.ProceduresPrice e) { return(accessor.HasRowsAfter(e)); }
public bool HasRowsBefore(Model.ProceduresPrice e) { return(accessor.HasRowsBefore(e)); }