Ejemplo n.º 1
0
 public bool EditarProducto(Producto producto)
 {
     SqlServerProducto objDataBase = new SqlServerProducto();
     try
     {
         objDataBase.EditarProducto(producto);
     }
     catch (ExcepcionSql e)
     {
         System.Diagnostics.Debug.WriteLine(e.MensajeError);
         return false;
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine(e.Message);
         return false;
     }
     return true;
 }
Ejemplo n.º 2
0
        public List <string> ObtenerCategorias()
        {
            List <string>     categorias  = new List <string>();
            SqlServerProducto objDataBase = new SqlServerProducto();

            try
            {
                categorias = objDataBase.ConsultarCategorias();
            }
            catch (ExcepcionNulo e)
            {
                System.Diagnostics.Debug.WriteLine(e.MensajeError);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
            }
            return(categorias);
        }
Ejemplo n.º 3
0
        public List <string> ObtenerMarcas(string proveedor)
        {
            List <string>     marcas      = new List <string>();
            SqlServerProducto objDataBase = new SqlServerProducto();

            try
            {
                marcas = objDataBase.ConsultarMarcas(proveedor);
            }
            catch (ExcepcionNulo e)
            {
                System.Diagnostics.Debug.WriteLine(e.MensajeError);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
            }
            return(marcas);
        }
Ejemplo n.º 4
0
        public List <Producto> ObtenerProductosDetallados(Producto productoGenerico)
        {
            List <Producto>   productos   = new List <Producto>();
            SqlServerProducto objDataBase = new SqlServerProducto();

            try
            {
                productos = objDataBase.ConsultarProductosDetallados(productoGenerico);
            }
            catch (ExcepcionNulo e)
            {
                System.Diagnostics.Debug.WriteLine(e.MensajeError);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
            }
            return(productos);
        }
Ejemplo n.º 5
0
 public List<Producto> CargarListaProductoNombre(String productoNombre)
 {
     try
     {
         List<Producto> miLista = new SqlServerProducto().SqlConsultarXNombreProducto(productoNombre);
         return miLista;
     }
     catch (ArgumentException e)
     {
         throw new Exception("Parametros invalidos", e);
     }
     catch (NullReferenceException e)
     {
         throw new Exception("Productos vacios", e);
     }
     catch (Exception e)
     {
         throw new Exception("Error en la consulta de los Productos", e);
     }
 }
Ejemplo n.º 6
0
 public List <Producto> CargarListaProductoNombre(String productoNombre)
 {
     try
     {
         List <Producto> miLista = new SqlServerProducto().SqlConsultarXNombreProducto(productoNombre);
         return(miLista);
     }
     catch (ArgumentException e)
     {
         throw new Exception("Parametros invalidos", e);
     }
     catch (NullReferenceException e)
     {
         throw new Exception("Productos vacios", e);
     }
     catch (Exception e)
     {
         throw new Exception("Error en la consulta de los Productos", e);
     }
 }
Ejemplo n.º 7
0
 public List <Producto> ListaProductosNoImplemento(Tratamiento miTratamiento)
 {
     try
     {
         List <Producto> miLista = new SqlServerProducto().SqlConsultarProductoNoImplemento(miTratamiento);
         return(miLista);
     }
     catch (ArgumentException e)
     {
         throw new Exception("Parametros invalidos", e);
     }
     catch (NullReferenceException e)
     {
         throw new Exception("Productos vacios", e);
     }
     catch (Exception e)
     {
         throw new Exception("Error en la consulta de los Productos", e);
     }
 }
Ejemplo n.º 8
0
        public bool EditarProductoGenerico(Producto producto, string nombreViejo)
        {
            SqlServerProducto objDataBase = new SqlServerProducto();

            try
            {
                objDataBase.EditarProductoGenerico(producto, nombreViejo);
            }
            catch (ExcepcionSql e)
            {
                System.Diagnostics.Debug.WriteLine(e.MensajeError);
                return(false);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                return(false);
            }
            return(true);
        }
Ejemplo n.º 9
0
        public bool AgregarProducto(Producto producto)
        {
            SqlServerProducto objDataBase = new SqlServerProducto();
            try
            {
                //1-Agregar el producto asociado a esa categoria
                objDataBase.AgregarProducto(producto);

                //2-Agregar el detalle_producto asociado al producto y a la marca
                objDataBase.AgregarDetalleProducto(producto);
            }
            catch (ExcepcionSql e)
            {
                System.Diagnostics.Debug.WriteLine(e.MensajeError);
                return false;
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                return false;
            }
            return true;
        }
Ejemplo n.º 10
0
        public bool AgregarProducto(Producto producto)
        {
            SqlServerProducto objDataBase = new SqlServerProducto();

            try
            {
                //1-Agregar el producto asociado a esa categoria
                objDataBase.AgregarProducto(producto);

                //2-Agregar el detalle_producto asociado al producto y a la marca
                objDataBase.AgregarDetalleProducto(producto);
            }
            catch (ExcepcionSql e)
            {
                System.Diagnostics.Debug.WriteLine(e.MensajeError);
                return(false);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                return(false);
            }
            return(true);
        }
Ejemplo n.º 11
0
 public List<Producto> ObtenerProductosDetallados(Producto productoGenerico)
 {
     List<Producto> productos = new List<Producto>();
     SqlServerProducto objDataBase = new SqlServerProducto();
     try
     {
         productos = objDataBase.ConsultarProductosDetallados(productoGenerico);
     }
     catch (ExcepcionNulo e)
     {
         System.Diagnostics.Debug.WriteLine(e.MensajeError);
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine(e.Message);
     }
     return productos;
 }
Ejemplo n.º 12
0
 public List<string> ObtenerMarcas(string proveedor)
 {
     List<string> marcas = new List<string>();
     SqlServerProducto objDataBase = new SqlServerProducto();
     try
     {
         marcas = objDataBase.ConsultarMarcas(proveedor);
     }
     catch (ExcepcionNulo e)
     {
         System.Diagnostics.Debug.WriteLine(e.MensajeError);
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine(e.Message);
     }
     return marcas;
 }
Ejemplo n.º 13
0
 public List<string> ObtenerCategorias()
 {
     List<string> categorias = new List<string>();
     SqlServerProducto objDataBase = new SqlServerProducto();
     try
     {
         categorias = objDataBase.ConsultarCategorias();
     }
     catch (ExcepcionNulo e)
     {
         System.Diagnostics.Debug.WriteLine(e.MensajeError);
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine(e.Message);
     }
     return categorias;
 }
Ejemplo n.º 14
0
 public List<Producto> ListaProductosNoImplemento(Tratamiento miTratamiento)
 {
     try
     {
         List<Producto> miLista = new SqlServerProducto().SqlConsultarProductoNoImplemento(miTratamiento);
         return miLista;
     }
     catch (ArgumentException e)
     {
         throw new Exception("Parametros invalidos", e);
     }
     catch (NullReferenceException e)
     {
         throw new Exception("Productos vacios", e);
     }
     catch (Exception e)
     {
         throw new Exception("Error en la consulta de los Productos", e);
     }
 }