Esempio n. 1
0
        private void btnagre_Click(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            oper.consultasinreaultado("insert into cliente(nombre,telefono,direccion)values('" + txtnomb.Text + "','" + txttel.Text + "','" + txtdirec.Text + "')");
            MessageBox.Show("Cliente Guardado");
        }
Esempio n. 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            operaciones oper     = new operaciones();
            DataTable   dgvdatos = oper.cosnsultaconresultado("select * from producto");
            DataTable   dc       = oper.cosnsultaconresultado("select * from cliente");
            DataTable   dt       = oper.cosnsultaconresultado("select * from factura");

            foreach (DataRow dr in dgvdatos.Rows)
            {
                string prod;
                prod = dr["descripcion"].ToString();
                cmbproducto.Items.Add(prod);
            }

            foreach (DataRow dr in dc.Rows)
            {
                string cliet;
                cliet = dr["nombre"].ToString();
                cmbcliente.Items.Add(cliet);
            }


            foreach (DataRow dr in dt.Rows)
            {
                string fac;
                fac = dr["id_fac"].ToString();
                cmbfac.Items.Add(fac);
            }
        }
Esempio n. 3
0
        private void btnact_Click(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            oper.consultasinreaultado("update  producto set descripcion = '" + txtprod.Text + "', precio = '" + txtpreci.Text + "' where id_pr = '" + txtid.Text + "'");
            MessageBox.Show("Datos Actualisados");
            dgvactu.DataSource = oper.cosnsultaconresultado("select * from producto");
        }
Esempio n. 4
0
        private void btnact_Click(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            oper.consultasinreaultado("update  producto set nombre = '" + txtnnom.Text + "', telefono = '" + txttel.Text + "', direccion = '" + txtdirec.Text + "' where id_pr = '" + txtid.Text + "'");
            MessageBox.Show("Datos Actualisados");
            dgvclie.DataSource = oper.cosnsultaconresultado("select * from producto");
        }
Esempio n. 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            oper.consultasinreaultado("update  cotizacion set cantidad = '" + txtcan.Text + "', cliente_id_clie = '" + txtidclien.Text + "' where id_pr = '" + txtid.Text + "'");
            MessageBox.Show("Datos Actualisados");
            dgvcot.DataSource = oper.cosnsultaconresultado("select * from cotizacion");
        }
Esempio n. 6
0
        private void btnagre_Click(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            oper.consultasinreaultado("insert into cotizacion(descrip,cantidad,precio,cliente_id_clie,factura_id_fac)values('" + cmbproducto.Text + "','" + txtcantidad.Text + "','" + txtprecio.Text + "','" + txtid.Text + "','" + txtfactn.Text + "')");

            dgvcoti.DataSource = oper.cosnsultaconresultado("select descrip as Descripcion,cantidad as Cantidad,precio as Precio,(cantidad*precio) as Importe,cliente_id_clie as Cliente,factura_id_fac as Factura  from cotizacion where factura_id_fac = '" + txtfactn.Text + "' ");
        }
Esempio n. 7
0
        private void btnagre_Click(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            oper.consultasinreaultado("insert into producto(descripcion,precio)values('" + txtdecrip.Text + "','" + txtprecio.Text + "')");
            MessageBox.Show("Datos Guardados");
            txtprecio.Text = "";
            txtdecrip.Text = "";
        }
Esempio n. 8
0
        private void cmbproducto_SelectedIndexChanged(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();
            DataTable   dt   = oper.cosnsultaconresultado("select * from producto where descripcion ='" + cmbproducto.Text + "'");

            foreach (DataRow dr in dt.Rows)
            {
                string prec;
                prec           = dr["precio"].ToString();
                txtprecio.Text = prec;
            }
        }
Esempio n. 9
0
        private void cmbcliente_SelectedIndexChanged(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();
            DataTable   dt   = oper.cosnsultaconresultado("select * from cliente where nombre ='" + cmbcliente.Text + "'");

            foreach (DataRow dr in dt.Rows)
            {
                string tel, direc, id;
                tel            = dr["telefono"].ToString();
                direc          = dr["direccion"].ToString();
                txttel.Text    = tel;
                txtdirecc.Text = direc;
                id             = dr["id_clie"].ToString();
                txtid.Text     = id;
            }
        }
