Exemple #1
0
        public async Task <Semester> CreateSemesterAsynd(Semester semester)
        {
            await _smContext.AddAsync(semester);

            await _smContext.SaveChangesAsync();

            return(semester);
        }
        public async Task <Student> CreateStudentAsynd(Student student)
        {
            await _smContext.AddAsync(student);

            await _smContext.SaveChangesAsync();

            return(student);
        }
Exemple #3
0
        public async Task <Discipline> CreateDisciplineAsynd(Discipline discipline)
        {
            await _smContext.AddAsync(discipline);

            await _smContext.SaveChangesAsync();

            return(discipline);
        }
        public async Task <IActionResult> Create([Bind("SeasonID,SeasonName")] Seasons seasons)
        {
            if (ModelState.IsValid)
            {
                _context.Add(seasons);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(seasons));
        }
Exemple #5
0
        public async Task <IActionResult> Create([Bind("ReturnID,ShopRef,WarehouseRef,Reference,TransactionDate,StockCode,QtyReturned,CreatedBy,CreatedDate")] shopReturns shopReturns)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shopReturns);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(shopReturns));
        }
Exemple #6
0
        public async Task <IActionResult> Create([Bind("ShopDeliveryID,ShopRef,WarehouseRef,DeliveryRef,StockCode,QtyHangers,DeliveryDate,Notes,CreatedBy,CreatedDate")] shopDeliveries shopDeliveries)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shopDeliveries);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(shopDeliveries));
        }
        public async Task <IActionResult> Create([Bind("ShopTransferID,Reference,TransferDate,FromShopRef,ToShopRef,StockCode,TotalQtyOut,CreatedBy,CreatedDate")] shopTransfers shopTransfers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shopTransfers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(shopTransfers));
        }
        public async Task <IActionResult> Create([Bind("DeliveryID,OurRef,SupplierRef,WarehouseRef,Season,TotalGarments,TotalHangers,TotalBoxes,NetAmount,DeliveryCharge,Commission,VATAmount,GrossAmount,DeliveryDate,Notes,Invoice,Shipper,ShipperInvoice,CreatedBy,CreatedDate")] Deliveries deliveries)
        {
            if (ModelState.IsValid)
            {
                _context.Add(deliveries);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(deliveries));
        }
Exemple #9
0
        public async Task <IActionResult> Create([Bind("CompanyID,CompanyName,Address1,Address2,Address3,Address4,PostCode,Telephone,VATReg,Email,Season,WWW,VatRate")] Settings settings)
        {
            if (ModelState.IsValid)
            {
                _context.Add(settings);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(settings));
        }
        public async Task <IActionResult> Create([Bind("ShopAdjustID,ShopRef,Reference,TotalLossItems,TotalGainItems,MovementDate,StockCode,MovementType,Qty,Values,CreatedBy,CreatedDate")] shopAdjustments shopAdjustments)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shopAdjustments);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(shopAdjustments));
        }
        public async Task <IActionResult> Create([Bind("WarehouseTransferID,Reference,TransferDate,FromWarehouseRef,ToWarehouseRef,StockCode,TotalGarmentsQtyOut,TotalBoxesQtyOut,TotalUnitsQtyOut,CreatedBy,CreatedDate")] WarehouseTransfers warehouseTransfers)
        {
            if (ModelState.IsValid)
            {
                warehouseTransfers.CreatedBy   = "Admin";
                warehouseTransfers.CreatedDate = DateTime.Now;
                _context.Add(warehouseTransfers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(warehouseTransfers));
        }
Exemple #12
0
        public async Task <IActionResult> Create([Bind("WarehouseRef,WarehouseName,Address1,Address2,Address3,Address4,PostCode,ContactName,Telephone,Telephone2,Fax,Email,Memo,WarehouseType,Default,CreatedBy,CreatedDate")] Warehouse warehouse)
        {
            if (ModelState.IsValid)
            {
                warehouse.CreatedBy   = "Admin";
                warehouse.CreatedDate = DateTime.Now;
                _context.Add(warehouse);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(warehouse));
        }
        public async Task <IActionResult> Create([Bind("ShopRef,Shopname,Address1,Address2,Address3,Address4,PostCode,ContactName,Telephone,Telephone2,Fax,Email,Memo,SHopType,CreatedBy,CreatedDate")] Shops shops)
        {
            if (ModelState.IsValid)
            {
                shops.CreatedBy   = "Admin";
                shops.CreatedDate = DateTime.Now;
                _context.Add(shops);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(shops));
        }
        public async Task <IActionResult> Create([Bind("WarehouseAdjustID,WarehouseRef,Reference,StockCode,MovementType,TotalItems,MovementDate,CreatedBy,CreatedDate")] WarehouseAdjustments warehouseAdjustments)
        {
            if (ModelState.IsValid)
            {
                warehouseAdjustments.CreatedBy   = "Admin";
                warehouseAdjustments.CreatedDate = DateTime.Now;
                _context.Add(warehouseAdjustments);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(warehouseAdjustments));
        }
Exemple #15
0
        public async Task <IActionResult> Create([Bind("StockCode,SupplierRef,Season,DeadCode,AmtTakes,DeliveredQtyHangers,CostVal,ZeroQty,CreatedBy,CreatedDate")] Stock stock)
        {
            if (ModelState.IsValid)
            {
                stock.CreatedBy   = "Admin";
                stock.CreatedDate = DateTime.Now;
                _context.Add(stock);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(stock));
        }
 public static void Initialize(SMContext sMContext)
 {
     if (!sMContext.Warehouse.Any())
     {
         var warehouses = new List <Warehouse>
         {
             new Warehouse
             {
                 WarehouseRef  = "UNI",
                 WarehouseName = "Universal Warehouse",
                 WarehouseType = Warehouse.WHType.Active,
                 CreatedBy     = "Bob",
                 CreatedDate   = DateTime.Now
             },
             new Warehouse
             {
                 WarehouseRef  = "WOFF",
                 WarehouseName = "Waste Warehouse",
                 WarehouseType = Warehouse.WHType.Waste
             },
             new Warehouse
             {
                 WarehouseRef  = "LONG",
                 WarehouseName = "Long-Term Warehouse",
                 WarehouseType = Warehouse.WHType.Long,
                 CreatedBy     = "Bob",
                 CreatedDate   = DateTime.Now
             }
         };
         sMContext.Warehouse.AddRange(warehouses);
         sMContext.SaveChangesAsync();
     }
     if (!sMContext.Supplier.Any())
     {
         var suppliers = new List <Suppliers>
         {
             new Suppliers
             {
                 SupplierRef  = "ABC",
                 SupplierName = "A B C Designs"
             },
             new Suppliers
             {
                 SupplierRef  = "MISC",
                 SupplierName = "Misc Designs"
             }
         };
     }
     if (!sMContext.Shop.Any())
     {
         var shops = new List <Shops>
         {
             new Shops
             {
                 ShopRef  = "BO",
                 Shopname = "Bognor",
                 SHopType = Shops.SHType.Shop
             },
             new Shops
             {
                 ShopRef  = "DU",
                 Shopname = "Dummy Shop",
                 SHopType = Shops.SHType.Shop
             },
             new Shops
             {
                 ShopRef  = "HW",
                 Shopname = "High Wycombe",
                 SHopType = Shops.SHType.Consessions
             }
         };
     }
 }