public ActionResult Create([Bind(Include = "RegID,RegName,RegDesc")] Region region) { if (ModelState.IsValid) { db.Regions.Add(region); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(region)); }
public ActionResult Create([Bind(Include = "EmpID,FirstName,LastName,Email,Pin,FingerPrint,CellNumber,Region,ID_No,EmpType,EmpImage,Present")] Employee employee) { if (ModelState.IsValid) { db.Employees.Add(employee); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmpType = new SelectList(db.EmpTypes, "Em_TypeID", "Name", employee.EmpType); return(View(employee)); }
public ActionResult Create([Bind(Include = "EmpTimeID,EmpDate,EmpClockIn,EmpClockOut,EmpID,Present")] EmployeeTime employeeTime) { if (ModelState.IsValid) { db.EmployeeTimes.Add(employeeTime); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmpID = new SelectList(db.Employees, "EmpID", "FirstName", employeeTime.EmpID); return(View(employeeTime)); }