Ejemplo n.º 1
0
        public ActionResult ListHolidayByYear(string year)
        {
            int holidayYear = Convert.ToInt32(year);
            IList <HolidayModel> holidayModelList;
            bool previousYear = false;
            bool nextYear     = false;

            using (var client = new LeaveClient())
            {
                holidayModelList = client.GetHolidaysDetails(UserId, holidayYear, ref previousYear, ref nextYear);
            }
            ViewBag.PreviousYear = previousYear ? "" : "disabled";
            ViewBag.NextYear     = nextYear ? "" : "disabled";
            if (holidayModelList.Count > 0)
            {
                ViewBag.HolidayOfficeName = holidayModelList[0].HolidayOfficeName;
                ViewBag.HolidayYear       = holidayModelList[0].HolidayDate.Year;
            }
            return(PartialView("~/Views/Dashboard/HolidayListPartial.cshtml", holidayModelList));
        }