예제 #1
0
        public async Task <Models.Sample.OrderDetail> CreateOrderDetail(Models.Sample.OrderDetail orderDetail)
        {
            OnOrderDetailCreated(orderDetail);

            context.OrderDetails.Add(orderDetail);
            context.SaveChanges();

            return(orderDetail);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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()
            {
            };
        }
예제 #5
0
        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);
        }
예제 #6
0
 partial void OnOrderDetailUpdated(Models.Sample.OrderDetail item);
예제 #7
0
 partial void OnOrderDetailGet(Models.Sample.OrderDetail item);
예제 #8
0
 partial void OnOrderDetailDeleted(Models.Sample.OrderDetail item);
예제 #9
0
        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(); });
        }