Exemplo n.º 1
0
        public List <DTO_SPRT_Major> GetMajors()
        {
            List <DTO_SPRT_Major> returnObject = new List <DTO_SPRT_Major>();

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

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

            foreach (var entity in list)
            {
                returnObject.Add(new DTO_SPRT_Major(entity.MajorID, entity.MajorName));
            }

            return(returnObject);
        }
Exemplo n.º 2
0
        public List <DTO_SPRT_Major> GetMajorByID(DTO_SPRT_Major request)
        {
            GigALoan_DAL.DB_connection context = new GigALoan_DAL.DB_connection();

            var major = context.proc_GetMajors().Where(m => m.MajorID == request.MajorID).Single();

            var returnObject = new List <DTO_SPRT_Major>();

            DTO_SPRT_Major result;


            if (major != null)
            {
                result = new DTO_SPRT_Major(major.MajorID, major.MajorName);
                returnObject.Add(result);
            }

            return(returnObject);
        }