Ejemplo n.º 1
0
        public static DataTable Filtro(string talle, string categ, string descr)
        {
            bdMetodos manejador = new bdMetodos();
            string instruccion = "select * from Productos p, Categorias c where c.IdCategoria=p.IdCategoria and p.Estado=1 ";
            if (talle == "Todo" && categ == "Todo" && descr == "")
            {
                instruccion += ";";
            }
            else
            {
		//riBer riBer
                if (talle == "Todo" && categ == "Todo" && descr != string.Empty)
                {
                    instruccion += "and p.Descripcion like '%" + descr + "%'";
                }
                else
                {
                    if (categ == "Todo" && descr == "")
                    {
                        instruccion += "and p.Talle='" + talle + "'";
                    }
                    else
                    {
                        if (categ == "Todo")
                        {
                            instruccion += "and p.Talle='" + talle + "' and p.Descripcion like '%" + descr + "%'";
                        }
                        else
                        {
                            if (talle == "Todo" && descr == "")
                            {
                                instruccion += "and c.Descripcion='" + categ + "'";
                            }
                            else
                            {
                                if (talle == "Todo")
                                {
                                    instruccion += "and c.Descripcion='" + categ + "' and p.Descripcion like '%" + descr + "%'";
                                }
                                else
                                {
                                    if (talle != string.Empty && categ != string.Empty && descr != string.Empty)
                                    {
                                        instruccion += "and p.Talle='" + talle + "' and c.Descripcion='" + categ + "' and p.Descripcion like '%" + descr + "%'";
                                    }
                                    else
                                    {
                                        instruccion += "and p.Talle='" + talle + "' and c.Descripcion='" + categ + "'";
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return manejador.Consultar(instruccion);
        }
Ejemplo n.º 2
0
 public static void Venta(iEntidad venta)
 {
     bdMetodos manejador = new bdMetodos();
     string instruccion = "select * from DetalleVentas where IdVenta=" + venta.Id;
     DataTable dt = manejador.Consultar(instruccion);
     Producto p;
     foreach(DataRow row in dt.Rows)
     {
         p = Devuelve.Producto((int)row["IdProducto"]);
         p.Stock += (int)row["Cantidad"];
         Actualiza.Producto(p);
     }
     ((Venta)venta).Estado = false;
     ManejaVenta manejaVenta = new ManejaVenta();
     manejaVenta.Modificacion(venta);
 }
Ejemplo n.º 3
0
 //Constructor
 public ManejaDetalleVenta()
 {
     manejador = new bdMetodos();
 }
Ejemplo n.º 4
0
 public static DataTable detalleFiltrado(int idVe)
 {
     bdMetodos manejador = new bdMetodos();
     string instruccion = "select e.Descripcion,p.PrecioCosto,p.CoefUtil,p.Cantidad from productos e, detalleventas p where p.IdVenta="+idVe+" and p.IdProducto=e.IdProducto";
     return manejador.Consultar(instruccion);
 }
Ejemplo n.º 5
0
        public static DataTable filtrafechas(String fecha)
        {
            bdMetodos manejador = new bdMetodos();

            string instruccion = "select IdVenta as Venta,sucursal,Total from ventas where Fecha='"+fecha+"'";

            return manejador.Consultar(instruccion);
        }
Ejemplo n.º 6
0
        public static DataTable filtraVenta(String desde,String hasta)
        {
            bdMetodos manejador = new bdMetodos();
            
            string instruccion = "select distinct Fecha from ventas where Fecha between'" +desde+ "' and '"+hasta+"'";

            return manejador.Consultar(instruccion);
        }
Ejemplo n.º 7
0
 //Constructor
 public ManejaProducto()
 {
     manejador = new bdMetodos();
 }
Ejemplo n.º 8
0
 //Constructor
 public ManejaCliente()
 {
     manejador = new bdMetodos();
 }
Ejemplo n.º 9
0
 //Constructor
 public ManejaProveedor()
 {
     manejador = new bdMetodos();
 }
Ejemplo n.º 10
0
 //Constructor
 public ManejaFactura()
 {
     manejador = new bdMetodos();
 }
Ejemplo n.º 11
0
 public ManejaPedido()
 {
     conec = new bdMetodos();
 }
 //Constructor
 public ManejaTelefonoProveedor()
 {
     manejador = new bdMetodos();
 }
Ejemplo n.º 13
0
 //Constructor
 public ManejaTelefonoCliente()
 {
     manejador = new bdMetodos();
 }
Ejemplo n.º 14
0
 //Constructor
 public ManejaCategoria()
 {
     manejador = new bdMetodos();
 }
Ejemplo n.º 15
0
 //Constructor
 public ManejaTelefono()
 {
     manejador = new bdMetodos();
 }