public void Client_Contract_Button_Click(object sender, EventArgs e) { String id = _client.GetContract(); if ((id == null) || id == "") { NewContract(); _contractForm = new AddEditContractForm(this, false, userID, _contract.FindID()); _contractForm.ClientLinked(_clientForm.GetName()); _contract.SetClient(_client.FindID()); _contractForm.ShowDialog(); if (MClientContract.GetDT(_contract.FindID(), "Client_Contract", "client_contract_id").Rows.Count > 0) { MClient.SetContract(_client.FindID(), _contract.FindID()); _client.changeContract(_contract.FindID()); // _clientForm.SetContractButton(MClientContract.GetName(_contract.FindID())); } } else { OldContract(id); _contractForm = new AddEditContractForm(this, false, userID, id); _contractForm.ClientLinked(_clientForm.GetName()); _contractForm.SetFields(_contract.Get(), userID); Populate_AddrGridView(id); _contractForm.Activate(); _contractForm.ShowDialog(); } }
public void Edit_Contract_Populate(object sender, EventArgs e) { String contractID = _contractForm.GetSelectedContract(); if ((contractID == null) || (contractID == "0") || (contractID == "")) { return; } OldContract(contractID); String[] contractFields = _contract.Get(); _contractForm.SetFields(contractFields, userID); _contractForm.SetID(contractID); Populate_AddrGridView(contractID); _contractForm.noChanges = true; }
public void Client_Contract_Button_Click(object sender, EventArgs e) { String id = _client.GetContract(); if ((id == null)|| id == "") { NewContract(); _contractForm = new AddEditContractForm(this, false, userID, _contract.FindID()); _contractForm.ClientLinked(_clientForm.GetName()); _contract.SetClient(_client.FindID()); _contractForm.ShowDialog(); if (MClientContract.GetDT(_contract.FindID(), "Client_Contract", "client_contract_id").Rows.Count > 0) { MClient.SetContract(_client.FindID(), _contract.FindID()); _client.changeContract(_contract.FindID()); // _clientForm.SetContractButton(MClientContract.GetName(_contract.FindID())); } } else { OldContract(id); _contractForm = new AddEditContractForm(this, false, userID, id); _contractForm.ClientLinked(_clientForm.GetName()); _contractForm.SetFields(_contract.Get(),userID); Populate_AddrGridView(id); _contractForm.Activate(); _contractForm.ShowDialog(); } }