コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("SeasonID,SeasonName")] Seasons seasons)
        {
            if (id != seasons.SeasonID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(seasons);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SeasonsExists(seasons.SeasonID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(seasons));
        }
コード例 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("ReturnID,ShopRef,WarehouseRef,Reference,TransactionDate,StockCode,QtyReturned,CreatedBy,CreatedDate")] shopReturns shopReturns)
        {
            if (id != shopReturns.ReturnID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shopReturns);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!shopReturnsExists(shopReturns.ReturnID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(shopReturns));
        }
コード例 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("WarehouseTransferID,Reference,TransferDate,FromWarehouseRef,ToWarehouseRef,StockCode,TotalGarmentsQtyOut,TotalBoxesQtyOut,TotalUnitsQtyOut")] WarehouseTransfers warehouseTransfers)
        {
            if (id != warehouseTransfers.WarehouseTransferID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(warehouseTransfers);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WarehouseTransfersExists(warehouseTransfers.WarehouseTransferID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(warehouseTransfers));
        }
コード例 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("ShopTransferID,Reference,TransferDate,FromShopRef,ToShopRef,StockCode,TotalQtyOut,CreatedBy,CreatedDate")] shopTransfers shopTransfers)
        {
            if (id != shopTransfers.ShopTransferID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shopTransfers);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!shopTransfersExists(shopTransfers.ShopTransferID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(shopTransfers));
        }
コード例 #5
0
        public async Task <IActionResult> Edit(int id, [Bind("ShopDeliveryID,ShopRef,WarehouseRef,DeliveryRef,StockCode,QtyHangers,DeliveryDate,Notes,CreatedBy,CreatedDate")] shopDeliveries shopDeliveries)
        {
            if (id != shopDeliveries.ShopDeliveryID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shopDeliveries);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!shopDeliveriesExists(shopDeliveries.ShopDeliveryID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(shopDeliveries));
        }
コード例 #6
0
        public async Task <IActionResult> Edit(int id, [Bind("DeliveryID,OurRef,SupplierRef,WarehouseRef,Season,TotalGarments,TotalHangers,TotalBoxes,NetAmount,DeliveryCharge,Commission,VATAmount,GrossAmount,DeliveryDate,Notes,Invoice,Shipper,ShipperInvoice,CreatedBy,CreatedDate")] Deliveries deliveries)
        {
            if (id != deliveries.DeliveryID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(deliveries);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DeliveriesExists(deliveries.DeliveryID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(deliveries));
        }
コード例 #7
0
        public async Task <IActionResult> Edit(string id, [Bind("WarehouseRef,WarehouseName,Address1,Address2,Address3,Address4,PostCode,ContactName,Telephone,Telephone2,Fax,Email,Memo,WarehouseType,Default")] Warehouse warehouse)
        {
            if (id != warehouse.WarehouseRef)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(warehouse);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WarehouseExists(warehouse.WarehouseRef))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(warehouse));
        }
コード例 #8
0
        public async Task <IActionResult> Edit(int id, [Bind("CompanyID,CompanyName,Address1,Address2,Address3,Address4,PostCode,Telephone,VATReg,Email,Season,WWW,VatRate")] Settings settings)
        {
            if (id != settings.CompanyID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(settings);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SettingsExists(settings.CompanyID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(settings));
        }
コード例 #9
0
        public async Task <IActionResult> Edit(string id, [Bind("ShopRef,Shopname,Address1,Address2,Address3,Address4,PostCode,ContactName,Telephone,Telephone2,Fax,Email,Memo,SHopType")] Shops shops)
        {
            if (id != shops.ShopRef)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shops);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShopsExists(shops.ShopRef))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(shops));
        }
        public async Task <IActionResult> Edit(int id, [Bind("WarehouseAdjustID,WarehouseRef,Reference,StockCode,MovementType,TotalItems,MovementDate")] WarehouseAdjustments warehouseAdjustments)
        {
            if (id != warehouseAdjustments.WarehouseAdjustID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(warehouseAdjustments);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WarehouseAdjustmentsExists(warehouseAdjustments.WarehouseAdjustID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(warehouseAdjustments));
        }
コード例 #11
0
        public async Task <IActionResult> Edit(int id, [Bind("ShopAdjustID,ShopRef,Reference,TotalLossItems,TotalGainItems,MovementDate,StockCode,MovementType,Qty,Values,CreatedBy,CreatedDate")] shopAdjustments shopAdjustments)
        {
            if (id != shopAdjustments.ShopAdjustID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shopAdjustments);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!shopAdjustmentsExists(shopAdjustments.ShopAdjustID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(shopAdjustments));
        }
コード例 #12
0
        public async Task <IActionResult> Edit(string id, [Bind("StockCode,SupplierRef,Season,DeadCode,AmtTakes,DeliveredQtyHangers,CostVal,ZeroQty")] Stock stock)
        {
            if (id != stock.StockCode)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(stock);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StockExists(stock.StockCode))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(stock));
        }
コード例 #13
0
 public void Update(T t)
 {
     _context.Update(t);
     _context.SaveChanges();
 }