public async Task <JsonResult> GetAllByCompany() { try { var list = _holidayService.GetAll(); list = HolidayUtility.FilterByCompanyID(CurrentUser.CompanyID, list); list = HolidayUtility.OrderByStartDate(list, false); return(Json(new { success = true, data = HolidayUtility.MsToVMs(list) }, JsonRequestBehavior.AllowGet)); } catch { return(Json(new { success = false }, JsonRequestBehavior.AllowGet)); } }
public ActionResult Index() { IndexModel model = new IndexModel(); var Msg = TempData["Saved"] as string; if (Msg != null && Msg == "true") { model.HasSavedMessage = true; } else { model.HasSavedMessage = false; } Msg = TempData["Changed"] as string; if (Msg != null && Msg == "true") { model.HasChangedMessage = true; } else { model.HasChangedMessage = false; } Msg = TempData["Delete"] as string; if (Msg != null && Msg == "true") { model.HasDeleteMessage = true; } else { model.HasDeleteMessage = false; } model.Holidays = _holService.GetAll().ToPagedList(model.Page, model.PageSize); return(View(model)); }
public IActionResult GetAll() { var rs = _iHolidayService.GetAll(); return(Ok(rs)); }