Beispiel #1
0
        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];
            }
        }
Beispiel #2
0
        /// <summary>
        /// Initiates a single form publishing process
        /// </summary>
        private void DoRePublish()
        {
            if (this.UserPublishGuid == null)
            {
                this.UserPublishGuid = new Guid(this.txtPublisherKey.Text);
            }


            if (string.IsNullOrWhiteSpace(this.OrganizationKey))
            {
                this.OrganizationKey = this.txtOrganizationKey.Text;
            }

            this.QueryForExistingSurveyInfo();

            if (this.UserPublishGuid != null)
            {
                SurveyManagerService.SurveyInfoRequest Request = new SurveyManagerService.SurveyInfoRequest();
                Request.Action = "Update";

                this.currentSurveyInfoDTO.XML = template;

                Request.SurveyInfoList = new SurveyManagerService.SurveyInfoDTO[] { this.currentSurveyInfoDTO };
                try
                {
                    Epi.Web.Common.Message.SurveyInfoResponse Result = new Epi.Web.Common.Message.SurveyInfoResponse();

                    //txtStatusSummary.Text = SharedStrings.WEBFORM_SUCCESS;
                    //txtStatusSummary.Text = "Your Form has been republished: " + Result.Message;
                    ////string message = DateTime.Now + ": " + SharedStrings.WEBFORM_SUCCESS + ": " + Result.PublishInfo.URL;
                    //Logger.Log(message);
                    //message = DateTime.Now + ": Survey Key= " + txtSurveyKey.Text;
                    //Logger.Log(message);
                    //message = DateTime.Now + ": Data Key= " + txtDataKey.Text;
                    //Logger.Log(message);
                }
                catch (Exception ex)
                {
                    //txtStatusSummary.AppendText("An error occurred while trying to publish the survey.");
                    //txtStatus.AppendText(ex.ToString());
                    //btnDetails.Visible = true;
                    //this.progressBar.Visible = false;
                    //this.Cursor = Cursors.Default;
                }
            }
        }
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            SurveyManagerService.SurveyInfoRequest Request = new SurveyManagerService.SurveyInfoRequest();
            Request.Action = "Update";

            this.currentSurveyInfoDTO.XML = this.template;
            Request.SurveyInfoList = new SurveyManagerService.SurveyInfoDTO[] { this.currentSurveyInfoDTO };

            try
            {
                Epi.Web.Common.Message.SurveyInfoResponse Result = new Epi.Web.Common.Message.SurveyInfoResponse();

                if (Result.Acknowledge == Web.Common.MessageBase.AcknowledgeType.Success)
                {
                    //txtStatusSummary.Text = SharedStrings.WEBFORM_SUCCESS;
                    lblOutput.Text = "Your Form has been republished: " + Result.Message;
                    ////string message = DateTime.Now + ": " + SharedStrings.WEBFORM_SUCCESS + ": " + Result.PublishInfo.URL;
                    //Logger.Log(message);
                    //message = DateTime.Now + ": Survey Key= " + txtSurveyKey.Text;
                    //Logger.Log(message);
                    //message = DateTime.Now + ": Data Key= " + txtDataKey.Text;
                    //Logger.Log(message);
                }
                else
                {
                    lblOutput.Text = "Your Form has NOT been republished: " + Result.Message;
                }

                //this.progressBar.Visible = false;
                //this.btnPublish.Enabled = true;

            }
            catch (Exception ex)
            {
                lblOutput.Text = lblOutput.Text + "An error occurred while trying to publish the survey.";
                lblOutput.Text = lblOutput.Text + ex.ToString();
                //btnDetails.Visible = true;
                //this.progressBar.Visible = false;
                this.Cursor = Cursors.Default;
            }
        }
