private void DataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataRow discount1 = this.cliente.findDiscount(Convert.ToInt32(this.DataGridView1.CurrentRow.Cells["id_descuento"].Value)); DarkForm darkForm = new DarkForm(); string discount2 = Convert.ToBoolean(discount1["Porcentage"]) ? Convert.ToDouble(discount1["Descuento"]).ToString("n2") + "%" : Convert.ToDouble(discount1["Descuento"]).ToString("n2"); FormAgregarPrecioCliente agregarPrecioCliente = new FormAgregarPrecioCliente(this.CustomerID, discount1["id_producto"].ToString(), Convert.ToDouble(discount1["Cantidad minima"]), discount2, Convert.ToBoolean(discount1["Venta por Caja"]), Convert.ToInt32(discount1["id_descuento"])); darkForm.Show(); if (agregarPrecioCliente.ShowDialog() == DialogResult.OK) { this.fillGridView(); } darkForm.Close(); }
private void NuevoBtn_Click_1(object sender, EventArgs e) { FormAgregarPrecioCliente agregarPrecioCliente = new FormAgregarPrecioCliente(this.CustomerID); DarkForm darkForm = new DarkForm(); darkForm.Show(); switch (agregarPrecioCliente.ShowDialog()) { case DialogResult.OK: case DialogResult.Yes: this.fillGridView(); break; } darkForm.Close(); }