private void button1_Click(object sender, EventArgs e) { //tbOrgKey Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum IsValidOKey = Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.No; IsValidOKey = Epi.Core.ServiceClient.EWEServiceClient.IsValidOrgKey(tbOrgKey.Text.ToString(), this._SurveyId); //this.DialogResult = DialogResult.OK; switch (IsValidOKey) { case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.No: pnlError.Visible = true; pnlOrgKey.Visible = true; pnlSuccess.Visible = false; pnlSuccessMsg.Visible = false; break; case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.EndPointNotFound: pnlError.Visible = true; pnlOrgKey.Visible = true; pnlSuccess.Visible = false; pnlSuccessMsg.Visible = false; WebEnterOptions wso = new WebEnterOptions(); wso.Show(); break; case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.GeneralException: pnlError.Visible = true; pnlOrgKey.Visible = true; pnlSuccess.Visible = false; pnlSuccessMsg.Visible = false; break; case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.Yes: this._OrgKey = tbOrgKey.Text.ToString(); pnlError.Visible = false; pnlOrgKey.Visible = false; pnlSuccess.Visible = true; pnlSuccessMsg.Visible = true; this.Text = "Success"; this.DialogPromptLabel.Text = _Dialogprompt; // lblSuccess.Text = " Your survey has been published successfully!"; lblSuccess.Text = this._SuccessMessage; if (!this._ShowSuccessMessage) { this.DialogResult = DialogResult.OK; } break; } }
private void button1_Click(object sender, EventArgs e) { //tbOrgKey Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum IsValidOKey = Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.No; IsValidOKey = Epi.Core.ServiceClient.EWEServiceClient.IsValidOrgKey(tbOrgKey.Text.ToString(), this._SurveyId); //this.DialogResult = DialogResult.OK; switch(IsValidOKey) { case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.No: pnlError.Visible = true; pnlOrgKey.Visible = true; pnlSuccess.Visible = false; pnlSuccessMsg.Visible = false; break; case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.EndPointNotFound: pnlError.Visible = true; pnlOrgKey.Visible = true; pnlSuccess.Visible = false; pnlSuccessMsg.Visible = false; WebEnterOptions wso = new WebEnterOptions(); wso.Show(); break; case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.GeneralException: pnlError.Visible = true; pnlOrgKey.Visible = true; pnlSuccess.Visible = false; pnlSuccessMsg.Visible = false; break; case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.Yes: this._OrgKey = tbOrgKey.Text.ToString(); pnlError.Visible = false; pnlOrgKey.Visible = false; pnlSuccess.Visible = true; pnlSuccessMsg.Visible = true; this.Text = "Success"; this.DialogPromptLabel.Text = _Dialogprompt; // lblSuccess.Text = " Your survey has been published successfully!"; lblSuccess.Text = this._SuccessMessage; if(!this._ShowSuccessMessage) { this.DialogResult = DialogResult.OK; } break; } }
private void toolStripPublishToWebEnter_Click(object sender, EventArgs e) { DataTable table = mediator.Project.Metadata.GetPublishedViewKeys(this.projectExplorer.CurrentView.Id); DataRow ViewRow = table.Rows[0]; // this.OrganizationKey = this.projectExplorer.CurrentView.EWEOrganizationKey; this.EWEOrganizationKey = ViewRow.ItemArray[2].ToString(); if (string.IsNullOrEmpty(EWEOrganizationKey)) if (RepublishOrgKey != null) EWEOrganizationKey = RepublishOrgKey; Template template = new Template(this.mediator); string InvalidForPublishing = ListFieldsNotSupportedForWeb(); View view; if (projectExplorer.CurrentView != null) { view = projectExplorer.CurrentView; } else { view = projectExplorer.SelectedPage.view; } if (InvalidForPublishing.Length > 0) { SupportedFieldTypeDialog dialog = new SupportedFieldTypeDialog(InvalidForPublishing); dialog.ShowDialog(); } else { Configuration config = Configuration.GetNewInstance(); try { if (view.Project.CollectedData.TableExists(view.TableName) == false)//checking if no table is created in Epi7 { CreateViewDataTable(view); } if (ValidateUser() && !iscancel) // Validate User { if (config.Settings.Republish_IsRepbulishable == true) //IsRepbulishable { if (string.IsNullOrWhiteSpace(this.EWEOrganizationKey) && !string.IsNullOrWhiteSpace(view.EWEFormId))//valitate OrgId and FormId { Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum IsValidOKey = Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.No; if (string.IsNullOrWhiteSpace(view.EWEFormId)) { IsValidOKey = Epi.Core.ServiceClient.EWEServiceClient.IsValidOrgKey(this.EWEOrganizationKey); } else { IsValidOKey = Epi.Core.ServiceClient.EWEServiceClient.IsValidOrgKey(this.EWEOrganizationKey, view.EWEFormId); } WebEnterPublishDialog dialog = null; WebEnterOptions wso = null; switch (IsValidOKey) { case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.No: EWEOrgKey NewDialog = new EWEOrgKey(this.CurrentView.EWEFormId, false, "The organization key has been successfully submitted!", "The organization key is required for security purposes before you can republish this survey."); DialogResult result = NewDialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { this.EWEOrganizationKey = NewDialog.OrganizationKey; if (!string.IsNullOrWhiteSpace(EWEOrganizationKey)) { SetFormInfo(); dialog = new WebEnterPublishDialog(this.EWEOrganizationKey, this.mediator, template.CreateWebEnterTemplate()); dialog.ShowDialog(); } } break; case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.EndPointNotFound: WebEnterOptions dialog1 = new WebEnterOptions(); DialogResult result1 = dialog1.ShowDialog(); if (result1 == System.Windows.Forms.DialogResult.OK) { EWEOrgKey OrgKeyDialog = new EWEOrgKey(this.CurrentView.EWEFormId, false, "The organization key has been successfully submitted!", "The organization key is required for security purposes before you can republish this survey."); DialogResult result2 = OrgKeyDialog.ShowDialog(); if (result2 == System.Windows.Forms.DialogResult.OK) { this.EWEOrganizationKey = OrgKeyDialog.OrganizationKey; if (!string.IsNullOrWhiteSpace(EWEOrganizationKey)) { SetFormInfo(); dialog = new WebEnterPublishDialog(this.EWEOrganizationKey, this.mediator, template.CreateWebEnterTemplate()); dialog.ShowDialog(); } } } break; case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.GeneralException: WebEnterOptions dialog2 = new WebEnterOptions(); DialogResult result3 = dialog2.ShowDialog(); if (result3 == System.Windows.Forms.DialogResult.OK) { EWEOrgKey OrgKeyDialog = new EWEOrgKey(this.CurrentView.EWEFormId, false, "The organization key has been successfully submitted!", "The organization key is required for security purposes before you can republish this survey."); DialogResult result4 = OrgKeyDialog.ShowDialog(); if (result4 == System.Windows.Forms.DialogResult.OK) { this.EWEOrganizationKey = OrgKeyDialog.OrganizationKey; if (!string.IsNullOrWhiteSpace(EWEOrganizationKey)) { SetFormInfo(); dialog = new WebEnterPublishDialog(this.EWEOrganizationKey, this.mediator, template.CreateWebEnterTemplate()); dialog.ShowDialog(); } } } break; case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.Yes: SetFormInfo(); dialog = new WebEnterPublishDialog(this.EWEOrganizationKey, this.mediator, template.CreateWebEnterTemplate()); dialog.ShowDialog(); break; } } else //valitate OrgId and FormId { if (!string.IsNullOrEmpty(this.EWEOrganizationKey)) { WebEnterPublishDialog dialog = new WebEnterPublishDialog(this.EWEOrganizationKey, this.mediator, template.CreateWebEnterTemplate()); dialog.ShowDialog(); } else { try { var client = Epi.Core.ServiceClient.EWEServiceClient.GetClient(); EWEManagerService.OrganizationRequest Request = new Epi.EWEManagerService.OrganizationRequest(); //Epi.Web.Common.Message.OrganizationRequest Request = new Epi.Web.Common.Message.OrganizationRequest(); Request.Organization = new EWEManagerService.OrganizationDTO(); var TestService = client.GetOrganization(Request); WebEnterPublishDialog dialog = new WebEnterPublishDialog(null, this.mediator, template.CreateWebEnterTemplate()); DialogResult result = dialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.Cancel) { this.EWEOrganizationKey = dialog.GetOrgKey; } } catch (Exception ex) { WebEnterOptions dialog2 = new WebEnterOptions(); DialogResult result3 = dialog2.ShowDialog(); if (result3 == System.Windows.Forms.DialogResult.OK) { WebEnterPublishDialog dialog = new WebEnterPublishDialog(this.EWEOrganizationKey, this.mediator, template.CreateWebEnterTemplate()); DialogResult result = dialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.Cancel) { this.EWEOrganizationKey = dialog.GetOrgKey; } } } } } } else // IsRepbulishable { try { SurveyManagerService.ManagerServiceV3Client client = Epi.Core.ServiceClient.ServiceClient.GetClient(); SurveyManagerService.OrganizationRequest Request = new SurveyManagerService.OrganizationRequest(); SurveyManagerService.OrganizationDTO orgDTO = new SurveyManagerService.OrganizationDTO(); Request.Organization = orgDTO; var TestService = client.GetOrganization(Request); WebEnterPublishDialog dialog = new WebEnterPublishDialog(null, this.mediator, template.CreateWebEnterTemplate()); DialogResult result = dialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.Cancel) { this.EWEOrganizationKey = dialog.GetOrgKey; } } catch (Exception ex) { if (config.Settings.Republish_IsRepbulishable == true) { WebSurveyOptions dialog2 = new WebSurveyOptions(); DialogResult result3 = dialog2.ShowDialog(); if (result3 == System.Windows.Forms.DialogResult.OK) { WebEnterPublishDialog dialog = new WebEnterPublishDialog(this.EWEOrganizationKey, this.mediator, template.CreateWebEnterTemplate()); DialogResult result = dialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.Cancel) { this.EWEOrganizationKey = dialog.GetOrgKey; } } } else { WebEnterPublishDialog dialog = new WebEnterPublishDialog(null, this.mediator, template.CreateWebEnterTemplate()); dialog.ShowDialog(); } } } } /* else if(!iscancel)// Validate User { int ISWindowAuthMode = config.Settings.EWEServiceAuthMode; if (ISWindowAuthMode == 0) { if (LoginInfo.UserID == -1) { UserAuthentication dialog = new UserAuthentication(); DialogResult result = dialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { dialog.Close(); if (string.IsNullOrEmpty(this.EWEOrganizationKey)) { WebEnterPublishDialog dialog1 = new WebEnterPublishDialog(null, this.mediator, template.CreateWebEnterTemplate()); dialog1.ShowDialog(); } else { WebEnterPublishDialog dialog1 = new WebEnterPublishDialog(this.EWEOrganizationKey, this.mediator, template.CreateWebEnterTemplate()); dialog1.ShowDialog(); } } } else { if (string.IsNullOrEmpty(this.EWEOrganizationKey)) { WebEnterPublishDialog dialog1 = new WebEnterPublishDialog(null, this.mediator, template.CreateWebEnterTemplate()); dialog1.ShowDialog(); } else { WebEnterPublishDialog dialog1 = new WebEnterPublishDialog(this.EWEOrganizationKey, this.mediator, template.CreateWebEnterTemplate()); dialog1.ShowDialog(); } } } else { MessageBox.Show("You are not authorized to publish this form to Epi Web Enter system. Please contact system admin for more info."); } }*/ } catch (Exception ex)// not republishable { WebEnterPublishDialog dialog = new WebEnterPublishDialog(null, this.mediator, template.CreateWebEnterTemplate()); dialog.ShowDialog(); } } this.SetPublishMenuItems(view); }
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { WebEnterOptions wso = new WebEnterOptions(); wso.Show(); }
private void DoUpDateMode(bool IsDraftMode, string OrganizationKey, string WebSurveyId) { try { Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum IsValidOKey = Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.No; if (string.IsNullOrWhiteSpace(WebSurveyId)) { IsValidOKey = Epi.Core.ServiceClient.EWEServiceClient.IsValidOrgKey(OrganizationKey); } else { IsValidOKey = Epi.Core.ServiceClient.EWEServiceClient.IsValidOrgKey(OrganizationKey, WebSurveyId); } WebEnterPublishDialog dialog = null; switch (IsValidOKey) { case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.No: EWEOrgKey NewDialog = new EWEOrgKey(WebSurveyId, false, "The organization key has been successfully submitted!", "The organization key is required for security purposes before you can republish this survey."); DialogResult result = NewDialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { OrganizationKey = NewDialog.OrganizationKey; if (!string.IsNullOrWhiteSpace(OrganizationKey)) { SetFormInfo(); UpdateFormMode(IsDraftMode); } } break; case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.EndPointNotFound: WebEnterOptions dialog1 = new WebEnterOptions(); DialogResult result1 = dialog1.ShowDialog(); if (result1 == System.Windows.Forms.DialogResult.OK) { EWEOrgKey OrgKeyDialog = new EWEOrgKey(WebSurveyId, false, "The organization key has been successfully submitted!", "The organization key is required for security purposes before you can republish this survey."); DialogResult result2 = OrgKeyDialog.ShowDialog(); if (result2 == System.Windows.Forms.DialogResult.OK) { OrganizationKey = OrgKeyDialog.OrganizationKey; if (!string.IsNullOrWhiteSpace(OrganizationKey)) { SetFormInfo(); UpdateFormMode(IsDraftMode); } } } break; case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.GeneralException: WebEnterOptions dialog2 = new WebEnterOptions(); DialogResult result3 = dialog2.ShowDialog(); if (result3 == System.Windows.Forms.DialogResult.OK) { EWEOrgKey OrgKeyDialog = new EWEOrgKey(WebSurveyId, false, "The organization key has been successfully submitted!", "The organization key is required for security purposes before you can republish this survey."); DialogResult result4 = OrgKeyDialog.ShowDialog(); if (result4 == System.Windows.Forms.DialogResult.OK) { OrganizationKey = OrgKeyDialog.OrganizationKey; if (!string.IsNullOrWhiteSpace(OrganizationKey)) { SetFormInfo(); UpdateFormMode(IsDraftMode); } } } break; case Epi.Core.ServiceClient.EWEServiceClient.IsValidOrganizationKeyEnum.Yes: SetFormInfo(); UpdateFormMode(IsDraftMode); break; } } catch (Exception ex)// not republishable { } }