private void Btn_Add_Click(object sender, EventArgs e) { AddEditSalesRecord AddRecord = new AddEditSalesRecord(true); AddRecord.FormClosing += new FormClosingEventHandler(SalesRecords_FormClosing); AddRecord.ShowDialog(); // Shows the Add Sakes page }
private void Btn_Edit_Click(object sender, EventArgs e) { DataGridViewRow row = dataGridView_salesRecords.CurrentCell.OwningRow; id = row.Cells["Sales ID"].Value.ToString(); date = row.Cells["Sales Date"].Value.ToString(); tPrice = row.Cells["Sales Total Price"].Value.ToString(); AddEditSalesRecord EditRecord = new AddEditSalesRecord(false, id, date, tPrice); EditRecord.FormClosing += new FormClosingEventHandler(SalesRecords_FormClosing); EditRecord.ShowDialog(); // Shows the Edit sales page }