private void dgListado_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { //Formularios Formularios.Proveedores.frmControlDeProveedores oFrmProveedor = new frmControlDeProveedores(); App_Code.Proveedores.CuentasBancariasProveedores oCuenta = new App_Code.Proveedores.CuentasBancariasProveedores(); panterasoftware.Formularios.frmPrincipal oPrincipal = new frmPrincipal(); //valores a insertar oCuenta.ProveedorId = int.Parse(this.lblProveedor.Text); oCuenta.CuentaBancariaId = int.Parse(this.dgListado.Rows[int.Parse(e.RowIndex.ToString())].Cells[0].Value.ToString()); oCuenta.Creado = DateTime.Parse(DateTime.Now.ToString("dd/MM/yyyy hh:mm tt")); oCuenta.UserLogId = panterasoftware.Formularios.frmPrincipal.id_usuario; oCuenta.Insertar(); oFrmProveedor.Presentar(int.Parse(this.lblProveedor.Text)); oFrmProveedor.ConsultaCuentasBancarias(); oFrmProveedor.Refresh(); MessageBox.Show(oCuenta.Msg, "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Consulta(); } catch (Exception) { } }
private void btnEliminarCuenta_Click(object sender, EventArgs e) { App_Code.Proveedores.CuentasBancariasProveedores oCuentaProveedor = new App_Code.Proveedores.CuentasBancariasProveedores(int.Parse(this.lblCuentas.Text.ToString())); if (MessageBox.Show("Esta seguro de Borrar este Registro", "Atencion", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { oCuentaProveedor.Eliminar(); this.ConsultaCuentasBancarias(); } }