public async Task <IActionResult> Edit(int id, [Bind("AcceptedRawMaterialsID,TypeOfRawMaterials,NumberKG,Employee,RoomOfStorage,DateAndTime,Cost,RawMaterialsID,HumanResourcesDepartmentID,StoragesID")] AcceptedRawMaterial acceptedRawMaterial)
        {
            if (id != acceptedRawMaterial.AcceptedRawMaterialsID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(acceptedRawMaterial);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AcceptedRawMaterialExists(acceptedRawMaterial.AcceptedRawMaterialsID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }
        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));
        }