private void Edit_Clik(object sender, RoutedEventArgs e) { //if (!string.IsNullOrEmpty(EditOtextBox1.Text)) //{ 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); Request.Organization.OrganizationKey = EditOtextBox1.Text; Epi.Web.Enter.Common.Message.OrganizationResponse Result = client.GetOrganizationByKey(Request); if (Result.OrganizationList != null) { for (int i = 0; i < Result.OrganizationList.Count; i++) { this.ONameEditTextBox1.Text = Result.OrganizationList[i].Organization; this.checkBox1.IsChecked = Result.OrganizationList[i].IsEnabled; } } } else { richTextBox1.AppendText("Admin pass is required and Should be a Guid."); } } catch (Exception ex) { richTextBox1.AppendText("Error occurred while trying to get organization Info. "); } //} //else { // richTextBox1.AppendText("Please select organization key."); //} }