public async Task <JsonResult> Update(AttendanceStatusViewModel vm)
 {
     try {
         _attendanceService.Update1(AttendanceStatusUtility.VMToM(vm));
         return(Json(new { success = true, data = vm }));
     } catch { return(Json(new { success = false })); }
 }
 public async Task <JsonResult> GetAllByCompany()
 {
     try {
         var list = AttendanceStatusUtility.FilterByCompanyID(CurrentUser.CompanyID, _attendanceService.GetAll1().Result.ToList());
         return(Json(new { success = true, data = AttendanceStatusUtility.MsToVMs(list) }, JsonRequestBehavior.AllowGet));
     } catch { return(Json(new { success = false }, JsonRequestBehavior.AllowGet)); }
 }
 public async Task <JsonResult> Insert(AttendanceStatusViewModel vm)
 {
     try {
         vm.ID = CharacterGenerator.NewGUID();
         _attendanceService.Insert1(AttendanceStatusUtility.VMToM(vm));
         var list  = AttendanceStatusUtility.FilterByCompanyID(CurrentUser.CompanyID, _attendanceService.GetAll1().Result.ToList());
         var model = AttendanceStatusUtility.FilterByDescription(vm.Description, list).FirstOrDefault();
         return(Json(new { success = true, data = AttendanceStatusUtility.MToVM(model) }));
     } catch { return(Json(new { success = false })); }
 }