Esempio n. 1
0
        /// <summary>
        /// Gets the level by name company identifier.
        /// </summary>
        /// <param name="companyId">The company identifier.</param>
        /// <param name="name">The name.</param>
        /// <returns></returns>
        /// <exception cref="ApplicationException">Get Level By Name and CompanyId {0}</exception>
        public ILevel GetLevelByNameCompanyId(int companyId, string name)
        {
            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var newRecord =
                        LevelQueries.getLevelByNameCompanyId(dbContext, companyId, name);

                    return(newRecord);
                }
            }
            catch (Exception e)
            {
                throw new ApplicationException("Get Level By Name and CompanyId {0}", e);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the level list by identifier.
        /// </summary>
        /// <param name="levelId">The level identifier.</param>
        /// <returns></returns>
        /// <exception cref="ApplicationException">Repository GetLevelById</exception>
        public IList <ILevel> GetLevelListById(int levelId)
        {
            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var newRecord =
                        LevelQueries.getLevelListById(dbContext, levelId).ToList();

                    return(newRecord);
                }
            }
            catch (Exception e)
            {
                throw new ApplicationException("Repository GetLevelById", e);
            }
        }