private void dgvClientes_CellContentClick(object sender, DataGridViewCellEventArgs e) { string nombre = dgvClientes.CurrentRow.Cells[0].Value.ToString(); string apellido = dgvClientes.CurrentRow.Cells[1].Value.ToString(); int idCliente = Int32.Parse(dgvClientes.CurrentRow.Cells["id_cliente"].Value.ToString()); string DNI = dgvClientes.CurrentRow.Cells[2].Value.ToString(); if (MessageBox.Show("¿Desea canjear la oferta para el cliente " + nombre + " " + apellido + " ?", "Atención", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { StoredProcedureParameters param = new StoredProcedureParameters() .AddParameter("@id_proveedor", new RepositorioProveedores().ObtenerIdProveedorDeUsuario(Session.Instance.IdUsuario)) .AddParameter("@id_cliente", idCliente) .AddParameter("@fecha_actual", DateTime.Parse(ConfigurationManager.AppSettings["FechaSistema"])) .AddParameter("@id_compra", idCompra); try { new Conexion().ExecDataTableStoredProcedure(StoredProcedures.CanjearCompra, param); MessageBoxUtil.ShowInfo("Compra canjeada exitosamente"); previousForm.LlenarTablaOfertas(); NavigableFormUtil.BackwardToDifferentWindow(this, previousForm); } catch (Exception ex) { MessageBoxUtil.ShowError(ex.Message); } } }
private void btnAceptar_Click(object sender, EventArgs e) { if (this.ValidarInputs()) { try { new RepositorioTarjetas().Guardar(cmbTipoTarjeta.Text, inputCodigo.Text); previousForm.VolverACargarTarjetas(); NavigableFormUtil.BackwardToDifferentWindow(this, previousForm); } catch (SqlException ex) { MessageBoxUtil.ShowError(ex.Message); } } }
private void btnVolver_Click(object sender, EventArgs e) { NavigableFormUtil.BackwardToDifferentWindow(this, previousForm); }