Пример #1
0
        public List <Rol> GetAll()
        {
            List <Dictionary <string, dynamic> > data = new List <Dictionary <string, dynamic> >();
            List <Rol> roles = new List <Rol>();

            data = dataBaseController.ExecuteQuery("SELECT * FROM rol", new List <SqlParameter>());

            roles = FillObjects(data);

            return(roles);
        }
Пример #2
0
        public List <Permiso> GetAll()
        {
            List <Dictionary <string, dynamic> > data = new List <Dictionary <string, dynamic> >();
            List <Permiso> permisos = new List <Permiso>();

            data = dataBaseController.ExecuteQuery("SELECT * FROM permiso", new List <SqlParameter>());

            permisos = FillObjects(data);

            return(permisos);
        }
Пример #3
0
        public Orden GetOrden(int id)
        {
            List <Dictionary <string, dynamic> > data;
            Orden orden = null;

            List <SqlParameter> param = new List <SqlParameter>();

            param.Add(new SqlParameter()
            {
                ParameterName = "@Id", Value = id
            });

            data = dataBaseController.ExecuteQuery("SELECT * FROM orden WHERE id = @Id AND activo = 1", param);

            if (data.Count > 0)
            {
                orden = FillObject(data[0]);
            }

            return(orden);
        }
        public Producto GetProducto(int id)
        {
            List <Dictionary <string, dynamic> > data;
            Producto producto = null;

            List <SqlParameter> param = new List <SqlParameter>();

            param.Add(new SqlParameter()
            {
                ParameterName = "@Id", Value = id
            });

            data = dataBaseController.ExecuteQuery("SELECT * FROM producto WHERE id = @Id AND activo = 1", param);

            if (data.Count > 0)
            {
                producto = FillObject(data[0]);
            }

            return(producto);
        }
Пример #5
0
        public Usuario GetUsuario(int id)
        {
            List <Dictionary <string, dynamic> > data;
            Usuario usuario = null;

            List <SqlParameter> param = new List <SqlParameter>();

            param.Add(new SqlParameter()
            {
                ParameterName = "@Id", Value = id
            });

            data = dataBaseController.ExecuteQuery("SELECT * FROM usuario WHERE id = @Id", param);

            if (data.Count > 0)
            {
                usuario = FillObject(data[0]);
            }

            return(usuario);
        }