public bool WebJobProcess(string webJobStatus)
        {
            MetaDataToCloud _publishMetaDataToCloud = new MetaDataToCloud();

            if (_publishMetaDataToCloud.StartAndStopWebJob(webJobStatus))
            {
                return(true);
            }
            return(false);
        }
        public void EpiCloudOperation()
        {
            MetaDataToCloud _publishMetaDataToCloud = new MetaDataToCloud();

            //_publishMetaDataToCloud.StartAndStopWebJob(Constant.WebJob.Stop);
            //Update the Blob
            if (_publishMetaDataToCloud.UploadBlob())
            {
                //Clear the Cache
                if (_publishMetaDataToCloud.ClearCache())
                {
                    //Start Web Job
                    _publishMetaDataToCloud.StartAndStopWebJob(Constant.WebJob.Start);
                }
            }
        }
        public void PublishRepublishTest()
        {
            MetaDataToCloud _publishMetaDataToCloud = new MetaDataToCloud();

            //Stop WebJob
            if (WebJobProcess(Constant.WebJob.Stop))
            {
                //Update the blob
                //Clear the Cache
                if (_publishMetaDataToCloud.ClearCache())
                {
                    //Start Web Job
                    var webJobResponse = _publishMetaDataToCloud.StartAndStopWebJob(Constant.WebJob.Start);
                    Assert.IsTrue(webJobResponse);
                }
            }
        }
        /// <summary>
        /// Publish MetaData to Cloud
        /// </summary>
        /// <param name="pRequestMessage"></param>
        /// <returns></returns>
        public PublishResponse MetaDataToCloud(PublishRequest pRequest)
        {
            bool            pCloud = true;
            MetaDataToCloud _publishMetaDataToCloud = new MetaDataToCloud();

            try
            {
                //pRequest.RequestId = "2";
                PublishResponse result = new PublishResponse(pRequest.RequestId);

                if (pCloud)
                {
                    //Stop Web Job
                    if (_publishMetaDataToCloud.StartAndStopWebJob(Constant.WebJob.Stop))
                    {
                        //Update SurveyMetaData table in Cloud
                        Epi.Web.Enter.Interfaces.DataInterfaces.ISurveyInfoDao   SurveyInfoDao   = new EFwcf.EntitySurveyInfoDao();
                        Epi.Web.Enter.Interfaces.DataInterfaces.IOrganizationDao OrganizationDao = new EFwcf.EntityOrganizationDao();
                        Epi.Web.BLL.Publisher Implementation        = new Epi.Web.BLL.Publisher(SurveyInfoDao, OrganizationDao);
                        SurveyInfoBO          surveyInfoBO          = Mapper.ToBusinessObject(pRequest.SurveyInfo);
                        SurveyRequestResultBO surveyRequestResultBO = Implementation.PublishSurvey(surveyInfoBO);
                        result.PublishInfo = Mapper.ToDataTransferObject(surveyRequestResultBO);
                        EpiCloudOperation();
                    }
                }
                else
                {
                }
                return(result);
            }
            catch (Exception ex)
            {
                CustomFaultException customFaultException = new CustomFaultException();
                customFaultException.CustomMessage = ex.Message;
                customFaultException.Source        = ex.Source;
                customFaultException.StackTrace    = ex.StackTrace;
                customFaultException.HelpLink      = ex.HelpLink;
                throw new FaultException <CustomFaultException>(customFaultException);
            }
        }