Ejemplo n.º 1
0
 /// <summary>
 /// Gets the name of the training by.
 /// </summary>
 /// <param name="trainingName">Name of the training.</param>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException">Get Training By Name</exception>
 public ITraining GetTrainingByName(string trainingName)
 {
     try
     {
         using (
             var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
         {
             var trainingInfo = TrainingQueries.getTrainingByName(dbContext, trainingName);
             return(trainingInfo);
         }
     }
     catch (Exception e)
     {
         throw new ArgumentNullException("Get Training By Name", e);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the name of the training by.
        /// </summary>
        /// <param name="companyId"></param>
        /// <returns></returns>
        /// <exception cref="ApplicationException">Repository GetAllTrainingReport</exception>
        public IList <ITrainingReport> GetAllMyTrainingReport(int companyId)
        {
            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var list = TrainingQueries.getAllMyTrainingReport(dbContext, companyId).ToList();

                    return(list);
                }
            }
            catch (Exception e)
            {
                throw new ApplicationException("Repository GetAllTrainingReport", e);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Trainings the calendar model.
        /// </summary>
        /// <param name="companyID">The company identifier.</param>
        /// <returns></returns>
        /// <exception cref="ApplicationException">Repository getTrainingCalendar</exception>
        public IList <ITrainingCalendar> TrainingCalendarModel(int companyID)
        {
            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var list = TrainingQueries.getTrainingCalendar(dbContext, companyID).ToList();

                    return(list);
                }
            }
            catch (Exception e)
            {
                throw new ApplicationException("Repository getTrainingCalendar", e);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets the training calendar by company idand training identifier.
        /// </summary>
        /// <param name="companyId">The company identifier.</param>
        /// <param name="trainingId">The training identifier.</param>
        /// <returns></returns>
        /// <exception cref="ApplicationException">Get Training Calendar By CompanyId</exception>
        public ITrainingCalendar GetTrainingCalendarByCompanyIdandTrainingId(int companyId, int trainingId)
        {
            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var list = TrainingQueries.getTrainingsCalendarByCompanyIdAndTrainingId(dbContext, companyId, trainingId);

                    return(list);
                }
            }
            catch (Exception e)
            {
                throw new ApplicationException("Get Training Calendar By CompanyId and TrainingId {0}", e);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Gets the training analysis by identifier.
        /// </summary>
        /// <param name="trainingAnalysisId">The training analysis identifier.</param>
        /// <returns></returns>
        /// <exception cref="System.ApplicationException">Get TrainingAnalysis By CompanyId, TrainingId andJobId {0}</exception>
        public ITrainingNeedAnalysis GetTrainingAnalysisById(int trainingAnalysisId)
        {
            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var list = TrainingQueries.getTrainingsNeedAnalysisById(dbContext, trainingAnalysisId);

                    return(list);
                }
            }
            catch (Exception e)
            {
                throw new ApplicationException("Get TrainingAnalysis By CompanyId, TrainingId andJobId {0}", e);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Gets all training calendar by company identifier.
        /// </summary>
        /// <param name="companyId">The company identifier.</param>
        /// <returns></returns>
        /// <exception cref="ApplicationException">Get All Training Calendar By CompanyId</exception>
        public IList <ITrainingCalendar> GetAllTrainingCalendarByCompanyId(int companyId)
        {
            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var list = TrainingQueries.getAllTrainingsCalendarByCompanyId(dbContext, companyId).ToList();

                    return(list);
                }
            }
            catch (Exception e)
            {
                throw new ApplicationException("Get All Training Calendar By CompanyId", e);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Gets the employee trainings by employee identifier.
        /// </summary>
        /// <param name="employeeId">The employee identifier.</param>
        /// <returns></returns>
        /// <exception cref="System.ApplicationException">Repository GetAllTrainings</exception>
        public IEmployeeTrainingModel GetEmployeeTrainingsByEmployeeId(int employeeId)
        {
            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var list = TrainingQueries.getEmployeeTrainingsByEmployeeId(dbContext, employeeId);

                    return(list);
                }
            }
            catch (Exception e)
            {
                throw new ApplicationException("Repository GetAllTrainings", e);
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Gets the training request by company identifier.
        /// </summary>
        /// <param name="companyId">The company identifier.</param>
        /// <returns></returns>
        /// <exception cref="ApplicationException">Repository GetTrainingRequestByCompanyId</exception>
        public IList <IEmployeeTrainingModel> GetTrainingRequestByCompanyId(int companyId)
        {
            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var list = TrainingQueries.getTrainingRequestByCompanyId(dbContext, companyId).ToList();

                    return(list);
                }
            }
            catch (Exception e)
            {
                throw new ApplicationException("Repository GetTrainingRequestByCompanyId", e);
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Gets the training tarining history by identifier.
        /// </summary>
        /// <param name="UserId">The user identifier.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// UserId
        /// or
        /// Get History of Training By Id
        /// </exception>
        public ITrainingHistoryModel GetTrainingTariningHistoryById(int UserId)
        {
            if (UserId <= 0)
            {
                throw new ArgumentNullException(nameof(UserId));
            }

            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var result = TrainingQueries.GetTrainingByHistoryId(dbContext, UserId);

                    return(result);
                }
            }
            catch (Exception e)
            {
                throw new ArgumentNullException("Get History of Training By Id", e);
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// </summary>
        /// <param name="trainingReportId"></param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// trainingReportId
        /// or
        /// Get TrainingReportInfo By Id
        /// </exception>
        public ITrainingReport GetTrainingReportById(int trainingReportId)
        {
            if (trainingReportId <= 0)
            {
                throw new ArgumentNullException(nameof(trainingReportId));
            }

            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var result = TrainingQueries.getTrainingReportById(dbContext, trainingReportId);

                    return(result);
                }
            }
            catch (Exception e)
            {
                throw new ArgumentNullException("Get TrainingReportInfo By Id", e);
            }
        }
Ejemplo n.º 11
0
        public IList <IEmployeeTrainingModel> GetPendingTrainingByCompanyId(int companyId)
        {
            if (companyId <= 0)
            {
                throw new ArgumentNullException(nameof(companyId));
            }

            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var result = TrainingQueries.getPendingTrainingByCompanyId(dbContext, companyId).ToList();

                    return(result);
                }
            }
            catch (Exception e)
            {
                throw new ArgumentNullException("Get Training By Id", e);
            }
        }
Ejemplo n.º 12
0
 public TrainingController()
 {
     tq = new TrainingQueries();
 }