Пример #1
0
        public IActionResult CreateView()
        {
            //ViewBag.itemsTime = DateTime.Now.ToShortDateString();
            vmManualAttendance manualAttendance = new vmManualAttendance();

            return(PartialView("MAttendanceCreate", manualAttendance));
        }
Пример #2
0
 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));
 }
Пример #3
0
        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));
        }