Exemplo n.º 1
0
        public ActionResult LoadManageLeavePartial(bool ShowOnlyReportedToMe, bool ShowApprovedLeaves, string FromDate, string ToDate, string RequestMenuUser)
        {
            DateTime?startDateFormatted = null;
            DateTime?endDateFormatted   = null;

            if (FromDate != "" && ToDate != "")
            {
                try
                {
                    startDateFormatted = DateTime.Parse(FromDate, new CultureInfo("en-GB", true));
                    endDateFormatted   = DateTime.Parse(ToDate, new CultureInfo("en-GB", true));
                }
                catch (Exception)
                {
                    throw;
                }
            }
            ManageTeamLeavesQueryModel qryMdl = new ManageTeamLeavesQueryModel
            {
                OnlyReportedToMe   = ShowOnlyReportedToMe,
                ShowApprovedLeaves = ShowApprovedLeaves,
                FromDate           = startDateFormatted,
                ToDate             = endDateFormatted,
                RequestMenuUser    = RequestMenuUser
            };
            IList <TeamLeaves> LeaveRequests = null;

            qryMdl.LeadId = UserId;
            using (var client = new LeaveClient())
            {
                LeaveRequests = client.GetLeaveRequests(qryMdl);
            }
            return(PartialView("ManageLeaveDetailPartial", LeaveRequests));
        }