protected async System.Threading.Tasks.Task Load() { var simpleInvoiceGetCompaniesResult = await SimpleInvoice.GetCompanies(); getCompaniesForCompanyIdResult = simpleInvoiceGetCompaniesResult; var simpleInvoiceGetCustomersResult = await SimpleInvoice.GetCustomers(); getCustomersForCustomerIdResult = simpleInvoiceGetCustomersResult; var simpleInvoiceGetTaxesResult = await SimpleInvoice.GetTaxes(); getTaxesForTaxIdResult = simpleInvoiceGetTaxesResult; invoice = new SimpleInvoiceManagementSoftware.Models.SimpleInvoice.Invoice() { }; var simpleInvoiceGetInvoiceLinesResult = await SimpleInvoice.GetInvoiceLines(); getInvoiceLinesResult = simpleInvoiceGetInvoiceLinesResult; CompanyAddress = ""; CompanyCity = ""; CustomerAddress = ""; CustomerCity = ""; await DataInitialization(); }
public async Task <Models.SimpleInvoice.Invoice> CancelInvoiceChanges(Models.SimpleInvoice.Invoice item) { var entityToCancel = Context.Entry(item); entityToCancel.CurrentValues.SetValues(entityToCancel.OriginalValues); entityToCancel.State = EntityState.Unchanged; return(item); }
public async Task <Models.SimpleInvoice.Invoice> CreateInvoice(Models.SimpleInvoice.Invoice invoice) { OnInvoiceCreated(invoice); Context.Invoices.Add(invoice); Context.SaveChanges(); OnAfterInvoiceCreated(invoice); return(invoice); }
protected async System.Threading.Tasks.Task Form0Submit(SimpleInvoiceManagementSoftware.Models.SimpleInvoice.Invoice args) { try { var simpleInvoiceUpdateInvoiceResult = await SimpleInvoice.UpdateInvoice(InvoiceId, invoice); UriHelper.NavigateTo("invoices"); } catch (System.Exception simpleInvoiceUpdateInvoiceException) { NotificationService.Notify(new NotificationMessage() { Severity = NotificationSeverity.Error, Summary = $"Error", Detail = $"Unable to update Invoice" }); } }
protected async System.Threading.Tasks.Task Form0Submit(SimpleInvoiceManagementSoftware.Models.SimpleInvoice.Invoice args) { try { var simpleInvoiceCreateInvoiceResult = await SimpleInvoice.CreateInvoice(invoice); await ResetDraftInvoiceNumber(invoice); await RedirectToEdit(invoice); } catch (System.Exception simpleInvoiceCreateInvoiceException) { NotificationService.Notify(new NotificationMessage() { Severity = NotificationSeverity.Error, Summary = $"Error", Detail = $"Unable to create new Invoice!" }); } }
public async Task <Models.SimpleInvoice.Invoice> UpdateInvoice(int?invoiceId, Models.SimpleInvoice.Invoice invoice) { OnInvoiceUpdated(invoice); var itemToUpdate = Context.Invoices .Where(i => i.InvoiceId == invoiceId) .FirstOrDefault(); if (itemToUpdate == null) { throw new Exception("Item no longer available"); } var entryToUpdate = Context.Entry(itemToUpdate); entryToUpdate.CurrentValues.SetValues(invoice); entryToUpdate.State = EntityState.Modified; Context.SaveChanges(); OnAfterInvoiceUpdated(invoice); return(invoice); }
partial void OnAfterInvoiceUpdated(Models.SimpleInvoice.Invoice item);
partial void OnInvoiceGet(Models.SimpleInvoice.Invoice item);
partial void OnInvoiceDeleted(Models.SimpleInvoice.Invoice item);
partial void OnInvoiceCreated(Models.SimpleInvoice.Invoice item);
protected async System.Threading.Tasks.Task Grid0RowSelect(SimpleInvoiceManagementSoftware.Models.SimpleInvoice.Invoice args) { UriHelper.NavigateTo($"edit-invoice/{args.InvoiceId}"); }