private void BtnAdd_Click(object sender, EventArgs e) { InvoiceRowForm ivf = new InvoiceRowForm(0, this, 0); ivf.GetInitialValue(); FormState.PreviousPage = this; ivf.Show(); this.Hide(); }
private void BtnEdit_Click(object sender, EventArgs e) { if (dataGridViewInvoice.Rows.Count != 0) { int i = dataGridViewInvoice.SelectedCells[0].RowIndex; int selectedInvoiceId = Convert.ToInt32(dataGridViewInvoice.Rows[i].Cells[0].Value.ToString()); DateTime date = Convert.ToDateTime(dataGridViewInvoice.Rows[i].Cells[2].Value.ToString()); InvoiceRowForm iv = new InvoiceRowForm(selectedInvoiceId, this, 1); iv.InvoicePopulateForm(date); iv.GetInitialValue(); FormState.PreviousPage = this; iv.Show(); this.Hide(); } else { MessageBox.Show("Nu exista nicio factura pentru editare", "Atentie", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } }