Ejemplo n.º 1
0
        public void Vaciar(TextBox fa)
        {
            MySqlCommand Coman;

            conec.datos inserta = new conec.datos();
            inserta.Conectar();
            String comando = "delete FROM `Carrito` WHERE `id_venta` = " + fa.Text;

            Coman = inserta.construye_command(comando);
            inserta.ejecutanonquery();
            Coman.Connection.Close();
            inserta.desconectar();
        }
Ejemplo n.º 2
0
        public void insertaVendedor(TextBox Nom, TextBox App, TextBox Apm)
        {
            MySqlCommand Coman;

            conec.datos inserta = new conec.datos();
            inserta.Conectar();

            String query = "Insert into Vendedor (Nombre, App_V, Apm_V) values('" + Nom.Text + "','" + App.Text + "','" + Apm.Text + "')";

            Coman = inserta.construye_command(query);
            inserta.ejecutanonquery();
            Coman.Connection.Close();
            inserta.desconectar();
        }
Ejemplo n.º 3
0
        public void insertaCompra(Label id_esfera, TextBox cantidad, string descrip, double subtotal, TextBox id_venta)
        {
            MySqlCommand Coman;

            conec.datos inserta = new conec.datos();
            inserta.Conectar();

            String query = "INSERT INTO `eliarome35436DB`.`Carrito` (`id_esfera`, `cantidad`, `descripcion`, `Subtotal`, `id_venta`) VALUES ('" + id_esfera.Text + "','" + cantidad.Text + "','" + descrip + "','" + subtotal + "','" + id_venta.Text + "')";

            Coman = inserta.construye_command(query);
            inserta.ejecutanonquery();
            Coman.Connection.Close();
            inserta.desconectar();
        }
Ejemplo n.º 4
0
        public void insertaCliente(TextBox Nom, TextBox App, TextBox Apm, TextBox tel, TextBox rfc, TextBox direc)
        {
            MySqlCommand Coman;

            conec.datos inserta = new conec.datos();
            inserta.Conectar();

            String query = "INSERT INTO `eliarome35436DB`.`Cliente` (`Name_c`, `App_c`, `Apm_c`, `Tel`, `RFC`, `Direccion`) VALUES ('" + Nom.Text + "','" + App.Text + "','" + Apm.Text + "','" + tel.Text + "','" +
                           rfc.Text + "','" + direc.Text + "')";

            Coman = inserta.construye_command(query);
            inserta.ejecutanonquery();
            Coman.Connection.Close();
            inserta.desconectar();
        }
Ejemplo n.º 5
0
        public void insertaVenta(TextBox id_ven, Label subtot, Label total, Label id_vende, Label id_clien, DateTimePicker dat)
        {
            string       fech = dat.Value.Year.ToString() + "-" + dat.Value.Month.ToString() + "-" + dat.Value.Day.ToString();
            MySqlCommand Coman;

            conec.datos inserta = new conec.datos();
            inserta.Conectar();

            String query = "INSERT INTO `eliarome35436DB`.`Venta` (`id_venta`, `subtotal`, `total`, `id_Vendedor`, `Id_Cliente`, `fecha`) VALUES ('" + id_ven.Text + "','" + subtot.Text + "','" + total.Text + "','" + id_vende.Text + "','" + id_clien.Text + "','" + fech + "')";

            Coman = inserta.construye_command(query);
            inserta.ejecutanonquery();
            Coman.Connection.Close();
            inserta.desconectar();
        }
Ejemplo n.º 6
0
        public void insertaEsferas(TextBox pintu, TextBox carto, TextBox ganch, TextBox color, TextBox tamaño)
        {
            MySqlCommand Coman;

            conec.datos inserta = new conec.datos();
            inserta.Conectar();
            double pi     = Convert.ToDouble(pintu.Text);
            double car    = Convert.ToDouble(carto.Text);
            double ganc   = Convert.ToDouble(ganch.Text);
            double costo  = 0;
            double costo2 = 0;
            int    cant   = 0;

            int tam = int.Parse(tamaño.Text);

            if (tam == 3)
            {
                costo = (pi / 300 + car / 300 + ganc / 700);
                cant  = 300;
            }
            else
            if (tam == 5)
            {
                costo = (pi / 265 + car / 265 + ganc / 700);
                cant  = 265;
            }
            if (tam == 3)
            {
                costo2 = (pi / 300 + ganc / 700);
                cant   = 300;
            }
            else
            if (tam == 5)
            {
                costo2 = (pi / 265 + ganc / 700);
                cant   = 265;
            }

            String query = "INSERT INTO `eliarome35436DB`.`Esfera` (`costo_esf`, `color`, `tam`, `disponibilidad`, `Precio_en_caja`) VALUES ('" + costo2 + "','" + color.Text + "','" + tamaño.Text + "' , '" + cant + "','" + costo + "')";

            Coman = inserta.construye_command(query);
            inserta.ejecutanonquery();
            Coman.Connection.Close();
            inserta.desconectar();
        }