Esempio n. 1
0
        public async Task <Models.SimpleInvoice.InvoiceLine> CreateInvoiceLine(Models.SimpleInvoice.InvoiceLine invoiceLine)
        {
            OnInvoiceLineCreated(invoiceLine);

            Context.InvoiceLines.Add(invoiceLine);
            Context.SaveChanges();

            OnAfterInvoiceLineCreated(invoiceLine);

            return(invoiceLine);
        }
Esempio n. 2
0
        protected async System.Threading.Tasks.Task Form0Submit(SimpleInvoiceManagementSoftware.Models.SimpleInvoice.InvoiceLine args)
        {
            try
            {
                var simpleInvoiceUpdateInvoiceLineResult = await SimpleInvoice.UpdateInvoiceLine(InvoiceLineId, invoiceline);

                DialogService.Close(invoiceline);
            }
            catch (System.Exception simpleInvoiceUpdateInvoiceLineException)
            {
                NotificationService.Notify(new NotificationMessage()
                {
                    Severity = NotificationSeverity.Error, Summary = $"Error", Detail = $"Unable to update InvoiceLine"
                });
            }
        }
Esempio n. 3
0
        protected async System.Threading.Tasks.Task Load()
        {
            var simpleInvoiceGetInvoicesResult = await SimpleInvoice.GetInvoices();

            getInvoicesForInvoiceIdResult = simpleInvoiceGetInvoicesResult;

            var simpleInvoiceGetProductsResult = await SimpleInvoice.GetProducts();

            getProductsForProductIdResult = simpleInvoiceGetProductsResult;

            invoiceline = new SimpleInvoiceManagementSoftware.Models.SimpleInvoice.InvoiceLine()
            {
            };

            await InitObject(invoiceline);
        }
Esempio n. 4
0
        public async Task <Models.SimpleInvoice.InvoiceLine> UpdateInvoiceLine(int?invoiceLineId, Models.SimpleInvoice.InvoiceLine invoiceLine)
        {
            OnInvoiceLineUpdated(invoiceLine);

            var itemToUpdate = Context.InvoiceLines
                               .Where(i => i.InvoiceLineId == invoiceLineId)
                               .FirstOrDefault();

            if (itemToUpdate == null)
            {
                throw new Exception("Item no longer available");
            }
            var entryToUpdate = Context.Entry(itemToUpdate);

            entryToUpdate.CurrentValues.SetValues(invoiceLine);
            entryToUpdate.State = EntityState.Modified;
            Context.SaveChanges();

            OnAfterInvoiceLineUpdated(invoiceLine);

            return(invoiceLine);
        }
Esempio n. 5
0
 partial void OnAfterInvoiceLineUpdated(Models.SimpleInvoice.InvoiceLine item);
Esempio n. 6
0
        public async Task <Models.SimpleInvoice.InvoiceLine> CancelInvoiceLineChanges(Models.SimpleInvoice.InvoiceLine item)
        {
            var entityToCancel = Context.Entry(item);

            entityToCancel.CurrentValues.SetValues(entityToCancel.OriginalValues);
            entityToCancel.State = EntityState.Unchanged;

            return(item);
        }
Esempio n. 7
0
 partial void OnInvoiceLineGet(Models.SimpleInvoice.InvoiceLine item);
Esempio n. 8
0
 partial void OnInvoiceLineDeleted(Models.SimpleInvoice.InvoiceLine item);
Esempio n. 9
0
 partial void OnInvoiceLineCreated(Models.SimpleInvoice.InvoiceLine item);
        protected async System.Threading.Tasks.Task Grid0RowSelect(SimpleInvoiceManagementSoftware.Models.SimpleInvoice.InvoiceLine args)
        {
            var dialogResult = await DialogService.OpenAsync <EditInvoiceLine>("Edit Invoice Line", new Dictionary <string, object>() { { "InvoiceLineId", args.InvoiceLineId } });

            await InvokeAsync(() => { StateHasChanged(); });
        }