/// <summary> /// Gets the grade list by identifier. /// </summary> /// <param name="gradeId">The grade identifier.</param> /// <returns></returns> /// <exception cref="ApplicationException">Repository GetUserByCompanyID</exception> public IList <IGrade> GetGradeListById(int gradeId) { try { using ( var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS)) { var aRecord = GradeQueries.getGradeListById(dbContext, gradeId).ToList(); return(aRecord); } } catch (Exception e) { throw new ApplicationException("Repository GetUserByCompanyID", e); } }
/// <summary> /// Gets the name of the grade by. /// </summary> /// <param name="gradeName">Name of the grade.</param> /// <param name="companyId">The company identifier.</param> /// <returns></returns> /// <exception cref="ApplicationException">Repository GetUserByCompanyID</exception> public IGrade GetGradeByName(string gradeName, int companyId) { try { using ( var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS)) { var aRecord = GradeQueries.getGradeByName(dbContext, gradeName, companyId); return(aRecord); } } catch (Exception e) { throw new ApplicationException("Repository GetUserByCompanyID", e); } }