public async Task <IActionResult> AddLeavePolicy(string level) { ViewBag.gradeGroupsList = await _context.GradeGroups.ToListAsync(); ViewBag.jobGradesList = await _context.JobGrades.ToListAsync(); ViewBag.leaveTypesList = _lookup.GetLookupItems <LeaveType>(); ViewBag.level = level; return(PartialView("_AddLeavePolicy")); }
public async Task <IActionResult> EditEmployeeAttendance(long id) { var model = await _context.EmployeeAttendances.SingleOrDefaultAsync(b => b.Id == id); ViewBag.attendanceActionTypesList = _lookup.GetLookupItems <AttendanceActionType>(); return(PartialView("_EditEmployeeAttendance", model)); }
public IActionResult AddOrgUnit(long?parentId, bool isSub = false) { ViewBag.orgUnitTypeId = null; if (isSub) { ViewBag.orgUnitTypeId = _lookup.GetLookupItems <OrgUnitType>().SingleOrDefault(b => b.SysCode == "SUB").Id; } else { if (parentId.HasValue) { int sortOrder = _context.OrgUnits.Include(b => b.OrgUnitType).SingleOrDefault(b => b.Id == parentId).OrgUnitType.SortOrder; ViewBag.orgUnitTypesList = _lookup.GetLookupItems <OrgUnitType>().Where(b => b.SysCode != "SUB" && b.SortOrder > sortOrder); } else { ViewBag.orgUnitTypeId = _lookup.GetLookupItems <OrgUnitType>().SingleOrDefault(b => b.SysCode == "COMPANY").Id; } } return(PartialView("_AddOrgUnit")); }
public async Task <IActionResult> AddPayrollAddition(string level) { ViewBag.payrollComponentTypesList = _lookup.GetLookupItems <PayrollComponentType>(); switch (level) { case "INDIVIDUAL": ViewBag.employeesList = await _context.Employees.Where(b => b.IsActive).ToListAsync(); return(PartialView("_AddPayrollEmployeeAddition")); case "GRADE_GROUP": ViewBag.gradeGroupsList = await _context.GradeGroups.Where(b => b.IsActive).ToListAsync(); return(PartialView("_AddPayrollGroupAddition")); case "JOB_GRADE": ViewBag.jobGradesList = await _context.JobGrades.Where(b => b.IsActive).ToListAsync(); return(PartialView("_AddPayrollGradeAddition")); default: return(PartialView("_AddPayrollCompanyAddition")); } }
public async Task <IActionResult> AddCompany(OrgUnit item, string ShortName, string OthShortName, string LegalTypeCode, long?CalendarId) { int orgUnitTypeId = _lookup.GetLookupItems <OrgUnitType>().SingleOrDefault(b => b.SysCode == "COMPANY").Id; int cnt = await _context.OrgUnits.Where(b => b.OrgUnitTypeId == orgUnitTypeId).CountAsync() + 1; if (cnt > 9) { item.Code = cnt.ToString(); } else { item.Code = "0" + cnt.ToString(); } item.OrgUnitTypeId = orgUnitTypeId; item.SortOrder = 1; item.IsVacant = true; item.IsActive = true; item.CreatedDate = DateTime.Now.Date; item.LastUpdated = DateTime.Now.Date; item.UpdatedBy = "user"; await _context.OrgUnits.AddAsync(item); //add company entity Company comp = new Company(); comp.Id = item.Id; comp.LegalTypeCode = LegalTypeCode; comp.ShortName = ShortName; comp.OthShortName = OthShortName; comp.CalendarId = CalendarId; await _context.Companies.AddAsync(comp); await _context.SaveChangesAsync(); return(RedirectToAction("CompaniesList")); }
public async Task <IActionResult> Index() { ViewBag.orgUnitTypesList = _lookup.GetLookupItems <OrgUnitType>(); ViewBag.orgUnitsList = await _context.OrgUnits.Include(b => b.OrgUnitType) .Where(b => b.IsActive).OrderBy(b => b.OrgUnitType.SortOrder).ThenBy(b => b.SortOrder).ToListAsync(); ViewBag.nationalitiesList = await _context.Nationalities.Where(b => b.IsActive).ToListAsync(); ViewBag.governoratesList = await _context.Governorates.Where(b => b.IsActive).ToListAsync(); ViewBag.standardTitlesList = _lookup.GetLookupItems <StandardTitleType>(); ViewBag.gradeGroupsList = await _context.GradeGroups.Where(b => b.IsActive).ToListAsync(); ViewBag.jobGradesList = await _context.JobGrades.Where(b => b.IsActive).ToListAsync(); var emp = _context.Employments.Where(b => b.IsActive); ViewBag.headsCnt = await emp.Where(b => b.IsHead).CountAsync(); ViewBag.inProcessCnt = await _context.EmployeePromotions.Where(b => !b.IsApproved && b.IsActive).CountAsync(); ViewBag.actingCnt = await emp.Where(b => b.IsActing).CountAsync(); ViewBag.inProbationCnt = await emp.Where(b => b.IsProbation).CountAsync(); ViewBag.birthdayCnt = await _context.Employees.Where(b => b.BirthDate.DayOfYear == DateTime.Today.Date.DayOfYear).CountAsync(); ViewBag.archiveCnt = await _context.Employees.Where(b => !b.IsActive).CountAsync(); return(View()); }
public IActionResult AddLeaveRequest() { ViewBag.leaveTypesList = _lookup.GetLookupItems <LeaveType>(); return(View("AddLeaveRequest")); }
public IActionResult Index(string list = "Vacancies") { ViewBag.list = list; ViewBag.orgUnitTypesList = _lookup.GetLookupItems <OrgUnitType>(); return(View()); }
public IActionResult Index() { ViewBag.orgUnitTypesList = _lookup.GetLookupItems <OrgUnitType>(); return(View()); }