public ActionResult Create([Bind(Include = "EmployeeId,FirstName,LastName,CardNumber,Wage,EmailAddress,PhoneNumber,AspIdentity,Disabled")] Employee employee) { if (ModelState.IsValid) { db.Employees.Add(employee); db.Save(); return(RedirectToAction("Index")); } return(View(employee)); }
public ActionResult Create([Bind(Include = "Id,TimeStampIn,TimeStampOut,IsHolidayPay,EmployeeId")] Shift shift) { if (ModelState.IsValid) { db.Shifts.Add(shift); db.Save(); return(RedirectToAction("Index")); } ViewBag.EmployeeId = new SelectList(db.Employees.GetAll(), "EmployeeId", "FullName", shift.EmployeeId); return(View(shift)); }
private void ClockOut(IncompleteShift i) { db.Shifts.Add(new Shift(i.EmployeeId, i.TimeStampIn, DateTime.Now, i.IsHolidayPay)); db.IncompleteShifts.Remove(i); db.Save(); }