Пример #1
0
 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)); }
 }
Пример #2
0
        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));
        }
Пример #3
0
        public IActionResult GetAll()
        {
            var rs = _iHolidayService.GetAll();

            return(Ok(rs));
        }