/// <summary> /// Insert a InvoiceCF. /// </summary> public void Insert(Model.InvoiceCF invoiceCF) { // // todo:add other logic here // accessor.Insert(invoiceCF); }
/// <summary> /// Update a InvoiceCF. /// </summary> public void Update(Model.InvoiceCF invoiceCF) { // // todo: add other logic here. // accessor.Update(invoiceCF); }
public EditForm(Model.InvoiceCF initCF) : this() { if (initCF == null) { throw new ArithmeticException("invoiceid"); } this.invoice = initCF; this.action = "update"; }
public EditForm(string invoiceId) : this() { this.invoice = this.invoiceManager.Get(invoiceId); if (this.invoice == null) { throw new ArithmeticException("invoiceid"); } this.action = "update"; }
protected override void MovePrev() { Model.InvoiceCF invoice = this.invoiceManager.GetPrev(this.invoice); if (invoice == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this.invoice = this.invoiceManager.Get(invoice.InvoiceId); }
protected override void TurnNull() { if (this.invoice == null) { return; } if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK) { return; } this.invoiceManager.TurnNull(this.invoice.InvoiceId); this.invoice = this.invoiceManager.GetNext(this.invoice); if (this.invoice == null) { this.invoice = this.invoiceManager.GetLast(); } }
protected override void AddNew() { this.invoice = new Model.InvoiceCF(); this.invoice.InvoiceId = this.invoiceManager.GetNewId(); this.invoice.InvoiceDate = DateTime.Now; this.invoice.DetailsIn = new List <Model.InvoiceCFDetail>(); this.invoice.DetailsOut = new List <Model.InvoiceCFDetail>(); if (this.action == "insert") { Model.InvoiceCFDetail detailOut = new Model.InvoiceCFDetail(); detailOut.InvoiceCFDetailId = Guid.NewGuid().ToString(); detailOut.InvoiceCFDetailKind = "O"; detailOut.InvoiceCFDetailNote = ""; detailOut.InvoiceCFDetailPrice = 0; detailOut.InvoiceCFDetailQuantity = 0; detailOut.InvoiceCFDetailZongji = 0; detailOut.InvoiceProductUnit = ""; detailOut.Product = new Book.Model.Product(); this.invoice.DetailsOut.Add(detailOut); this.bindingSourceOut.Position = this.bindingSourceOut.IndexOf(detailOut); Model.InvoiceCFDetail detailIn = new Model.InvoiceCFDetail(); detailIn.InvoiceCFDetailId = Guid.NewGuid().ToString(); detailIn.InvoiceCFDetailKind = "I"; detailIn.InvoiceCFDetailNote = ""; detailIn.InvoiceCFDetailPrice = 0; detailIn.InvoiceCFDetailQuantity = 0; detailIn.InvoiceCFDetailZongji = 0; detailIn.InvoiceProductUnit = ""; detailIn.Product = new Book.Model.Product(); this.invoice.DetailsIn.Add(detailIn); this.bindingSourceIn.Position = this.bindingSourceIn.IndexOf(detailIn); } }
public Model.InvoiceCF GetPrev(Model.InvoiceCF e) { return(accessor.GetPrev(e)); }
public override void Refresh() { if (this.invoice == null) { this.invoice = new Book.Model.InvoiceCF(); this.action = "insert"; } else { if (this.action == "view") { this.invoice = this.invoiceManager.Get(invoice.InvoiceId); } } this.textEditInvoiceId.EditValue = this.invoice.InvoiceId; this.dateEditInvoiceDate.DateTime = this.invoice.InvoiceDate.Value; //this.buttonEditEmployee.EditValue = this.invoice.Employee0; //this.textEditAbstract.EditValue = this.invoice.InvoiceAbstract; this.textEditNote.EditValue = this.invoice.InvoiceNote; this.EmpAudit.EditValue = this.invoice.AuditEmp; this.textEditAuditState.Text = this.invoice.AuditStateName; //this.buttonEditDepot1.EditValue = this.invoice.Depot2; //this.buttonEditDepot0.EditValue = this.invoice.Depot1; this.bindingSourceIn.DataSource = this.invoice.DetailsIn; this.bindingSourceOut.DataSource = this.invoice.DetailsOut; switch (this.action) { case "insert": this.textEditInvoiceId.Properties.ReadOnly = false; this.dateEditInvoiceDate.Properties.ReadOnly = false; this.dateEditInvoiceDate.Properties.Buttons[0].Visible = true; this.textEditNote.Properties.ReadOnly = false; this.buttonEditEmployee.ShowButton = true; this.buttonEditDepot0.ShowButton = true; this.buttonEditDepot1.ShowButton = true; this.buttonEditEmployee.ButtonReadOnly = false; this.buttonEditDepot0.ButtonReadOnly = false; this.buttonEditDepot1.ButtonReadOnly = false; this.simpleButtonAppendIn.Enabled = true; this.simpleButtonRemoveIn.Enabled = true; this.simpleButtonAppendOut.Enabled = true; this.simpleButtonRemoveOut.Enabled = true; this.gridViewIn.OptionsBehavior.Editable = true; this.gridViewOut.OptionsBehavior.Editable = true; break; case "update": this.textEditInvoiceId.Properties.ReadOnly = true; this.dateEditInvoiceDate.Properties.ReadOnly = true; this.dateEditInvoiceDate.Properties.Buttons[0].Visible = false; //this.textEditAbstract.Properties.ReadOnly = false; this.textEditNote.Properties.ReadOnly = false; this.buttonEditEmployee.ShowButton = true; this.buttonEditDepot0.ShowButton = true; this.buttonEditDepot1.ShowButton = true; this.buttonEditEmployee.ButtonReadOnly = false; this.buttonEditDepot0.ButtonReadOnly = false; this.buttonEditDepot1.ButtonReadOnly = false; this.simpleButtonAppendIn.Enabled = false; this.simpleButtonRemoveIn.Enabled = true; this.simpleButtonAppendOut.Enabled = true; this.simpleButtonRemoveOut.Enabled = true; this.gridViewIn.OptionsBehavior.Editable = true; this.gridViewOut.OptionsBehavior.Editable = true; break; case "view": this.textEditInvoiceId.Properties.ReadOnly = true; this.dateEditInvoiceDate.Properties.ReadOnly = true; this.dateEditInvoiceDate.Properties.Buttons[0].Visible = false; this.textEditNote.Properties.ReadOnly = true; this.buttonEditEmployee.ShowButton = false; this.buttonEditDepot0.ShowButton = false; this.buttonEditDepot1.ShowButton = false; this.buttonEditEmployee.ButtonReadOnly = true; this.buttonEditDepot0.ButtonReadOnly = true; this.buttonEditDepot1.ButtonReadOnly = true; this.simpleButtonAppendIn.Enabled = false; this.simpleButtonRemoveIn.Enabled = false; this.simpleButtonAppendOut.Enabled = false; this.simpleButtonRemoveOut.Enabled = false; this.gridViewIn.OptionsBehavior.Editable = false; this.gridViewOut.OptionsBehavior.Editable = false; break; default: break; } base.Refresh(); }
protected override void MoveLast() { this.invoice = this.invoiceManager.Get(this.invoiceManager.GetLast() == null ? "" : this.invoiceManager.GetLast().InvoiceId); }
public void Update(Model.InvoiceCF e) { this.Update <Model.InvoiceCF>(e); }
public bool HasRowsAfter(Model.InvoiceCF e) { return(accessor.HasRowsAfter(e)); }
public bool HasRowsBefore(Model.InvoiceCF e) { return(sqlmapper.QueryForObject <bool>("InvoiceCF.has_rows_before", e)); }
public bool HasRowsBefore(Model.InvoiceCF e) { return(accessor.HasRowsBefore(e)); }
public IList <Model.InvoiceCFDetail> Select(string kind, Model.InvoiceCF invoice) { return(accessor.Select(kind, invoice)); }
public Model.InvoiceCF GetPrev(Model.InvoiceCF e) { return(sqlmapper.QueryForObject <Model.InvoiceCF>("InvoiceCF.get_prev", e)); }
public Model.InvoiceCF GetNext(Model.InvoiceCF e) { return(sqlmapper.QueryForObject <Model.InvoiceCF>("InvoiceCF.get_next", e)); }
public bool HasRowsAfter(Model.InvoiceCF e) { return(sqlmapper.QueryForObject <bool>("InvoiceCF.has_rows_after", e)); }
public Model.InvoiceCF GetNext(Model.InvoiceCF e) { return(accessor.GetNext(e)); }
public void Insert(Model.InvoiceCF e) { this.Insert <Model.InvoiceCF>(e); }