/// <summary>
        /// Indexes this instance.
        /// </summary>
        /// <returns>leave adjustment view</returns>
        public ActionResult Index()
        {
            this.AddBreadcrumbItem(Resources.LeaveAdjustment, Url.LeaveAdjustmentAction());
            LeaveAdjustmentPresenter leavePresenter = new LeaveAdjustmentPresenter();

            if (!(SessionData.Instance.UserInfo != null && (SessionUserManager.IsUserHR() || SessionUserManager.IsUserDirector() || SessionData.Instance.UserInfo.Developer.UserType == UserType.Admin)))
            {
                return this.Redirect(Url.AccountAction());
            }

            leavePresenter.LeaveRoasterStartDate = DateTimeExtensions.RetrieveCurrentMonthStartDate(DateTimeHelper.RetrieveCurrentDate());
            DateTime toDate = DateTimeExtensions.RetrieveYesterdayDate(DateTimeHelper.RetrieveCurrentDate());

            leavePresenter.AssignLeaveRosterList(this.leaveService.RetrieveLeaveRosterList(null, SessionData.Instance.UserInfo.Developer.DeveloperID, leavePresenter.LeaveRoasterStartDate, toDate));
            return this.View(leavePresenter);
        }
        /// <summary>
        /// Loads the leave list.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <param name="searchText">The search text.</param>
        /// <param name="leaveDate">The leave date.</param>
        /// <returns>
        /// returns leave list
        /// </returns>
        public ActionResult LoadLeaveList([DataSourceRequest]DataSourceRequest request, string searchText, string leaveDate)
        {
            LeaveAdjustmentPresenter leavePresenter = new LeaveAdjustmentPresenter();

            leavePresenter.LeaveRoasterStartDate = DateTimeExtensions.RetrieveCurrentMonthStartDate(DateTimeHelper.RetrieveCurrentDate());
            DateTime toDate = DateTimeExtensions.RetrieveYesterdayDate(DateTimeHelper.RetrieveCurrentDate());

            string searchTextItem = null;
            if (!string.IsNullOrEmpty(searchText))
            {
                searchTextItem = searchText.Trim();
            }

            leavePresenter.AssignLeaveRosterList(this.leaveService.RetrieveLeaveRosterList(searchTextItem, SessionData.Instance.UserInfo.Developer.DeveloperID, leavePresenter.LeaveRoasterStartDate, toDate));

            DataSourceResult result = leavePresenter.LeaveRosterList.ToDataSourceResult(request);

            return this.Json(result, JsonRequestBehavior.AllowGet);
        }
 public ActionResult FilterList(LeaveAdjustmentPresenter presenter)
 {
     return this.PartialView("_LeaveAdjustmentList", presenter);
 }