/// <summary> /// Gets the employee by email. /// </summary> /// <param name="email">The email.</param> /// <returns></returns> /// <exception cref="ApplicationException">Repository Get Employee by email {0}</exception> public IEmployee GetEmployeeByEmail(string email) { try { using ( var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS)) { var aRecord = EmployeeOnBoardQueries.getEmployeeByEmail(dbContext, email); return(aRecord); } } catch (Exception e) { throw new ApplicationException("Repository Get Employee by email {0}", e); } }
/// <summary> /// Gets the on boarder by email and staff number. /// </summary> /// <param name="companyId">The company identifier.</param> /// <param name="email">The email.</param> /// <param name="staffNumber">The staff number.</param> /// <returns></returns> /// <exception cref="ApplicationException">Repository Get OnBoarding by Company</exception> public IEmployee GetOnBoarderByEmailAndStaffNumber(int?companyId, string email, string staffNumber) { try { using ( var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS)) { var aRecord = EmployeeOnBoardQueries.getOnBoarderByCompanyAndEmailAndStaffNumber(dbContext, companyId, email, staffNumber); return(aRecord); } } catch (Exception e) { throw new ApplicationException("Repository Get OnBoarding by Company {0}", e); } }
/// <summary> /// Gets the promotions by company identifier. /// </summary> /// <param name="companyId">The company identifier.</param> /// <returns></returns> /// <exception cref="ApplicationException">Get Promotions By CompanyId {0}</exception> public IList <IPromotion> GetPromotionsByCompanyId(int companyId) { try { using ( var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS)) { var aRecord = EmployeeOnBoardQueries.getPromotionsByCompanyId(dbContext, companyId).ToList(); return(aRecord); } } catch (Exception e) { throw new ApplicationException("Get Promotions By CompanyId {0}", e); } }
/// <summary> /// Gets all employee. /// </summary> /// <returns></returns> /// <exception cref="ApplicationException">Repository Get Employee List {0}</exception> public IList <IEmployee> GetAllEmployee() { try { using ( var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS)) { var aRecord = EmployeeOnBoardQueries.getOnBoardingList(dbContext).ToList(); return(aRecord); } } catch (Exception e) { throw new ApplicationException("Repository Get Employee List {0}", e); } }
/// <summary> /// Gets the on boarder by company. /// </summary> /// <param name="companyId">The company identifier.</param> /// <param name="lastName">The last name.</param> /// <returns></returns> /// <exception cref="ApplicationException">Repository Get OnBoarding by Company</exception> public IEmployee GetOnBoarderByCompany(int?companyId, string lastName) { try { using ( var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS)) { var aRecord = EmployeeOnBoardQueries.getOnBoarderByCompany(dbContext, companyId, lastName); return(aRecord); } } catch (Exception e) { throw new ApplicationException("Repository Get OnBoarding by Company", e); } }
/// <summary> /// Gets the on boarder by identifier. /// </summary> /// <param name="employeeId">The employee identifier.</param> /// <returns></returns> /// <exception cref="ApplicationException">Repository GetOnBoardingById</exception> public IEmployee GetOnBoarderById(int employeeId) { try { using ( var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS)) { var aRecord = EmployeeOnBoardQueries.getOnBoardingById(dbContext, employeeId); return(aRecord); } } catch (Exception e) { throw new ApplicationException("Repository GetOnBoardingById", e); } }