public ActionResult StaffingUnitCreate(DB.Material doc) { doc.Id = Guid.NewGuid(); db.Materials.Add(doc); db.SaveChanges(); return(RedirectToAction("StaffingUnitList")); }
public ActionResult MaterialCreate(DB.Material doc) { doc.MaterialType_Id = 1; //ViewBag.Employees = db.Employees.ToDictionary(x => x.Id, x => $@"{x.LastName} {x.FirstName} {x.SecondName}"); //ViewBag.Departments = db.Departments.ToDictionary(x => x.Id, x => x.Name); doc.Id = Guid.NewGuid(); db.Materials.Add(doc); db.SaveChanges(); return(RedirectToAction("MaterialList")); }