private void tool_editar_Click(object sender, EventArgs e) { frmEditLocal mpp = new frmEditLocal(); DialogResult resul = new DialogResult(); mpp.MODIFICAR = true; mpp.txtIdLocal.Text = DtgProveedores.CurrentRow.Cells[0].Value.ToString(); mpp.txtdireccion.Text = DtgProveedores.CurrentRow.Cells[1].Value.ToString(); mpp.txtciudad.Text = DtgProveedores.CurrentRow.Cells[2].Value.ToString(); mpp.txtTelefono.Text = DtgProveedores.CurrentRow.Cells[3].Value.ToString(); mpp.txtFax.Text = DtgProveedores.CurrentRow.Cells[4].Value.ToString(); resul = mpp.ShowDialog(); if (mpp.OPTION == "OK") { try { Op.idLocal = int.Parse(mpp.txtIdLocal.Text); Op.direccion = mpp.txtdireccion.Text; Op.ciudad = mpp.txtciudad.Text; Op.telefono = mpp.txtTelefono.Text; Op.fax = mpp.txtFax.Text; Opln.ModificarLocal(Op); mostrarLocal(); } catch (Exception mes) { MessageBox.Show(mes.Message); } } }
private void tool_nuevo_Click(object sender, EventArgs e) { frmEditLocal fp = new frmEditLocal(); DialogResult resul = new DialogResult(); resul = fp.ShowDialog(); if (fp.OPTION == "OK") { try { // Op.IdProveedor = int.Parse(fp.txtId.Text); Op.direccion = fp.txtdireccion.Text; Op.ciudad = fp.txtciudad.Text; Op.telefono = fp.txtTelefono.Text; Op.fax = fp.txtFax.Text; Opln.InsertarLocal(Op); mostrarLocal(); } catch (Exception mes) { MessageBox.Show(mes.Message); } } }