Exemple #1
0
 /// <summary>
 /// Gets the industry by identifier.
 /// </summary>
 /// <param name="industryId">The industry identifier.</param>
 /// <returns></returns>
 /// <exception cref="ApplicationException">Repository GetIndustryById</exception>
 public IIndustry GetIndustryById(int industryId)
 {
     try
     {
         using (
             var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
         {
             var aRecord = IndustryQueries.getIndustryById(dbContext, industryId);
             return(aRecord);
         }
     }
     catch (Exception e)
     {
         throw new ApplicationException("Repository GetIndustryById", e);
     }
 }
Exemple #2
0
        /// <summary>
        /// Gets all industry.
        /// </summary>
        /// <returns></returns>
        /// <exception cref="ApplicationException">Repository Get All Industry</exception>
        public IList <IIndustry> GetAllIndustry()
        {
            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var list = IndustryQueries.getAllIndustry(dbContext).ToList();

                    return(list);
                }
            }
            catch (Exception e)
            {
                throw new ApplicationException("Repository Get All Industry", e);
            }
        }