public IActionResult CreateView() { //ViewBag.itemsTime = DateTime.Now.ToShortDateString(); vmManualAttendance manualAttendance = new vmManualAttendance(); return(PartialView("MAttendanceCreate", manualAttendance)); }
public IActionResult Edit(vmManualAttendance modelData) { if (ModelState.IsValid) { ManualAttendance head = db.ManualAttendance.GetFirstOrDefault(c => c.Id == modelData.Id); head.EmployeeId = modelData.EmployeeId; head.InTime = modelData.InTime; head.OutTime = modelData.OutTime; head.Remarks = modelData.Remarks; head.ApproverId = modelData.ApproverId; db.ManualAttendance.Update(head); db.Save(); if (head.Id > 0) { return(Json(true)); } } return(Json(false)); }
public IActionResult Create(vmManualAttendance manualAttendance) { if (ModelState.IsValid) { ManualAttendance attendance = new ManualAttendance() { EmployeeId = manualAttendance.EmployeeId, InTime = manualAttendance.InTime, OutTime = manualAttendance.OutTime, Remarks = manualAttendance.Remarks, ApproverId = manualAttendance.ApproverId }; db.ManualAttendance.Add(attendance); db.Save(); ModelState.Clear(); if (attendance.Id > 0) { return(Json(true)); } } return(Json(false)); }