示例#1
0
        /// <summary>
        /// </summary>
        /// <param name="companyId"></param>
        /// <returns></returns>
        /// <exception cref="System.ApplicationException">Repository GetAllTrainingNeedAnalysis</exception>
        public IList <ITrainingNeedAnalysis> GetAllMyTrainingNeedAnalysis(int companyId)
        {
            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var list = TrainingNeedAnalysisQueries.getAllMyTrainingNeedAnalysis(dbContext, companyId).ToList();

                    return(list);
                }
            }
            catch (Exception e)
            {
                throw new ApplicationException("Repository GetAllTrainingNeedAnalysis", e);
            }
        }
示例#2
0
        /// <summary>
        /// </summary>
        /// <param name="trainingNeedAnalysisId"></param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">
        /// trainingNeedAnalysisId
        /// or
        /// Get TrainingNeedAnalysisInfo By Id
        /// </exception>
        public ITrainingNeedAnalysis GetTrainingNeedAnalysisById(int trainingNeedAnalysisId)
        {
            if (trainingNeedAnalysisId <= 0)
            {
                throw new ArgumentNullException(nameof(trainingNeedAnalysisId));
            }

            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var result = TrainingNeedAnalysisQueries.getTrainingNeedAnalysisById(dbContext, trainingNeedAnalysisId);

                    return(result);
                }
            }
            catch (Exception e)
            {
                throw new ArgumentNullException("Get TrainingNeedAnalysisInfo By Id", e);
            }
        }