/// <summary> /// Populate associated organizations based on Contact Id /// </summary> private void PopulateOrgRptr() { // Get DataSource for Organization Display List as well as Organization Grid ProjectManagementDa projDA = new ProjectManagementDa(); DataTable displayTable = projDA.GetAllOrgsByContactId(contactId); // Get a list of unassociated organizations to determine how many blank rows // as well as bind CaisisSelects DataView view = projDA.GetAllUnassociatedOrgsByContact(contactId).DefaultView; OrgGrid2.BlankRows = view.Count; OrgGrid2.DataSource = displayTable; OrgGrid2.DataBind(); // Bind View OrgViewList.DataSource = displayTable; OrgViewList.DataBind(); // bind contact's documents DataView contactDocs = ContactRegulatoryDetail.GetByFieldsAsDataView <ContactRegulatoryDetail>(new Dictionary <string, object> { { ContactRegulatoryDetail.ContactId, contactId } }); ContactDocumentsGrid.DataSource = contactDocs; ContactDocumentsGrid.DataBind(); }
protected void SaveClick(object sender, CommandEventArgs e) { Contact contacts = new Contact(); bool isNew = true; if (contactId != -1) { isNew = false; contacts.Get(contactId); } CICHelper.SetBOValues(EditPanel.Controls, contacts, 0); int nOrgContactId = contactId; contacts.Save(); // Get the new contactId from the DB contactId = Int32.Parse(contacts[Contact.ContactId].ToString()); ContactIdField.Value = contacts[Contact.ContactId].ToString(); // Save ProjectOrg ProjContacts // ProjectOrg_ProjectCon needs 2 keys, orgid and contact id // However, orgid will be extracted from dropdown value System.Collections.Generic.Dictionary <string, int> keyList = new System.Collections.Generic.Dictionary <string, int>(); keyList.Add("ContactId", contactId); OrgGrid2.Save(keyList); ContactMethodGridView.Save(contactId); // update contact documents ContactDocumentsGrid.Save(contactId); PopulateGrids(); LoadOrganizationsList(); PopulateContactMethodsGrid(); RefreshMainList(false); SetContentVisibility(); // Check if the new contact needs to be assigned to the current project AddContactToProject(nOrgContactId); }