Beispiel #4
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            SurveyManagerService.SurveyInfoRequest Request = new SurveyManagerService.SurveyInfoRequest();
            Request.Action = "Update";

            this.currentSurveyInfoDTO.XML = this.template;
            Request.SurveyInfoList        = new SurveyManagerService.SurveyInfoDTO[] { this.currentSurveyInfoDTO };

            try
            {
                Epi.Web.Common.Message.SurveyInfoResponse Result = new Epi.Web.Common.Message.SurveyInfoResponse();

                if (Result.Acknowledge == Web.Common.MessageBase.AcknowledgeType.Success)
                {
                    //txtStatusSummary.Text = SharedStrings.WEBFORM_SUCCESS;
                    lblOutput.Text = "Your Form has been republished: " + Result.Message;
                    ////string message = DateTime.Now + ": " + SharedStrings.WEBFORM_SUCCESS + ": " + Result.PublishInfo.URL;
                    //Logger.Log(message);
                    //message = DateTime.Now + ": Survey Key= " + txtSurveyKey.Text;
                    //Logger.Log(message);
                    //message = DateTime.Now + ": Data Key= " + txtDataKey.Text;
                    //Logger.Log(message);
                }
                else
                {
                    lblOutput.Text = "Your Form has NOT been republished: " + Result.Message;
                }

                //this.progressBar.Visible = false;
                //this.btnPublish.Enabled = true;
            }
            catch (Exception ex)
            {
                lblOutput.Text = lblOutput.Text + "An error occurred while trying to publish the survey.";
                lblOutput.Text = lblOutput.Text + ex.ToString();
                //btnDetails.Visible = true;
                //this.progressBar.Visible = false;
                this.Cursor = Cursors.Default;
            }
        }
Beispiel #5
0
        static public IsValidOrganizationKeyEnum IsValidOrgKey(string pOrganizationKey, string pSurveyId = null)
        {
            try
            {
                SurveyManagerService.ManagerServiceV3Client client = Epi.Core.ServiceClient.ServiceClient.GetClient();
                Configuration config = Configuration.GetNewInstance();

                SurveyManagerService.SurveyInfoRequest request = new SurveyManagerService.SurveyInfoRequest();
                request.Criteria = new SurveyManagerService.SurveyInfoCriteria();
                //tbOrgKey
                if (!string.IsNullOrEmpty(pOrganizationKey))
                {
                    request.Criteria.OrganizationKey = new Guid(pOrganizationKey);
                }

                if (!string.IsNullOrWhiteSpace(pSurveyId))
                {
                    request.Criteria.SurveyIdList = new string[] { pSurveyId };
                }

                if (client.IsValidOrgKey(request))
                {
                    return(IsValidOrganizationKeyEnum.Yes);
                }
                else
                {
                    return(IsValidOrganizationKeyEnum.No);
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException epnf)
            {
                return(IsValidOrganizationKeyEnum.EndPointNotFound);
            }
            catch (Exception ex)
            {
                return(IsValidOrganizationKeyEnum.GeneralException);
            }
        }
Beispiel #6
0
        public static IsValidOrganizationKeyEnum IsValidOrgKey(string pOrganizationKey, string pSurveyId = null)
        {
            try
            {
                SurveyManagerService.ManagerServiceV3Client client = Epi.Core.ServiceClient.ServiceClient.GetClient();
                Configuration config = Configuration.GetNewInstance();

                SurveyManagerService.SurveyInfoRequest request = new SurveyManagerService.SurveyInfoRequest();
                request.Criteria = new SurveyManagerService.SurveyInfoCriteria();
                //tbOrgKey
                if (!string.IsNullOrEmpty(pOrganizationKey))
                {
                    request.Criteria.OrganizationKey = new Guid(pOrganizationKey);
                }

                if (!string.IsNullOrWhiteSpace(pSurveyId))
                {
                    request.Criteria.SurveyIdList = new string[]{pSurveyId};
                }

                if (client.IsValidOrgKey(request))
                {
                    return IsValidOrganizationKeyEnum.Yes;
                }
                else
                {
                    return IsValidOrganizationKeyEnum.No;
                }

            }
            catch (System.ServiceModel.EndpointNotFoundException epnf)
            {
                return IsValidOrganizationKeyEnum.EndPointNotFound;
            }
            catch (Exception ex)
            {
                return IsValidOrganizationKeyEnum.GeneralException;
            }
        }
Beispiel #7
0
        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;
                }
                //}
            }
        }
        /// <summary>
        /// Initiates a single form publishing process
        /// </summary>
        private void DoRePublish()
        {
            if (this.UserPublishGuid == null)
            {
                this.UserPublishGuid = new Guid(this.txtPublisherKey.Text);
            }

            if(string.IsNullOrWhiteSpace(this.OrganizationKey))
            {
                this.OrganizationKey = this.txtOrganizationKey.Text;
            }

            this.QueryForExistingSurveyInfo();

            if (this.UserPublishGuid != null)
            {
                SurveyManagerService.SurveyInfoRequest Request = new SurveyManagerService.SurveyInfoRequest();
                Request.Action = "Update";

                this.currentSurveyInfoDTO.XML = template;

                Request.SurveyInfoList = new SurveyManagerService.SurveyInfoDTO[]{this.currentSurveyInfoDTO};
                try
                {
                    Epi.Web.Common.Message.SurveyInfoResponse Result = new Epi.Web.Common.Message.SurveyInfoResponse();

                    //txtStatusSummary.Text = SharedStrings.WEBFORM_SUCCESS;
                    //txtStatusSummary.Text = "Your Form has been republished: " + Result.Message;
                    ////string message = DateTime.Now + ": " + SharedStrings.WEBFORM_SUCCESS + ": " + Result.PublishInfo.URL;
                    //Logger.Log(message);
                    //message = DateTime.Now + ": Survey Key= " + txtSurveyKey.Text;
                    //Logger.Log(message);
                    //message = DateTime.Now + ": Data Key= " + txtDataKey.Text;
                    //Logger.Log(message);
                }
                catch (Exception ex)
                {
                    //txtStatusSummary.AppendText("An error occurred while trying to publish the survey.");
                    //txtStatus.AppendText(ex.ToString());
                    //btnDetails.Visible = true;
                    //this.progressBar.Visible = false;
                    //this.Cursor = Cursors.Default;
                }
            }
        }
        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];
            }
        }
