コード例 #1
0
        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.ManagerServiceClient client = Epi.Windows.MakeView.Utils.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;

                // Epi.Windows.Dialogs.InputDialog inputDialog = new Windows.Dialogs.InputDialog("Enter organization key", "Organization Key", "", null, EpiInfo.Plugin.DataType.Text);
                //DialogResult result = inputDialog.ShowDialog();

                // if (result == System.Windows.Forms.DialogResult.OK)
                //{
                // this.OrganizationKey = inputDialog.OrganizationKey;
                this.txtOrganizationKey.Text = this.OrganizationKey;

                SurveyInfoRequest Request = new Epi.Web.Common.Message.SurveyInfoRequest();
                Request.Criteria.SurveyIdList.Add(this.view.WebSurveyId);
                Request.Criteria.OrganizationKey = new Guid(this.OrganizationKey);
                SurveyInfoResponse response = client.GetSurveyInfo(Request);
                if (response.SurveyInfoList.Count > 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;
                }
                //}
            }
        }
コード例 #2
0
 private void QueryForExistingSurveyInfo()
 {
     SurveyManagerService.ManagerServiceClient client = Epi.Windows.MakeView.Utils.ServiceClient.GetClient();
         SurveyInfoRequest Request = new Epi.Web.Common.Message.SurveyInfoRequest();
         Request.Criteria.SurveyIdList.Add(this.view.WebSurveyId);
         Request.Criteria.OrganizationKey = new Guid(this.OrganizationKey);
         SurveyInfoResponse response = client.GetSurveyInfo(Request);
         if (response.SurveyInfoList.Count > 0)
         {
             this.currentSurveyInfoDTO = response.SurveyInfoList[0];
         }
 }