Exemple #1
0
        public List <DTO_SPRT_College> GetColleges()
        {
            List <DTO_SPRT_College> returnObject = new List <DTO_SPRT_College>();

            GigALoan_DAL.DB_connection context = new GigALoan_DAL.DB_connection();

            var list = context.proc_GetColleges().ToList();

            foreach (var entity in list)
            {
                returnObject.Add(new DTO_SPRT_College(entity.CollegeID, entity.CollegeName));
            }

            return(returnObject);
        }
Exemple #2
0
        public List <DTO_SPRT_College> GetCollegeByID(DTO_SPRT_College request)
        {
            GigALoan_DAL.DB_connection context = new GigALoan_DAL.DB_connection();

            var returnObject = new List <DTO_SPRT_College>();

            var college = context.proc_GetColleges().Where(col => col.CollegeID == request.CollegeID).Single();

            DTO_SPRT_College result = new DTO_SPRT_College(college.CollegeID, college.CollegeName);

            if (result != null)
            {
                returnObject.Add(result);
            }

            return(returnObject);
        }