Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("RawMaterialsID,RawMaterialsName,DescriptionOfRawMaterials,ReceptionConditions,StorageConditions,CostKG")] RawMaterial rawMaterial)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rawMaterial);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(rawMaterial));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("TypeOfStoragesID,NameOfTypeOfStorages,TypesOfRawMaterialsInStorage,FireProtection,SpecialEquipment,Humidity")] TypeOfStorage typeOfStorage)
        {
            if (ModelState.IsValid)
            {
                _context.Add(typeOfStorage);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(typeOfStorage));
        }
        public async Task <IActionResult> Create([Bind("HumanResourcesDepartmentID,Initial,LengthOfService,AcceptRawMaterials")] HumanResourceDepartment humanResourceDepartment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(humanResourceDepartment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(humanResourceDepartment));
        }
        public async Task <IActionResult> Create([Bind("StoragesID,NameOfStorage,InventoryNumber,DesignatedEmployee,SquareOfStorage,Tonnage,FillingPercentage,TypeOfStoragesID")] Storage storage)
        {
            if (ModelState.IsValid)
            {
                _context.Add(storage);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TypeOfStoragesID"] = new SelectList(_context.TypeOfStorages, "TypeOfStoragesID", "TypeOfStoragesID", storage.TypeOfStoragesID);
            return(View(storage));
        }
        public async Task <IActionResult> Create([Bind("AcceptedRawMaterialsID,TypeOfRawMaterials,NumberKG,Employee,RoomOfStorage,DateAndTime,Cost,RawMaterialsID,HumanResourcesDepartmentID,StoragesID")] AcceptedRawMaterial acceptedRawMaterial)
        {
            if (ModelState.IsValid)
            {
                _context.Add(acceptedRawMaterial);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["HumanResourcesDepartmentID"] = new SelectList(_context.HumanResourcesDepartment, "HumanResourcesDepartmentID", "HumanResourcesDepartmentID", acceptedRawMaterial.HumanResourcesDepartmentID);
            ViewData["RawMaterialsID"]             = new SelectList(_context.RawMaterials, "RawMaterialsID", "RawMaterialsID", acceptedRawMaterial.RawMaterialsID);
            return(View(acceptedRawMaterial));
        }