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"); }
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"); }
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 + "' "); }
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"); }
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"); }
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 = ""; }
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 = ""; } }
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(); }