Esempio n. 10
0
        private void btnborr_Click(object sender, EventArgs e)
        {
            DialogResult result
                = MessageBox.Show("Seguro que desea borrar?", "Borrar", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                operaciones oper = new operaciones();
                oper.consultasinreaultado("delete from producto where id_pr = '" + txtid.Text + "'");
                dgvactu.DataSource = oper.cosnsultaconresultado("select * from producto");
                MessageBox.Show("Datos borrados");
                txtid.Text    = "";
                txtpreci.Text = "";
                txtprod.Text  = "";
            }
        }
Esempio n. 11
0
        private void btnimpri_Click(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();
            DataSet     ds   = new DataSet();
            DataSet     ds2  = new DataSet();
            DataTable   dt   = oper.cosnsultaconresultado("select descrip as Descripcion,cantidad as Cantidad,precio as Precio,(cantidad*precio) as Importe,cliente_id_clie as Cliente,factura_id_fac as Factura, nombre as Nombre,telefono as Telefono  from cotizacion inner join cliente on cliente_id_clie = id_clie  where factura_id_fac = '" + txtfactn.Text + "' ");
            DataTable   dt2  = oper.cosnsultaconresultado("select sum(cantidad*precio) as Total from cotizacion where factura_id_fac = '" + txtfactn.Text + "' ");

            ds.Tables.Add(dt);
            ds2.Tables.Add(dt2);
            ds.WriteXml(@"C:\factura\Factura.xml");
            ds2.WriteXml(@"C:\factura\suma.xml");
            oper.consultasinreaultado("insert into factura(id_fac,fecha)values('" + txtfactn.Text + "','" + dtpfac.Text + "')");
            vso f = new vso();

            f.Show();
        }
Esempio n. 12
0
        private void verpod_Load(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            dataGridView1.DataSource = oper.cosnsultaconresultado("select * from producto");
        }
Esempio n. 13
0
        private void txtbusc_TextChanged(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            dgvcot.DataSource = oper.cosnsultaconresultado("select * from cotizacion where factura_id_fac like '%" + txtbusc.Text + "%' ");
        }
Esempio n. 14
0
        private void actcoti_Load(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            dgvcot.DataSource = oper.cosnsultaconresultado("select * from cotizacion");
        }
Esempio n. 15
0
        private void factu_Load(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            dataGridView1.DataSource = oper.cosnsultaconresultado("select * from factura");
        }
Esempio n. 16
0
        private void vercliente_Load(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            dgvclien.DataSource = oper.cosnsultaconresultado("select id_clie as ID,nombre as Nombre,telefono as Telefono,direccion as Direccion from cliente");
        }
Esempio n. 17
0
        private void txtfactn_TextChanged(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            dgvcoti.DataSource = oper.cosnsultaconresultado("select descrip as Descripcion,cantidad as Cantidad,precio as Precio,(cantidad*precio) as Importe,cliente_id_clie as Cliente,factura_id_fac as Factura, nombre as Nombre,telefono as Telefono  from cotizacion inner join cliente on cliente_id_clie = id_clie  where factura_id_fac like '%" + txtfactn.Text + "%' ");
        }
Esempio n. 18
0
        private void actualizarp_Load(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            dgvactu.DataSource = oper.cosnsultaconresultado("select * from producto");
        }
Esempio n. 19
0
        private void txtbusc_TextChanged(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            dgvclie.DataSource = oper.cosnsultaconresultado("select * from cliente where descripcion like'%" + txtbusc.Text + "%'");
        }
Esempio n. 20
0
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            dgvactu.DataSource = oper.cosnsultaconresultado("select * from producto where descripcion like'%" + txtbucar.Text + "%'");
        }
Esempio n. 21
0
        private void cmbfac_SelectedIndexChanged(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            dgvcoti.DataSource = oper.cosnsultaconresultado("select descrip as Descripcion,cantidad as Cantidad,precio as Precio,(cantidad*precio) as Importe,factura_id_fac as Factura, nombre as Nombre,tel as Telefono  from cotizacion   where factura_id_fac like '%" + cmbfac.Text + "%' ");
        }