Exemplo n.º 1
0
        public static List <CourseSon> GetAllCourseByStandardKey(string key)
        {
            var lstObj = new List <CourseSon>();
            var query  = new StringBuilder();

            query.Append(" SELECT stancourse.StandardCourseKey, course.Name");
            query.Append(" FROM dbo.StandardCourse stancourse");
            query.Append(" LEFT JOIN dbo.Standards stan ");
            query.Append(" ON stancourse.StandardFk = stan.StandardKey");
            query.Append(" LEFT JOIN dbo.course course ");
            query.Append(" ON stancourse.CourseFk = course.CourseKey");

            query.Append(String.Format(" WHERE  stancourse.StandardFk = '{0}'", key));

            try
            {
                using (var objDal = new BaseDAL_II())
                {
                    lstObj = objDal.consultar <CourseSon>(query.ToString());
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error:  " + ex.Message);
            }


            return(lstObj);
        }
Exemplo n.º 2
0
        public static List <Office> GetAllOffice()
        {
            var lstObj = new List <Office>();

            try
            {
                using (var objDal = new BaseDAL_II())
                {
                    lstObj = objDal.consultar <Office>(1, 3, "Orden ASC", "SELECT *FROM dbo.Office");    //consultarTodos<Office>();
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error:  " + ex.Message);
            }
            return(lstObj);
        }
Exemplo n.º 3
0
        public static List <Standards> GetAllStandardWhitCourse()
        {
            var query = new StringBuilder();

            query.Append(" SELECT DISTINCT dbo.StandardCourse.StandardFk as StandardKey, dbo.Standards.Name");
            query.Append(" FROM dbo.StandardCourse");
            query.Append(" LEFT JOIN dbo.Standards ON dbo.StandardCourse.StandardFk = dbo.Standards.StandardKey");
            try
            {
                using (var objDal = new BaseDAL_II())
                {
                    return(objDal.consultar <Standards>(query.ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error:  " + ex.Message);
            }
        }
        public static List <StatusCliente> GetAll()
        {
            var query = new StringBuilder();

            query.Append(" SELECT *FROM dbo.StatusCliente");
            query.Append(" Order by Orden ASC");

            try
            {
                using (var objDal = new BaseDAL_II())
                {
                    return(objDal.consultar <StatusCliente>(query.ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error:  " + ex.Message);
            }
        }
Exemplo n.º 5
0
        public static List <Cliente> GetAllCliente()
        {
            var lstObj = new List <Cliente>();
            var query  = new StringBuilder();

            query.Append("SELECT *FROM dbo.Cliente");
            query.Append(" ORDER BY RazonSocial ASC");

            try
            {
                using (var objDal = new BaseDAL_II())
                {
                    lstObj = objDal.consultar <Cliente>(query.ToString());
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error:  " + ex.Message);
            }
            return(lstObj);
        }
Exemplo n.º 6
0
        public static List <InterestType> GetAllInterest()
        {
            var query = new StringBuilder();

            query.Append(" SELECT *FROM dbo.InterestType");
            query.Append(" ORDER BY Name");

            var lstObj = new List <InterestType>();

            try
            {
                using (var objDal = new BaseDAL_II())
                {
                    lstObj = objDal.consultar <InterestType>(query.ToString());
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error:  " + ex.Message);
            }

            return(lstObj);
        }
Exemplo n.º 7
0
        public static List <Cliente> GetAllCliente(int pag, int cantReg)
        {
            var lstObj = new List <Cliente>();
            var query  = new StringBuilder();
            var orden  = "NombreCliente";

            query.Append(" SELECT cliente.ClaveCliente, cliente.NombreCliente, oficina.Name as 'OfficeName', cliente.Baja 'Status'");
            query.Append(" FROM dbo.Cliente cliente ");
            query.Append(" LEFT JOIN dbo.Office oficina ON cliente.OfficeFk = oficina.OfficeKey ");
            query.Append(" WHERE cliente.Baja = 0");

            try
            {
                using (var objDal = new BaseDAL_II())
                {
                    lstObj = objDal.consultar <Cliente>(pag, cantReg, orden, query.ToString());
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error:  " + ex.Message);
            }
            return(lstObj);
        }
Exemplo n.º 8
0
        public static List <States> GetAllStates(string countryKey)
        {
            var query = new StringBuilder();

            query.Append(" SELECT *FROM dbo.States");
            query.Append(String.Format(" WHERE CountryFk = '{0}'", countryKey));
            query.Append(" ORDER BY Name");

            var lstObj = new List <States>();

            try
            {
                using (var objDal = new BaseDAL_II())
                {
                    lstObj = objDal.consultar <States>(query.ToString());
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error:  " + ex.Message);
            }

            return(lstObj);
        }