public Invoice UpdateInvoice(InvoiceCreateForm form) { try { Invoice invoice = GetInvoice(form.IDInvoice); if (invoice != null) { invoice.FromObject(form); invoice.IDAccount = idAccount; base.SaveBubble(invoice); } return(invoice); } catch (Exception ex) { throw new Exception("UpdateInvoice " + ex.Message, ex); } }
// CreateInvoice (form) public Invoice CreateInvoice(InvoiceCreateForm form) { try { Invoice nouveau = new Invoice(); nouveau.FromObject(form); nouveau.InvoiceState = InvoiceStateEnum.PREPARE; nouveau.IDAccount = idAccount; // Insert this.InsertInvoice(nouveau); return(nouveau); } catch (Exception ex) { throw new Exception("create " + ex.Message, ex); } }