private void QueryForExistingSurveyInfo() { SurveyManagerService.ManagerServiceClient client = Epi.Core.ServiceClient.ServiceClient.GetClient(); SurveyManagerService.SurveyInfoRequest Request = new SurveyManagerService.SurveyInfoRequest(); Request.Criteria.SurveyIdList = new string[] { this.view.WebSurveyId }; Request.Criteria.OrganizationKey = new Guid(this.OrganizationKey); SurveyManagerService.SurveyInfoResponse response = client.GetSurveyInfo(Request); if (response.SurveyInfoList.Length > 0) { this.currentSurveyInfoDTO = response.SurveyInfoList[0]; } }
private void UpdateSurveyInfoworker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { try { SurveyManagerService.ManagerServiceV3Client client; Configuration config = Configuration.GetNewInstance(); client = GetClient(); SurveyManagerService.SurveyInfoRequest Request = (SurveyManagerService.SurveyInfoRequest)((object[])e.Argument)[0]; SurveyManagerService.SurveyInfoResponse Result = (SurveyManagerService.SurveyInfoResponse)((object[])e.Argument)[1]; Request.Criteria.ClosingDate =this.CloseDate; Request.Criteria.OrganizationKey = new Guid(this.OrganizationKey); Request.Criteria.UserPublishKey = new Guid(this.UserPublishKey); Request.Criteria.SurveyIdList = new string[]{this.SurveyId}; Request.Action = "Update"; SurveyManagerService.SurveyInfoDTO SurveyInfoDTO = new SurveyManagerService.SurveyInfoDTO(); SurveyInfoDTO.ClosingDate = this.CloseDate; SurveyInfoDTO.StartDate = this.StartDate; SurveyInfoDTO.SurveyId = new Guid(this.SurveyId).ToString(); SurveyInfoDTO.SurveyType = this.SurveyType; SurveyInfoDTO.SurveyNumber = this.SurveyNumber; SurveyInfoDTO.SurveyName = this.SurveyName; // SurveyInfoDTO.OrganizationKey = new Guid(this.OrganizationKey); SurveyInfoDTO.OrganizationKey = new Guid(this.OrgKeytextBox.Text.ToString()); SurveyInfoDTO.UserPublishKey = new Guid(this.SecurityKeytextBox.Text.ToString()); SurveyInfoDTO.OrganizationName = this.OrganizationName; SurveyInfoDTO.XML = this.TemplateXML; SurveyInfoDTO.ExitText = this.ExitText; SurveyInfoDTO.IntroductionText = this.IntroductionText; SurveyInfoDTO.DepartmentName = this.DepartmentName; Request.Criteria.SurveyType = this.SurveyType; if (this.DraftRadioButton.Checked) { Request.Criteria.IsDraftMode = true; SurveyInfoDTO.IsDraftMode = true; } else { Request.Criteria.IsDraftMode = false; SurveyInfoDTO.IsDraftMode = false; } Request.SurveyInfoList = new SurveyManagerService.SurveyInfoDTO[]{SurveyInfoDTO}; Result = client.SetSurveyInfo(Request); } catch (FaultException<CustomFaultException> cfe) { // this.BeginInvoke(new FinishWithCustomFaultExceptionDelegate(FinishWithCustomFaultException), cfe); } catch (FaultException fe) { //this.BeginInvoke(new FinishWithFaultExceptionDelegate(FinishWithFaultException), fe); } catch (SecurityNegotiationException sne) { //this.BeginInvoke(new FinishWithSecurityNegotiationExceptionDelegate(FinishWithSecurityNegotiationException), sne); } catch (CommunicationException ce) { //this.BeginInvoke(new FinishWithCommunicationExceptionDelegate(FinishWithCommunicationException), ce); } catch (TimeoutException te) { // this.BeginInvoke(new FinishWithTimeoutExceptionDelegate(FinishWithTimeoutException), te); } catch (Exception ex) { //this.BeginInvoke(new FinishWithExceptionDelegate(FinishWithException), ex); } }
private void UpdateSurveyInfoworker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { try { SurveyManagerService.ManagerServiceClient client; Configuration config = Configuration.GetNewInstance(); client = Epi.Core.ServiceClient.ServiceClient.GetClient(); SurveyManagerService.SurveyInfoRequest Request = (SurveyManagerService.SurveyInfoRequest)((object[])e.Argument)[0]; SurveyManagerService.SurveyInfoResponse Result = (SurveyManagerService.SurveyInfoResponse)((object[])e.Argument)[1]; Request.Criteria.ClosingDate = this.CloseDate; Request.Criteria.OrganizationKey = new Guid(this.OrganizationKey); Request.Criteria.UserPublishKey = new Guid(this.UserPublishKey); Request.Criteria.SurveyIdList = new string[] { this.SurveyId }; Request.Action = "Update"; SurveyManagerService.SurveyInfoDTO SurveyInfoDTO = new SurveyManagerService.SurveyInfoDTO(); SurveyInfoDTO.ClosingDate = this.CloseDate; SurveyInfoDTO.StartDate = this.StartDate; SurveyInfoDTO.SurveyId = new Guid(this.SurveyId).ToString(); SurveyInfoDTO.SurveyType = this.SurveyType; SurveyInfoDTO.SurveyNumber = this.SurveyNumber; SurveyInfoDTO.SurveyName = this.SurveyName; // SurveyInfoDTO.OrganizationKey = new Guid(this.OrganizationKey); SurveyInfoDTO.OrganizationKey = new Guid(this.OrgKeytextBox.Text.ToString()); SurveyInfoDTO.UserPublishKey = new Guid(this.SecurityKeytextBox.Text.ToString()); SurveyInfoDTO.OrganizationName = this.OrganizationName; SurveyInfoDTO.XML = this.TemplateXML; SurveyInfoDTO.ExitText = this.ExitText; SurveyInfoDTO.IntroductionText = this.IntroductionText; SurveyInfoDTO.DepartmentName = this.DepartmentName; Request.Criteria.SurveyType = this.SurveyType; if (this.DraftRadioButton.Checked) { Request.Criteria.IsDraftMode = true; SurveyInfoDTO.IsDraftMode = true; } else { Request.Criteria.IsDraftMode = false; SurveyInfoDTO.IsDraftMode = false; } Request.SurveyInfoList = new SurveyManagerService.SurveyInfoDTO[] { SurveyInfoDTO }; Result = client.SetSurveyInfo(Request); } catch (FaultException <CustomFaultException> cfe) { // this.BeginInvoke(new FinishWithCustomFaultExceptionDelegate(FinishWithCustomFaultException), cfe); } catch (FaultException fe) { //this.BeginInvoke(new FinishWithFaultExceptionDelegate(FinishWithFaultException), fe); } catch (SecurityNegotiationException sne) { //this.BeginInvoke(new FinishWithSecurityNegotiationExceptionDelegate(FinishWithSecurityNegotiationException), sne); } catch (CommunicationException ce) { //this.BeginInvoke(new FinishWithCommunicationExceptionDelegate(FinishWithCommunicationException), ce); } catch (TimeoutException te) { // this.BeginInvoke(new FinishWithTimeoutExceptionDelegate(FinishWithTimeoutException), te); } catch (Exception ex) { //this.BeginInvoke(new FinishWithExceptionDelegate(FinishWithException), ex); } }
private void WebPublishDialog_Load(object sender, EventArgs e) { if (!this.isRepublishableConfig || string.IsNullOrWhiteSpace(this.view.WebSurveyId)) { TimeSpan t = new TimeSpan(10, 23, 59, 59); dtpSurveyClosingDate.Value = DateTime.Now.Date + t; this.txtSurveyName.SelectAll(); txtSurveyName.Text = SharedStrings.WEBFORM_TITLE; txtSurveyName.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; txtSurveyNameMirror.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; txtSurveyID.Text = SharedStrings.WEBFORM_SURVEYID; txtSurveyID.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; txtSurveyIDMirror.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; txtSurveyIDMirror.Text = SharedStrings.WEBFORM_SURVEYID; txtOrganization.Text = SharedStrings.WEBFORM_ORGANIZATION; txtOrganization.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; txtOrganizationMirror.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; txtOrganizationMirror.Text = SharedStrings.WEBFORM_ORGANIZATION; txtDepartment.Text = SharedStrings.WEBFORM_DEPARTMENT; txtDepartment.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; txtDepartmentMirror.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; txtDepartmentMirror.Text = SharedStrings.WEBFORM_DEPARTMENT; txtIntroductionText.Text = SharedStrings.WEBFORM_INTRODUCTIONTEXT; txtIntroductionText.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; txtExitText.Text = SharedStrings.WEBFORM_EXITTEXT; txtExitText.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; if (!this.isRepublishableConfig) { this.lblSurveyStartDate.Visible = false; this.StartDateDatePicker.Visible = false; this.StartTimecomboBox.Visible = false; this.StartTimelabel.Visible = false; this.OrganizationKeyLinkLabel.Visible = false; this.OrganizationKeyValueLabel.Visible = false; this.WebSurveyOptionsLinkLabel.Visible = false; this.DividerLabel.Visible = false; this.btnPublishForm.Enabled = true; lblPublishModeStatus.Visible = false; label1.Visible = false; lblClosingDate.Left = 18; dtpSurveyClosingDate.Left = 18; // this.ClosingTimecomboBox.Left = 240; // this.closingTimelabel.Left = 240; //ClosingTimecomboBox.SelectedIndex = 0; ClosingTimecomboBox.Visible = false; closingTimelabel.Visible = false; } else { this.txtDepartment.Visible = false; this.lblDepartment.Visible = false; this.txtOrganization.Left = 381; this.txtOrganization.Size = new System.Drawing.Size(453, 23); this.lblOrganization.Left = 300; this.lblDepMirr.Visible = false; this.txtDepartmentMirror.Visible = false; this.txtOrganizationMirror.Left = 381; this.txtOrganizationMirror.Size = new System.Drawing.Size(453, 23); this.lblOrgMirr.Left = 300; ClosingTimecomboBox.SelectedIndex = 0; StartTimecomboBox.SelectedIndex = 0; } } else { SurveyManagerService.ManagerServiceV3Client client = Epi.Core.ServiceClient.ServiceClient.GetClient(); this.txtDepartment.Visible = false; this.lblDepartment.Visible = false; this.txtOrganization.Left = 381; this.txtOrganization.Size = new System.Drawing.Size(453, 23); this.lblOrganization.Left = 300; this.lblDepMirr.Visible = false; this.txtDepartmentMirror.Visible = false; this.txtOrganizationMirror.Left = 381; this.txtOrganizationMirror.Size = new System.Drawing.Size(453, 23); this.lblOrgMirr.Left = 300; ClosingTimecomboBox.SelectedIndex = 0; StartTimecomboBox.SelectedIndex = 0; this.txtOrganizationKey.Text = this.OrganizationKey; SurveyManagerService.SurveyInfoRequest Request = new SurveyManagerService.SurveyInfoRequest(); Request.Criteria = new SurveyManagerService.SurveyInfoCriteria(); Request.Criteria.SurveyType = -1; Request.Criteria.SurveyIdList = new string[]{this.view.WebSurveyId}; Request.Criteria.OrganizationKey = new Guid(this.OrganizationKey); SurveyManagerService.SurveyInfoResponse response = client.GetSurveyInfo(Request); if (response.SurveyInfoList.Length > 0) { currentSurveyInfoDTO = response.SurveyInfoList[0]; if (currentSurveyInfoDTO.IsDraftMode) { this.lblPublishModeStatus.Text = "DRAFT"; } else { this.lblPublishModeStatus.Text = "FINAL"; } dtpSurveyClosingDate.Value = currentSurveyInfoDTO.ClosingDate; StartDateDatePicker.Value = currentSurveyInfoDTO.StartDate; DateTime CloseTime = Convert.ToDateTime(currentSurveyInfoDTO.ClosingDate); DateTime StartTime = Convert.ToDateTime(currentSurveyInfoDTO.StartDate); ClosingTimecomboBox.SelectedItem = CloseTime.ToShortTimeString(); StartTimecomboBox.SelectedItem = StartTime.ToShortTimeString(); txtSurveyName.Text = currentSurveyInfoDTO.SurveyName; //txtSurveyName.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; //txtSurveyNameMirror.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; txtSurveyID.Text = currentSurveyInfoDTO.SurveyNumber; //txtSurveyID.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; //txtSurveyIDMirror.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; txtSurveyIDMirror.Text = currentSurveyInfoDTO.SurveyNumber; txtOrganization.Text = currentSurveyInfoDTO.OrganizationName; //txtOrganization.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; //txtOrganizationMirror.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; txtOrganizationMirror.Text = currentSurveyInfoDTO.OrganizationName; txtDepartment.Text = currentSurveyInfoDTO.DepartmentName; //txtDepartment.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; //txtDepartmentMirror.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; txtDepartmentMirror.Text = currentSurveyInfoDTO.DepartmentName; txtIntroductionText.Text = currentSurveyInfoDTO.IntroductionText; //txtIntroductionText.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; txtExitText.Text = currentSurveyInfoDTO.ExitText; //txtExitText.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; btnPublishForm.Enabled = true; } //} } }
private void QueryForExistingSurveyInfo() { SurveyManagerService.ManagerServiceV3Client client = Epi.Core.ServiceClient.ServiceClient.GetClient(); SurveyManagerService.SurveyInfoRequest Request = new SurveyManagerService.SurveyInfoRequest(); Request.Criteria.SurveyIdList = new string[]{this.view.WebSurveyId}; Request.Criteria.OrganizationKey = new Guid(this.OrganizationKey); SurveyManagerService.SurveyInfoResponse response = client.GetSurveyInfo(Request); if (response.SurveyInfoList.Length > 0) { this.currentSurveyInfoDTO = response.SurveyInfoList[0]; } }
private void UpdateSurveyMode(bool IsDraftMode) { try { SurveyManagerService.ManagerServiceV3Client client = Epi.Core.ServiceClient.ServiceClient.GetClient(); Configuration config = Configuration.GetNewInstance(); SurveyManagerService.SurveyInfoRequest Request = new SurveyManagerService.SurveyInfoRequest();//(Epi.Web.Common.Message.SurveyInfoRequest)((object[])e.Argument)[0]; SurveyManagerService.SurveyInfoResponse Result = new SurveyManagerService.SurveyInfoResponse();//(Epi.Web.Common.Message.SurveyInfoResponse)((object[])e.Argument)[1]; Request.Criteria = new SurveyManagerService.SurveyInfoCriteria(); Request.Criteria.ClosingDate = this.CloseDate; Request.Criteria.OrganizationKey = new Guid(this.OrganizationKey); Request.Criteria.UserPublishKey = new Guid(this.UserPublishKey); Request.Criteria.SurveyIdList = new string[]{this.SurveyId}; SurveyManagerService.SurveyInfoDTO SurveyInfoDTO = new SurveyManagerService.SurveyInfoDTO(); SurveyInfoDTO.ClosingDate = this.CloseDate; SurveyInfoDTO.StartDate = this.StartDate; SurveyInfoDTO.SurveyId = new Guid(this.CurrentView.WebSurveyId).ToString(); SurveyInfoDTO.SurveyType = this.SurveyType; SurveyInfoDTO.SurveyNumber = this.SurveyNumber; SurveyInfoDTO.SurveyName = this.SurveyName; SurveyInfoDTO.OrganizationKey = new Guid(OrganizationKey); SurveyInfoDTO.UserPublishKey = new Guid(this.UserPublishKey); SurveyInfoDTO.OrganizationName = this.OrganizationName; SurveyInfoDTO.XML = this.TemplateXML; SurveyInfoDTO.ExitText = this.ExitText; SurveyInfoDTO.IntroductionText = this.IntroductionText; SurveyInfoDTO.DepartmentName = this.DepartmentName; Request.Criteria.SurveyType = this.SurveyType; if (IsDraftMode) { Request.Action = "Update"; Request.Criteria.IsDraftMode = true; SurveyInfoDTO.IsDraftMode = true; } else { Request.Action = "UpdateMode"; Request.Criteria.IsDraftMode = false; SurveyInfoDTO.IsDraftMode = false; } Request.SurveyInfoList = new SurveyManagerService.SurveyInfoDTO[]{SurveyInfoDTO}; Result = client.SetSurveyInfo(Request); if (Result != null && Result.SurveyInfoList.Length > 0) { //this.UpdateStatus("Survey mode was successfully updated!"); if (IsDraftMode) { MessageBox.Show("Survey mode was successfully changed to DRAFT.", "", MessageBoxButtons.OK); } else { MessageBox.Show("Survey mode was successfully changed to FINAL.", "", MessageBoxButtons.OK); } } } catch { //this.BeginInvoke(new FinishWithExceptionDelegate(FinishWithException), ex); } }
private void QuickSurveyInfoUpdate() { try { Template template = new Template(this.mediator); SurveyManagerService.ManagerServiceV3Client client = Epi.Core.ServiceClient.ServiceClient.GetClient(); Configuration config = Configuration.GetNewInstance(); SurveyManagerService.SurveyInfoRequest Request = new SurveyManagerService.SurveyInfoRequest();//(Epi.Web.Common.Message.SurveyInfoRequest)((object[])e.Argument)[0]; SurveyManagerService.SurveyInfoResponse Result = new SurveyManagerService.SurveyInfoResponse();//(Epi.Web.Common.Message.SurveyInfoResponse)((object[])e.Argument)[1]; Request.Criteria = new SurveyManagerService.SurveyInfoCriteria(); Request.Criteria.ClosingDate = this.CloseDate; Request.Criteria.OrganizationKey = new Guid(this.OrganizationKey); Request.Criteria.UserPublishKey = new Guid(this.UserPublishKey); Request.Criteria.SurveyIdList = new string[]{this.SurveyId}; Request.Action = "Update"; SurveyManagerService.SurveyInfoDTO SurveyInfoDTO = new SurveyManagerService.SurveyInfoDTO(); SurveyInfoDTO.ClosingDate = this.CloseDate; SurveyInfoDTO.StartDate = this.StartDate; SurveyInfoDTO.SurveyId = new Guid(this.CurrentView.WebSurveyId).ToString(); SurveyInfoDTO.SurveyType = this.SurveyType; SurveyInfoDTO.SurveyNumber = this.SurveyNumber; SurveyInfoDTO.SurveyName = this.SurveyName; SurveyInfoDTO.OrganizationKey = new Guid(OrganizationKey); SurveyInfoDTO.OrganizationName = this.OrganizationName; SurveyInfoDTO.UserPublishKey = new Guid(this.UserPublishKey); SurveyInfoDTO.XML = template.CreateWebSurveyTemplate(); SurveyInfoDTO.ExitText = this.ExitText; SurveyInfoDTO.IntroductionText = this.IntroductionText; SurveyInfoDTO.DepartmentName = this.DepartmentName; if (this.mediator.Project.CollectedData.GetDbDriver().ConnectionDescription.ToString().Contains("Microsoft SQL Server:")) { SurveyInfoDTO.IsSqlProject = true; } Request.Criteria.SurveyType = this.SurveyType; Request.Criteria.IsDraftMode = true; SurveyInfoDTO.IsDraftMode = this.IsDraftMode; Request.SurveyInfoList = new SurveyManagerService.SurveyInfoDTO[] { SurveyInfoDTO }; Result = client.SetSurveyInfo(Request); if (Result != null && Result.SurveyInfoList.Length > 0) { //this.UpdateStatus("Survey was successfully updated!"); MessageBox.Show("Survey was successfully updated.","",MessageBoxButtons.OK); } } catch (FaultException<CustomFaultException> cfe) { // this.BeginInvoke(new FinishWithCustomFaultExceptionDelegate(FinishWithCustomFaultException), cfe); } catch (FaultException fe) { //this.BeginInvoke(new FinishWithFaultExceptionDelegate(FinishWithFaultException), fe); } catch (SecurityNegotiationException sne) { //this.BeginInvoke(new FinishWithSecurityNegotiationExceptionDelegate(FinishWithSecurityNegotiationException), sne); } catch (CommunicationException ce) { //this.BeginInvoke(new FinishWithCommunicationExceptionDelegate(FinishWithCommunicationException), ce); } catch (TimeoutException te) { // this.BeginInvoke(new FinishWithTimeoutExceptionDelegate(FinishWithTimeoutException), te); } catch (Exception ex) { //this.BeginInvoke(new FinishWithExceptionDelegate(FinishWithException), ex); } }