public bool HasRowsBefore(Model.InvoicePO e) { return(sqlmapper.QueryForObject <bool>("InvoicePO.has_rows_before", e)); }
public void Update(Model.InvoicePO e) { this.Update <Model.InvoicePO>(e); }
public override void Refresh() { if (this.invoice == null) { this.invoice = new Book.Model.InvoicePO(); 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.textEditAbstract.EditValue = this.invoice.InvoiceAbstract; this.textEditNote.EditValue = this.invoice.InvoiceNote; //this.buttonEditDepot.EditValue = this.invoice.Depot; this.buttonEditEmployee.EditValue = this.invoice.Employee0; this.buttonEditDepartment.EditValue = this.invoice.Department; this.bindingSource1.DataSource = this.invoice.Details; this.EmpAudit.EditValue = this.invoice.AuditEmp; this.textEditAuditState.Text = this.invoice.AuditStateName; this.gridControl1.RefreshDataSource(); 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.ButtonReadOnly = false; this.buttonEditDepot.Properties.ReadOnly = false; this.buttonEditDepartment.ButtonReadOnly = false; this.buttonEditEmployee.ShowButton = true; this.buttonEditDepartment.ShowButton = true; this.simpleButtonAppend.Enabled = true; this.simpleButtonRemove.Enabled = true; this.gridView1.OptionsBehavior.Editable = true; break; case "update": this.textEditInvoiceId.Properties.ReadOnly = true; this.dateEditInvoiceDate.Properties.ReadOnly = true; this.dateEditInvoiceDate.Properties.Buttons[0].Visible = false; this.textEditNote.Properties.ReadOnly = false; this.buttonEditEmployee.ButtonReadOnly = false; this.buttonEditDepot.Properties.ReadOnly = false; this.buttonEditDepartment.ButtonReadOnly = false; this.buttonEditEmployee.ShowButton = true; this.buttonEditDepartment.ShowButton = true; this.simpleButtonAppend.Enabled = true; this.simpleButtonRemove.Enabled = true; this.gridView1.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.ButtonReadOnly = true; this.buttonEditDepot.Properties.ReadOnly = true; this.buttonEditDepartment.ButtonReadOnly = true; this.buttonEditEmployee.ShowButton = false; this.buttonEditDepartment.ShowButton = false; this.simpleButtonAppend.Enabled = false; this.simpleButtonRemove.Enabled = false; this.gridView1.OptionsBehavior.Editable = false; break; default: break; } base.Refresh(); }
public void Insert(Model.InvoicePO e) { this.Insert <Model.InvoicePO>(e); }
protected override void MoveLast() { this.invoice = this.invoiceManager.Get(this.invoiceManager.GetLast() == null ? "" : this.invoiceManager.GetLast().InvoiceId); }