public void GetOrganizationNames() { EWEManagerService.EWEManagerServiceClient client = ServiceClient.GetClient(); Epi.Web.Enter.Common.Message.OrganizationRequest Request = new Epi.Web.Enter.Common.Message.OrganizationRequest(); richTextBox1.Document.Blocks.Clear(); try { if (!string.IsNullOrEmpty(passwordBox1.Password.ToString()) && IsGuid(passwordBox1.Password.ToString())) { Request.AdminSecurityKey = new Guid(passwordBox1.Password); // Epi.Web.Enter.Common.Message.OrganizationResponse Result = client.GetOrganizationInfo(Request); Epi.Web.Enter.Common.Message.OrganizationResponse Result = client.GetOrganizationNames(Request); OnamelistBox1.Items.Clear(); if (Result.Message != null) { richTextBox1.AppendText(Result.Message.ToString()); } if (Result.OrganizationList != null) { for (int i = 0; i < Result.OrganizationList.Count; i++) { this.OnamelistBox1.Items.Add(Result.OrganizationList[i].Organization); } this.OnamelistBox1.SelectedIndex = 0; } } else { richTextBox1.AppendText("Admin pass is required and Should be a Guid."); } } catch (Exception ex) { richTextBox1.AppendText("Error occurred while trying to get all organization names. "); } }