private void UpdateContractButton_Click(object sender, EventArgs e) { if (ClientContractDataGrid.SelectedRows.Count == 1) { PhantomForm PhantomForm = new PhantomForm(); PhantomForm.Show(); AddContractForm AddContractForm = new AddContractForm(ClientContractDataGrid.SelectedRows[0].Cells["ClientID"].Value.ToString(), ref ClientPayments, ref TableCurrency, ref TableClients, ref TopForm, ClientContractDataGrid.SelectedRows[0].Cells["ContractNumber"].Value.ToString(), ClientContractDataGrid.SelectedRows[0].Cells["Cost"].Value.ToString(), ClientContractDataGrid.SelectedRows[0].Cells["CurrencyTypeID"].Value.ToString(), Convert.ToDateTime(ClientContractDataGrid.SelectedRows[0].Cells["StartDateContract"].Value), Convert.ToDateTime(ClientContractDataGrid.SelectedRows[0].Cells["EndDateContract"].Value.ToString()), ClientContractDataGrid.SelectedRows[0].Cells["ContractId"].Value.ToString(), ref TableFactory, ClientContractDataGrid.SelectedRows[0].Cells["FactoryID"].Value.ToString()); TopForm = AddContractForm; AddContractForm.ShowDialog(); PhantomForm.Close(); PhantomForm.Dispose(); TopForm = null; ClientPayments.Record(); } }
private void AddContractButton_Click(object sender, EventArgs e) { PhantomForm PhantomForm = new PhantomForm(); PhantomForm.Show(); AddContractForm AddContractForm = new AddContractForm(ClientComboBox.SelectedValue.ToString(), ref ClientPayments, ref TableCurrency, ref TableClients, ref TopForm, ref TableFactory); TopForm = AddContractForm; AddContractForm.ShowDialog(); PhantomForm.Close(); PhantomForm.Dispose(); TopForm = null; if (ClientContractCheckBox.Checked) { UpdateLabelContracts(); } }