public virtual ActionResult Leave() { var leaves = _leaveRepository.Find(x => x.IsActive); ViewBag.SupportRefundable = _settingRepository.GetSettingValue(SettingValue.SUPPORT_REFUNDABLE_LEAVE, "false"); return(View(leaves)); }
public virtual ActionResult CreateEmployeeLeave() { var leaves = _leaveRepository.Find(x => x.IsActive) .Select(x => new SelectListItem { Value = x.LeaveId.ToString(), Text = x.LeaveName }); var hours = new List <SelectListItem> { new SelectListItem { Value = "8", Text = "Whole Day" }, new SelectListItem { Value = "4", Text = "Half Day" }, new SelectListItem { Value = "-1", Text = "Specify Hours" } }; var viewModel = new EmployeeLeaveCreateViewModel { StartDate = DateTime.Now.AddDays(1), EndDate = DateTime.Now.AddDays(1), Leaves = leaves, LeaveHours = hours }; return(View(viewModel)); }