Exemple #1
0
        /// <summary>
        /// Gets the employee training by identifier.
        /// </summary>
        /// <param name="Id">The identifier.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">Get Training By Id</exception>
        public IEmployeeTrainingModel GetEmployeeTrainingById(int Id)
        {
            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var result = EmployeeTrainingQueries.getAllMyEmployeeTrainings(dbContext, Id);

                    return(result);
                }
            }
            catch (Exception e)
            {
                throw new ArgumentNullException("Get Training By Id", e);
            }
        }
Exemple #2
0
        /// <summary>
        /// Gets the employee training by employee identifier.
        /// </summary>
        /// <param name="EmployeeId">The employee identifier.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">GetEmployeeTraining {0}</exception>
        public IList <IEmployeeTrainingModel> GetEmployeeTrainingByEmployeeId(int EmployeeId)
        {
            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var training =
                        EmployeeTrainingQueries.getEmployeeTrainingList(dbContext, EmployeeId).ToList();

                    return(training);
                }
            }
            catch (Exception e)
            {
                throw new ArgumentNullException("GetEmployeeTraining {0}", e);
            }
        }