public async Task <Models.Sample.OrderDetail> CreateOrderDetail(Models.Sample.OrderDetail orderDetail) { OnOrderDetailCreated(orderDetail); context.OrderDetails.Add(orderDetail); context.SaveChanges(); return(orderDetail); }
public async Task <Models.Sample.OrderDetail> CancelOrderDetailChanges(Models.Sample.OrderDetail item) { var entity = context.Entry(item); entity.CurrentValues.SetValues(entity.OriginalValues); entity.State = EntityState.Unchanged; return(item); }
protected async System.Threading.Tasks.Task Form0Submit(BlazorCustomPaging.Models.Sample.OrderDetail args) { try { var sampleUpdateOrderDetailResult = await Sample.UpdateOrderDetail(Id, orderdetail); DialogService.Close(orderdetail); } catch (Exception sampleUpdateOrderDetailException) { NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to update OrderDetail"); } }
protected async System.Threading.Tasks.Task Load() { var sampleGetOrdersResult = await Sample.GetOrders(); getOrdersResult = sampleGetOrdersResult; var sampleGetProductsResult = await Sample.GetProducts(); getProductsResult = sampleGetProductsResult; orderdetail = new BlazorCustomPaging.Models.Sample.OrderDetail() { }; }
public async Task <Models.Sample.OrderDetail> UpdateOrderDetail(int?id, Models.Sample.OrderDetail orderDetail) { OnOrderDetailUpdated(orderDetail); var item = context.OrderDetails .Where(i => i.Id == id) .FirstOrDefault(); if (item == null) { throw new Exception("Item no longer available"); } var entry = context.Entry(item); entry.CurrentValues.SetValues(orderDetail); entry.State = EntityState.Modified; context.SaveChanges(); return(orderDetail); }
partial void OnOrderDetailUpdated(Models.Sample.OrderDetail item);
partial void OnOrderDetailGet(Models.Sample.OrderDetail item);
partial void OnOrderDetailDeleted(Models.Sample.OrderDetail item);
protected async System.Threading.Tasks.Task Grid0RowSelect(BlazorCustomPaging.Models.Sample.OrderDetail args) { var dialogResult = await DialogService.OpenAsync <EditOrderDetail>("Edit Order Detail", new Dictionary <string, object>() { { "Id", args.Id } }); await InvokeAsync(() => { StateHasChanged(); }); }