private void Participant_Communication_BindRecord(int i) { using (WACDataClassesDataContext wac = new WACDataClassesDataContext()) { var a = wac.participantCommunications.Where(w => w.pk_participantCommunication == i).Select(s => s); fvParticipant_Communication.DataKeyNames = new string[] { "pk_participantCommunication" }; fvParticipant_Communication.DataSource = a; fvParticipant_Communication.DataBind(); if (fvParticipant_Communication.CurrentMode == FormViewMode.Insert) { WACGlobal_Methods.PopulateControl_DatabaseLists_CommunicationType_DDL(fvParticipant_Communication, "ddlType", null); //WACGlobal_Methods.PopulateControl_Communication_AreaCodes_DDL(fvParticipant_Communication.FindControl("UC_Communication_EditInsert_Phone").FindControl("ddlAreaCode") as DropDownList, null); } if (fvParticipant_Communication.CurrentMode == FormViewMode.Edit) { WACGlobal_Methods.PopulateControl_DatabaseLists_CommunicationType_DDL(fvParticipant_Communication, "ddlType", a.Single().fk_communicationType_code); WACGlobal_Methods.PopulateControl_DatabaseLists_CommunicationUsage_DDL(fvParticipant_Communication, "ddlUsage", a.Single().fk_communicationUsage_code, a.Single().fk_communicationType_code); //if (a.Single().communication != null) //{ // WACGlobal_Methods.PopulateControl_Communication_AreaCodes_DDL(fvParticipant_Communication.FindControl("UC_Communication_EditInsert_Phone").FindControl("ddlAreaCode") as DropDownList, a.Single().communication.areacode); // WACGlobal_Methods.PopulateControl_Communication_PhoneNumbersByAreaCode_DDL(fvParticipant_Communication.FindControl("UC_Communication_EditInsert_Phone").FindControl("ddlNumber") as DropDownList, a.Single().fk_communication, a.Single().communication.areacode); //} //else WACGlobal_Methods.PopulateControl_Communication_AreaCodes_DDL(fvParticipant_Communication.FindControl("UC_Communication_EditInsert_Phone").FindControl("ddlAreaCode") as DropDownList, null); } } }
private void PopulateDDLs() { WACGlobal_Methods.PopulateControl_DatabaseLists_Prefix_DDL(fvParticipantCreate, "ddlPrefix", null); WACGlobal_Methods.PopulateControl_DatabaseLists_Suffix_DDL(fvParticipantCreate.FindControl("ddlSuffix") as DropDownList, null, true); //PopulateDDLOrganization(); WACGlobal_Methods.PopulateControl_DatabaseLists_AddressType_DDL(fvParticipantCreate.FindControl("ddlAddressType") as DropDownList, null, true); WACGlobal_Methods.PopulateControl_DatabaseLists_USPS_Abbr_DDL(fvParticipantCreate, "ddlUSPSAbbr", null, true); WACGlobal_Methods.PopulateControl_DatabaseLists_CommunicationType_DDL(fvParticipantCreate, "ddlCommunicationType", null); WACGlobal_Methods.PopulateControl_DatabaseLists_CommunicationUsage_DDL(fvParticipantCreate, "ddlCommunicationUsage", null, null); WACGlobal_Methods.PopulateControl_DatabaseLists_ParticipantType_DDL(fvParticipantCreate.FindControl("ddlParticipantType") as DropDownList, null, true); WACGlobal_Methods.PopulateControl_DatabaseLists_RegionWAC_DDL(fvParticipantCreate, "ddlWACRegion", null); }