public StaffHomeController(IEmpRepository empRepository, IWebHostEnvironment webHostEnvironment, LeaveRepository leaveRepository, TaskRepo taskRepository) { _taskRepository = taskRepository; _leaveRepository = leaveRepository; _empRepository = empRepository; _webHostEnvironment = webHostEnvironment; }
public HrUnitOfWork(IContextFactory <DbContext> contextFactory) // , int companyId, string culture : base(contextFactory) { // Initialize CompanyRepository = new CompanyRepository(Context); // , companyId, culture PagesRepository = new PagesRepository(Context); MenuRepository = new MenuRepository(Context); PageEditorRepository = new PageEditorRepository(Context); LookUpRepository = new LookUpRepoitory(Context); CompanyStructureRepository = new CompanyStructureRepository(Context); JobRepository = new JobRepository(Context); PeopleRepository = new PeopleRepository(Context); PositionRepository = new PositionRepository(Context); BudgetRepository = new BudgetRepository(Context); QualificationRepository = new QualificationRepository(Context); LeaveRepository = new LeaveRepository(Context); EmployeeRepository = new EmployeeRepository(Context); CustodyRepository = new CustodyRepository(Context); TrainingRepository = new TrainingRepository(Context); BenefitsRepository = new BenefitsRepository(Context); AudiTrialRepository = new AudiTrialRepository(Context); TerminationRepository = new TerminationRepository(Context); DisciplineRepository = new DisciplineRepository(Context); CheckListRepository = new CheckListRepository(Context); ComplaintRepository = new ComplaintRepository(Context); MessageRepository = new MessageRepository(Context); MedicalRepository = new MedicalRepository(Context); HrLettersRepository = new HRLettersRepository(Context); PayrollRepository = new PayrollRepository(Context); SalaryDesignRepository = new SalaryDesignRepository(Context); NotificationRepository = new NotificationRepository(Context); MissionRepository = new MissionRepository(Context); MeetingRepository = new MeetingRepository(Context); }
public IHttpActionResult GetLeaveReport(JObject objData) { DataSet ds; if (!string.IsNullOrWhiteSpace(Convert.ToString(objData["employeeId"]))) { ds = LeaveRepository.LeaveReport(Convert.ToString(objData["employeeStatus"]), Guid.Parse(Convert.ToString(objData["employeeId"]))); } else { ds = LeaveRepository.LeaveReport(Convert.ToString(objData["employeeStatus"])); } ds.Tables[0].TableName = "LeaveReport"; DataTable dt = new DataTable(); dt.Clear(); dt.Columns.Add("ReportHeaders"); foreach (DataColumn col in ds.Tables[0].Columns) { DataRow newRow = dt.NewRow(); newRow["ReportHeaders"] = col.ColumnName; dt.Rows.Add(newRow); } ds.Tables.Add(dt); ds.Tables[1].TableName = "ReportHeaders"; return(Ok(ds)); }
public IHttpActionResult BindingLeaveRecordGrid() { string employeeId = GetUserId(); DataTable dt = LeaveRepository.EmployeeLeaveRecord(userRole(), Guid.Parse(employeeId)); return(Ok(dt)); }
public EmployeeLeaveViewModel GetPendingApprovals() { ILeaveRepository leaveRepository = new LeaveRepository(); this.employeeLeaveApprovals = leaveRepository.GetLeaveApprovals(this.ApproverID); return(this); }
public AdminLeaveController(TaskRepo taskRepo, IEmpRepository empRepository, IWebHostEnvironment webHostEnvironment, LeaveRepository leaveRepository, JobRepository jobRepository) { _empRepository = empRepository; _jobRepository = jobRepository; _webHostEnvironment = webHostEnvironment; _leaveRepository = leaveRepository; _taskRepository = taskRepo; }
public async Task AvailableLeave(IDialogContext context, LuisResult result) { try { var repo = new LeaveRepository(); var leave = await repo.LeaveAsync(context.Activity.From.Id, context.Activity.ChannelId); var message = "You have {0} days of {1} available."; switch (result.GetResolvedListEntity("LeaveType")) { case "SickLeave": var availableSickLeave = leave.TotalSickLeave - leave.AvailedSickLeave; message = "You have " + availableSickLeave + " days of sick leaves available "; break; case "AnnualLeave": message = string.Format(message, (leave.TotalAnnualLeave - leave.AvailedAnnualLeave), "annual leaves"); break; case "CasualLeave": message = string.Format(message, (leave.TotalCasualLeave - leave.AvailedCasualLeave), "casual leave"); break; default: var totalAvailableLeave = (leave.TotalSickLeave + leave.TotalAnnualLeave + leave.TotalCasualLeave) - (leave.AvailedSickLeave + leave.AvailedAnnualLeave + leave.AvailedCasualLeave); message = string.Format(message, totalAvailableLeave, "total leaves"); break; } // message += result.GetResolvedListEntity("LeaveType"); await context.PostAsync(message); context.Wait(this.MessageReceived); } catch (AuthenticationException) { await context.PostAsync( "You need to verify yourself before I can provide you this information. Please write verify to start the procecss"); context.Wait(MessageReceived); } catch (PlatformNotSupportedException) { await context.PostAsync("This chat platform is not yet supported. Please use Facebook or skype"); context.Wait(MessageReceived); } }
public ActionResult RequestForLeave() { LeaveRequestListViewModel viewModel = new LeaveRequestListViewModel(); LeaveRequestRepository leaveRequestRepository = new LeaveRequestRepository(); LeaveRepository leaveRepository = new LeaveRepository(); foreach (var leaveRequest in leaveRequestRepository.GetAll()) { LeaveRequestListItemViewModel listItemViewModel = new LeaveRequestListItemViewModel(); listItemViewModel.Id = leaveRequest.Id; listItemViewModel.TotalCount = leaveRequest.TotalCount; listItemViewModel.LeaveId = leaveRequest.Leave?.Id; listItemViewModel.LeaveList.Add(new SelectListItem() { Value = null, Text = "", }); listItemViewModel.LeaveList.AddRange(leaveRepository.GetAll().Select(s => new SelectListItem() { Value = s.Id.ToString(), Text = String.Format("{0}-{1}", s.LeaveType, s.Employee?.FullName), Selected = s.Id == leaveRequest.Leave?.Id, Disabled = false })); viewModel.LeaveRequests.Add(listItemViewModel); } LeaveRequestListItemViewModel listItemViewModel2 = new LeaveRequestListItemViewModel() { Id = 0 }; listItemViewModel2.LeaveList.Add(new SelectListItem() { Value = null, Text = "", }); listItemViewModel2.LeaveList.AddRange(leaveRepository.GetAll().Select(s => new SelectListItem() { Value = s.Id.ToString(), Text = String.Format("{0}-{1}", s.LeaveType, s.Employee?.FullName), Selected = false, Disabled = false })); viewModel.LeaveRequests.Add(listItemViewModel2); return(View(viewModel)); }
public ActionResult Employee(FormCollection formCollection) { EmployeeListViewModel employeeListViewModel = new EmployeeListViewModel(); TryUpdateModel(employeeListViewModel); if (ModelState.IsValid) { EmployeeRepository repository = new EmployeeRepository(); LeaveConfigurationRepository leaveConfigurationRepository = new LeaveConfigurationRepository(); foreach (EmployeeListItemViewModel itemViewModel in employeeListViewModel.EmployeeList) { Employee employee = repository.GetById(itemViewModel.Id); if (employee == null) { //insert if (String.IsNullOrWhiteSpace(itemViewModel.FullName) == false && itemViewModel.Id == 0) { employee = new Employee(itemViewModel.FullName) { Manager = repository.GetById(itemViewModel.ManagerId ?? 0) }; LeaveGenerator generator = new LeaveGenerator(); LeaveRepository leaveRepository = new LeaveRepository(); foreach (var leaveConfig in leaveConfigurationRepository.GetAll()) { Leave leave = generator.Generate(employee, leaveConfig); employee.LeaveList.Add(leave); leaveRepository.SaveOrUpdate(leave); } repository.SaveOrUpdate(employee); } } else { //update employee.FullName = itemViewModel.FullName; employee.Manager = repository.GetById(itemViewModel.ManagerId ?? 0); repository.SaveOrUpdate(employee); } } return(RedirectToAction("Employee")); } return(Employee()); }
public EmployeeHomeController(TaskRepo taskRepo, AttendenceRepo attendenceRepo, LeaveRepository leaveRepository, IEmpRepository empRepository, IWebHostEnvironment webHostEnvironment, TimeTrackRepo timeTrackRepo, EmpStoreContext context, Repo4 repo4) { _timeTrackRepo = timeTrackRepo; _empRepository = empRepository; _webHostEnvironment = webHostEnvironment; _context = context; _leaveRepository = leaveRepository; _attendenceRepository = attendenceRepo; _taskRepository = taskRepo; _repo4 = repo4; }
public IHttpActionResult GetEmpLeaves(LeaveInsertModel lm) { if (lm.employeeId == Guid.Empty) { lm.employeeId = Guid.Parse(GetUserId()); } DataSet ds = LeaveRepository.GetLeaves(lm.employeeId, null, false, int.Parse(lm.year)); ds.Tables[0].TableName = "Leaves"; DataTable dt = LeaveRepository.GetEmployeeTotalLeave(lm.employeeId, null, int.Parse(lm.year)); if (dt.Rows.Count > 0) { dt.TableName = "TotalLeaves"; ds.Tables.Add(dt.Copy()); } return(Ok(ds)); }
private static void CreateLeave() { EmployeeRepository employeeRepository = new EmployeeRepository(); LeaveConfigurationRepository leaveConfigurationRepository = new LeaveConfigurationRepository(); LeaveRepository leaveRepository = new LeaveRepository(); LeaveGenerator generator = new LeaveGenerator(); foreach (Employee employee in employeeRepository.GetAll()) { foreach (var leaveConfig in leaveConfigurationRepository.GetAll()) { Leave leave = generator.Generate(employee, leaveConfig); employee.LeaveList.Add(leave); leaveRepository.SaveOrUpdate(leave); } } }
public ActionResult RequestForLeave(FormCollection fc) { LeaveRequestListViewModel leaveRequestListViewModel = new LeaveRequestListViewModel(); TryUpdateModel(leaveRequestListViewModel); if (ModelState.IsValid) { LeaveRequestRepository repository = new LeaveRequestRepository(); LeaveRepository leaveRepository = new LeaveRepository(); foreach (var itemViewModel in leaveRequestListViewModel.LeaveRequests) { LeaveRequest leaveRequest = repository.GetById(itemViewModel.Id); Leave leave = leaveRepository.GetById(itemViewModel.LeaveId ?? 0); if (leaveRequest == null) { //insert if (itemViewModel.TotalCount > 0 && itemViewModel.Id == 0) { leaveRequest = new LeaveRequest(leave, itemViewModel.TotalCount); repository.SaveOrUpdate(leaveRequest); } } else { //update leaveRequest.Leave = leave; leaveRequest.TotalCount = itemViewModel.TotalCount; repository.SaveOrUpdate(leaveRequest); } } return(RedirectToAction("RequestForLeave")); } return(RequestForLeave()); }
public UnitOfWork(InterviewTestContext context) { _context = context; Leaves = new LeaveRepository(_context); LeaveTypes = new LeaveTypeRepository(_context); }
public UserLeaveService() { this._LeaveRepository = new LeaveRepository(); this._UserLeaveRepository = new UserLeaveRepository(); }
public AdminLeaveViewComponent(LeaveRepository leaveRepository) { _leaveRepository = leaveRepository; }
public ManagerLeaveController(IEmpRepository empRepository, IWebHostEnvironment webHostEnvironment, LeaveRepository leaveRepository) { _empRepository = empRepository; _leaveRepository = leaveRepository; _webHostEnvironment = webHostEnvironment; }
public TodayLeaveViewComponent(LeaveRepository leaveRepository) { _leaveRepository = leaveRepository; }
public LeaveBalanceViewComponent(LeaveRepository leaveRepository) { _leaveRepository = leaveRepository; }
public LeaveService() { repo = new LeaveRepository(); }
public LeaveBO(SessionObj _sessionObj) { sessionObj = _sessionObj; leaveRepository = new LeaveRepository(); }
public LeaveTakenDataViewComponent(LeaveRepository leaveRepository) { _leaveRepository = leaveRepository; }
public LeaveReportViewComponent(LeaveRepository leaveRepository) { _leaveRepository = leaveRepository; }
/// <summary> /// Initializes a new instance of the <see cref="LeaveService"/> class. /// </summary> /// <param name="unitOfWork">The unit of work.</param> /// <exception cref="System.ArgumentNullException">unitOfWork null</exception> public LeaveService(UnitOfWork unitOfWork) { if (unitOfWork == null) { throw new ArgumentNullException(UnitOfWorkConst); } this.unitOfWork = unitOfWork; this.leaveRepository = new LeaveRepository(this.unitOfWork); this.lookupRepository = new LookupRepository(this.unitOfWork); }
/// <summary> /// 添加 请假单数据 /// </summary> /// <param name="dtos">要添加的请假单Dto</param> /// <returns>业务操作结果</returns> public OperationResult AddLeave(params LeaveDto[] dtos) { return(LeaveRepository.Insert(dtos)); }
public UpcomingLeaveViewComponent(LeaveRepository leaveRepository) { _leaveRepository = leaveRepository; }
public ReviewDashController(IEmpRepository empRepository, LeaveRepository leaveRepository, TaskRepo taskRepository) { _taskRepository = taskRepository; _leaveRepository = leaveRepository; _empRepository = empRepository; }
/// <summary> /// 更新 请假单数据 /// </summary> /// <param name="dtos">要更新的请假单Dto</param> /// <returns>业务操作结果</returns> public OperationResult EditLeave(params LeaveDto[] dtos) { return(LeaveRepository.Update(dtos)); }