protected override void MoveLast() { if (LastFlag == 1) { LastFlag = 0; return; } this.invoice = this.invoiceManager.Get(this.invoiceManager.GetLast() == null ? "" : this.invoiceManager.GetLast().InvoiceId); }
public EditForm(Model.InvoiceCT invoice) : this() { if (invoice == null) { throw new ArithmeticException("invoiceid"); } this.invoice = this.invoiceManager.Get(invoice.InvoiceId); this.action = "update"; }
int LastFlag = 0; //页面载入时是否执行 last方法 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.InvoiceCT invoice = this.invoiceManager.GetPrev(this.invoice); if (invoice == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this.invoice = this.invoiceManager.Get(invoice.InvoiceId); }
public EditForm(string invoiceid, string action) : this() { this.invoice = this.invoiceManager.Get(invoiceid); if (this.invoice == null) { throw new ArithmeticException("invoiceid"); } this.action = action; if (this.action == "view") { this.LastFlag = 1; } }
private void Q18_1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { Model.InvoiceCT invoicect = new Book.Model.InvoiceCT(); invoicect.InvoiceId = this.Invoice.InvoiceId; System.Collections.Generic.IList <Model.InvoiceCTDetail> details = this.ctDetailManager.Select(invoicect); foreach (Model.InvoiceCTDetail detail in details) { detail.InvoiceCTDetailMoney0 *= -1; detail.InvoiceCTDetailQuantity *= -1; detail.InvoiceCTDetailTax *= -1; detail.InvoiceCTDetailMoney1 *= -1; detail.InvoiceCTDetailDisount *= -1; } this.bindingSource1.DataSource = details; }
protected override void TurnNull() { if (this.invoice == null) { return; } if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != 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.InvoiceCT(); this.invoice.InvoiceDate = DateTime.Now; this.invoice.PayDate = DateTime.Now; this.invoice.InvoiceId = this.invoiceManager.GetNewId(); this.invoice.Details = new List <Model.InvoiceCTDetail>(); this.invoice.InvoiceTax = 0; this.invoice.InvoiceZRE = 0; this.invoice.InvoiceZSE = 0; this.invoice.InvoiceZongJi = 0; this.invoice.InvoiceHeJi = 0; this.invoice.InvoiceFpje = 0; this.invoice.InvoiceOwed = 0; this.invoice.InvoiceYHE = 0; this.buttonEditEmployee.EditValue = BL.V.ActiveOperator.Employee; this.buttonEditEmployee1.EditValue = BL.V.ActiveOperator.Employee; this.invoice.InvoicePayTimeLimit = DateTime.Now.Date; Model.InvoiceCTDetail detail = new Model.InvoiceCTDetail(); detail.InvoiceCTDetailId = Guid.NewGuid().ToString(); detail.InvoiceCTDetailDisount = 0; detail.Inumber = this.invoice.Details.Count + 1; detail.InvoiceCTDetailDiscountRate = 0; detail.InvoiceCTDetailMoney0 = 0; detail.InvoiceCTDetailMoney1 = 0; detail.InvoiceCTDetailNote = ""; detail.InvoiceCTDetailPrice = 0; detail.InvoiceCTDetailQuantity = 0; detail.InvoiceCTDetailTax = 0; detail.InvoiceCTDetailTaxRate = 0; detail.InvoiceCTDetailZS = false; detail.InvoiceProductUnit = ""; detail.Product = new Book.Model.Product(); this.invoice.Details.Add(detail); this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(detail); }
public void Delete(Book.Model.InvoiceCT invoice) { sqlmapper.Delete("InvoiceCTDetail.delete_by_invoiceid", invoice.InvoiceId); }
public IList <Book.Model.InvoiceCTDetail> Select(Book.Model.InvoiceCT invoiceCT) { return(sqlmapper.QueryForList <Model.InvoiceCTDetail>("InvoiceCTDetail.select_by_invoiceid", invoiceCT.InvoiceId)); }
public void OwedDecrement(Book.Model.InvoiceCT invoice, decimal?money) { this.OwedDecrement(invoice.InvoiceId, money.Value); }
public void OwedIncrement(Book.Model.InvoiceCT invoice, decimal money) { this.OwedIncrement(invoice.InvoiceId, money); }
private void Q28_1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { Model.InvoiceCT invoicect = new Book.Model.InvoiceCT(); invoicect.InvoiceId = this.Invoice.InvoiceId; this.bindingSource1.DataSource = this.cgDetailManager.Select(invoicect); }
public override void Refresh() { if (this.invoice == null) { this.invoice = new Book.Model.InvoiceCT(); this.action = "insert"; } else { if (this.action == "view") { this.invoice = this.invoiceManager.Get(invoice.InvoiceId); } else { //this.bindingSourceDepotPosition.DataSource = this.depotPositionManager.Select(this.invoice.Depot); } } this.textEditInvoiceId.EditValue = this.invoice.InvoiceId; this.dateEditInvoiceDate.EditValue = this.invoice.InvoiceDate; this.buttonEditEmployee.EditValue = this.invoice.Employee0; this.textEditNote.EditValue = this.invoice.InvoiceAbstract; this.textEditNote.EditValue = this.invoice.InvoiceNote; this.buttonEditCompany.EditValue = this.invoice.Supplier; this.buttonEditDepot.EditValue = this.invoice.Depot; this.spinEditInvoiceTaxRate1.EditValue = this.invoice.InvoiceTaxRate == 0 || this.invoice.InvoiceTaxRate == null ? 5 : this.invoice.InvoiceTaxRate; this.calcEditInvoiceTax1.EditValue = this.invoice.InvoiceTax == 0 ? 0 : this.invoice.InvoiceTax; this.calcEditInvoiceTotal0.EditValue = this.invoice.InvoiceZongJi == 0 ? 0 : this.invoice.InvoiceZongJi;; this.calcEditInvoiceTotal1.EditValue = this.invoice.InvoiceHeJi == 0 ? 0 : this.invoice.InvoiceHeJi; this.calcEditInvoiceZSE.EditValue = this.invoice.InvoiceZSE == 0 ? 0 : this.invoice.InvoiceZSE; this.dateEditInvoicePayTimeLimit.DateTime = this.invoice.InvoicePayTimeLimit == null?DateTime.Now.AddDays(3).Date : this.invoice.InvoicePayTimeLimit.Value.Date; this.textEditInvoiceCphm.Text = this.invoice.InvoiceCpbh; this.comboBoxEditInvoiceKslb.Text = this.invoice.InvoiceKslb; this.comboBoxEditInvoiceKlfs.Text = this.invoice.InvoiceKlfs; this.comboBoxEditInvoiceFpls.Text = this.invoice.InvoiceKpls; this.spinEditInvoiceFpje.EditValue = this.invoice.InvoiceFpje; this.textEditInvoiceFpbh.Text = this.invoice.InvoiceFpbh; this.spinEditInvoiceOwed.EditValue = this.invoice.InvoiceOwed; this.spinEditInvoiceZKE.EditValue = this.invoice.InvoiceZRE; this.dateEditInvoicePayTimeLimit.EditValue = this.invoice.InvoicePayTimeLimit; this.buttonEditEmployee1.EditValue = this.invoice.Employee1; this.buttonEditEmployee2.EditValue = this.invoice.Employee2; this.EmpAudit.EditValue = this.invoice.AuditEmp; this.textEditAuditState.Text = this.invoice.AuditStateName; this.bindingSourceDetail.DataSource = this.invoice.Details; base.Refresh(); this.textEditInvoiceId.Properties.ReadOnly = true; //this.buttonEditEmployee.Enabled = false; //this.buttonEditEmployee1.Enabled = false; }
protected override void MoveFirst() { this.invoice = this.invoiceManager.Get(this.invoiceManager.GetFirst() == null ? "" : this.invoiceManager.GetFirst().InvoiceId); }