Beispiel #11
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);

            }
        }
Beispiel #12
0
        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);

            }
        }
Beispiel #13
0
        //  private void GetSurveyInfo (object sender, System.ComponentModel.DoWorkEventArgs e)
        public void SetSurveyInfo()
        {
            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];

                if (!string.IsNullOrWhiteSpace(this.CurrentView.WebSurveyId))
                {
                    Request.Criteria = new SurveyManagerService.SurveyInfoCriteria();
                    Request.Criteria.OrganizationKey =  new Guid(this.OrganizationKey); //new Guid(this.OrganizationKey);
                    Request.Criteria.ReturnSizeInfoOnly = false;
                    Request.Criteria.SurveyIdList = new string[]{this.CurrentView.WebSurveyId};
                    Request.Criteria.SurveyType = -1;

                    Result = client.GetSurveyInfo(Request);

                }

                if (Result != null && Result.SurveyInfoList.Length > 0)
                {

                    SurveyName = Result.SurveyInfoList[0].SurveyName;
                    DepartmentName = Result.SurveyInfoList[0].DepartmentName;
                    SurveyNumber = Result.SurveyInfoList[0].SurveyNumber;
                    OrganizationName = Result.SurveyInfoList[0].OrganizationName;
                    StartDate = Result.SurveyInfoList[0].StartDate;
                    CloseDate = Result.SurveyInfoList[0].ClosingDate;
                    IsDraftMode = Result.SurveyInfoList[0].IsDraftMode;
                    IntroductionText = Result.SurveyInfoList[0].IntroductionText;
                    ExitText = Result.SurveyInfoList[0].ExitText;
                    TemplateXML = Result.SurveyInfoList[0].XML;
                    //this.OrganizationKey = Result.SurveyInfoList[0].OrganizationKey.ToString();
                    SurveyType = Result.SurveyInfoList[0].SurveyType;
                    this.UserPublishKey = Result.SurveyInfoList[0].UserPublishKey.ToString();
                    //SurveyId = Result.SurveyInfoList[0].SurveyId;
                    //ChangeModetoolStripDropDownButton
                    SetModetoolStripDropDown(IsDraftMode);
                }

            }
            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);

            }
        }