private void BindVenue(int i) { using (WACDataClassesDataContext wDataContext = new WACDataClassesDataContext()) { var a = from b in wDataContext.eventVenues.Where(w => w.pk_eventVenue == i) select b; fvVenue.DataKeyNames = new string[] { "pk_eventVenue" }; fvVenue.DataSource = a; fvVenue.DataBind(); if (fvVenue.CurrentMode == FormViewMode.ReadOnly && a.Count() == 1) { WACGlobal_Methods.PopulateControl_DatabaseLists_ParticipantType_ByParticipantTypeCollection_DDL(fvVenue, "ddlVenue_EventVenueType_Add", new string[] { "M", "F", "A", "E" }, ""); } if (fvVenue.CurrentMode == FormViewMode.Insert) { WACGlobal_Methods.PopulateControl_Communication_AreaCodes_DDL(fvVenue.FindControl("UC_Communication_EditInsert_Phone").FindControl("ddlAreaCode") as DropDownList, null); WACGlobal_Methods.PopulateControl_Communication_AreaCodes_DDL(fvVenue.FindControl("UC_Communication_EditInsert_Fax").FindControl("ddlAreaCode") as DropDownList, null); } if (fvVenue.CurrentMode == FormViewMode.Edit) { if (a.Single().communication1 != null) { WACGlobal_Methods.PopulateControl_Communication_AreaCodes_DDL(fvVenue.FindControl("UC_Communication_EditInsert_Phone").FindControl("ddlAreaCode") as DropDownList, a.Single().communication1.areacode); WACGlobal_Methods.PopulateControl_Communication_PhoneNumbersByAreaCode_DDL(fvVenue.FindControl("UC_Communication_EditInsert_Phone").FindControl("ddlNumber") as DropDownList, a.Single().fk_communication_phone, a.Single().communication1.areacode); } else { WACGlobal_Methods.PopulateControl_Communication_AreaCodes_DDL(fvVenue.FindControl("UC_Communication_EditInsert_Phone").FindControl("ddlAreaCode") as DropDownList, null); } if (a.Single().communication != null) { WACGlobal_Methods.PopulateControl_Communication_AreaCodes_DDL(fvVenue.FindControl("UC_Communication_EditInsert_Fax").FindControl("ddlAreaCode") as DropDownList, a.Single().communication.areacode); WACGlobal_Methods.PopulateControl_Communication_PhoneNumbersByAreaCode_DDL(fvVenue.FindControl("UC_Communication_EditInsert_Fax").FindControl("ddlNumber") as DropDownList, a.Single().fk_communication_fax, a.Single().communication.areacode); } else { WACGlobal_Methods.PopulateControl_Communication_AreaCodes_DDL(fvVenue.FindControl("UC_Communication_EditInsert_Fax").FindControl("ddlAreaCode") as DropDownList, null); } WACGlobal_Methods.PopulateControl_Property_EditInsert_UserControl(fvVenue.FindControl("UC_Property_EditInsert1") as UserControl, a.Single().property); } } }
private void PopulateDLL4PhoneNumberAreaCode() { WACGlobal_Methods.PopulateControl_Communication_AreaCodes_DDL(ddlCommunication_Search_PhoneNumber_AreaCode, null); }