public ActionResult DesignationCreate() { ViewBag.designationList = _designationServices.GetDesignationList(); List <SelectListItem> GradeList = new List <SelectListItem>(); ViewBag.gradeList = GradeList; ViewBag.levelList = _levelService.GetLevellist(); return(View()); }
public ActionResult Level() { if (!ViewBag.AllowView) { ViewBag.Error = "You are not Authorize to use this Page"; return(PartialView("_partialviewNotFound")); } IEnumerable <LevelDTO> LevelList = _levelService.GetLevellist(); return(View(LevelList)); }
public void ListOfDatas(int empCode) { ViewBag.EmployeeDetail = _employeeService.GetEmployeeDetails(empCode); List <SelectListItem> OfficeList = new List <SelectListItem>(); foreach (var row in _officeService.GetOfficeAllData()) { OfficeList.Add(new SelectListItem { Text = row.OfficeName, Value = row.OfficeId.ToString() }); } List <SelectListItem> DepartmentList = new List <SelectListItem>(); foreach (var row in _departmentServices.GetDepartmentlist()) { DepartmentList.Add(new SelectListItem { Text = row.DeptName, Value = row.DeptId.ToString() }); } List <SelectListItem> SectionList = new List <SelectListItem>(); foreach (var row in _sectionServices.GetSectionList()) { SectionList.Add(new SelectListItem { Text = row.SectionName, Value = row.SectionId.ToString() }); } List <SelectListItem> DesignationList = new List <SelectListItem>(); foreach (var row in _designationServices.GetDesignationList()) { DesignationList.Add(new SelectListItem { Text = row.DsgName, Value = row.DsgId.ToString() }); } List <SelectListItem> RankList = new List <SelectListItem>(); foreach (var row in _rankServices.GetRankList()) { RankList.Add(new SelectListItem { Text = row.RankName.ToString(), Value = row.RankId.ToString() }); } List <SelectListItem> LevelList = new List <SelectListItem>(); foreach (var row in _levelServices.GetLevellist()) { LevelList.Add(new SelectListItem { Text = row.LevelName, Value = row.LevelId.ToString() }); } List <SelectListItem> BusinessGroupList = new List <SelectListItem>(); foreach (var row in _bgGroupService.GetBusinessGroupList()) { BusinessGroupList.Add(new SelectListItem { Text = row.BgName, Value = row.BgId.ToString() }); } List <SelectListItem> ShiftList = new List <SelectListItem>(); foreach (var row in _shiftService.GetShiftsLIst()) { ShiftList.Add(new SelectListItem { Text = row.ShiftName, Value = row.ShiftId.ToString() }); } List <SelectListItem> RemoteList = new List <SelectListItem>(); foreach (var row in _remoteService.GetRemoteList()) { RemoteList.Add(new SelectListItem { Text = row.RemoteAreaName, Value = row.RemoteId.ToString() }); } List <SelectListItem> JobTypeList = new List <SelectListItem>(); foreach (var row in _jobTypeservices.GetJobTypeList()) { JobTypeList.Add(new SelectListItem { Text = row.JobTypeName, Value = row.JobtypeId.ToString() }); } List <SelectListItem> ServiceEventList = new List <SelectListItem>(); foreach (var row in _serviceEventService.GetServiceEventList()) { ServiceEventList.Add(new SelectListItem { Text = row.ServiceEventGroupName, Value = row.ServiceEventId.ToString() }); } List <SelectListItem> EmployeesList = new List <SelectListItem>(); foreach (var row in _employeeService.GetEmployeeList(2)) { EmployeesList.Add(new SelectListItem { Text = row.EmpName, Value = row.EmpCode.ToString() }); } ViewBag.officeList = OfficeList; ViewBag.departmentList = DepartmentList; ViewBag.sectionList = SectionList; ViewBag.designationList = DesignationList; ViewBag.rankList = RankList; ViewBag.levelList = LevelList; ViewBag.businessGroupList = BusinessGroupList; ViewBag.shiftList = ShiftList; ViewBag.remoteList = RemoteList; ViewBag.jobTypeList = JobTypeList; ViewBag.serviceEventList = ServiceEventList; ViewBag.employeeList = EmployeesList; }
public ActionResult Index(int?page, string EmpName, int?SearchEmpCode, int?OfficeId, int?DeptId, int?DesgId, int?GroupId, int?BgId, int?LevelId, int?RankId, int?ShiftId, int?SectionId, int?JobTypeId) { if (!ViewBag.AllowView) { ViewBag.Error = "You are not Authorize to use this Page"; return(PartialView("_partialviewNotFound")); } if (ViewBag.AllowView == true) { ViewBag.dllOfficeTypeList = _officeTypeServices.GetClildOfficeListByEmpCode(Convert.ToInt32(ViewBag.EmpCode)); ViewBag.dllDepartmentList = _departmentServices.GetDepartmentlist(); ViewBag.dllDesginationList = _designationServices.GetDesignationList().ToList(); ViewBag.ddlGroupList = _groupServices.GetGroupList(); ViewBag.ddlBgGroupList = _bgGroupService.GetBusinessGroupByEmpRoleId(Convert.ToInt32(ViewBag.EmpRoleId)); ViewBag.dllLevelList = _levelServices.GetLevellist(); ViewBag.dllRankList = _rankServices.GetRankList(); ViewBag.dllShiftList = _shiftService.GetShiftsLIst(); ViewBag.dllSectionList = _sectionServices.GetSectionList(); ViewBag.dllJobTypeList = _jobTypeservices.GetJobTypeList(); int roleId = Convert.ToInt32(ViewBag.EmpRoleId); // // int curentemp = Convert.ToInt32(Session["Empcode"]); //Logged in user employee code // var emplist = _employeeService.GetEmployeeList(curentemp); EmployeeSearchViewModel searchModel = new EmployeeSearchViewModel(); ViewBag.SearchEmpCode = SearchEmpCode; ViewBag.EmpName = EmpName; ViewBag.BgId = BgId; ViewBag.OfficeId = OfficeId; ViewBag.DesgId = DesgId; ViewBag.GroupId = GroupId; ViewBag.LevelId = LevelId; ViewBag.RankId = RankId; ViewBag.ShiftId = ShiftId; ViewBag.SectionId = SectionId; ViewBag.JobTypeId = JobTypeId; var emplist = _employeeService. SearchEmployees(SearchEmpCode, EmpName, OfficeId, DeptId, DesgId, GroupId, BgId, roleId); if (LevelId > 0) { emplist = emplist.Where(a => a.EmpLevelId == searchModel.LevelId).ToList(); } if (RankId > 0) { emplist = emplist.Where(a => a.EmpRankId == searchModel.RankId).ToList(); } if (ShiftId > 0) { emplist = emplist.Where(a => a.EmpShiftId == searchModel.ShiftId).ToList(); } if (SectionId > 0) { emplist = emplist.Where(a => a.EmpSectionId == searchModel.SectionId).ToList(); } if (JobTypeId > 0) { emplist = emplist.Where(a => a.EmpJobTypeId == searchModel.JobTypeId).ToList(); } int pageSizes = 20; int pageNumber = (page ?? 1); return(View(emplist.ToPagedList(pageNumber, pageSizes))); } else { ViewBag.errorMsg = "Not Authorize"; return(View()); } }