public ActionResult Index(string surveyId, string final) { try { string version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); ViewBag.Version = version; string SurveyMode = ""; SurveyInfoModel surveyInfoModel = GetSurveyInfo(surveyId); System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(@"(\r\n|\r|\n)+"); string exitText = regex.Replace(surveyInfoModel.ExitText.Replace(" ", " "), "<br />"); surveyInfoModel.ExitText = MvcHtmlString.Create(exitText).ToString(); if (surveyInfoModel.IsDraftMode) { surveyInfoModel.IsDraftModeStyleClass = "draft"; } else { surveyInfoModel.IsDraftModeStyleClass = "final"; } bool IsMobileDevice = false; IsMobileDevice = this.Request.Browser.IsMobileDevice; Omniture OmnitureObj = Epi.Web.MVC.Utility.OmnitureHelper.GetSettings(SurveyMode, IsMobileDevice); ViewBag.Omniture = OmnitureObj; return(View(Epi.Web.MVC.Constants.Constant.INDEX_PAGE, surveyInfoModel)); } catch (Exception ex) { Epi.Web.Utility.ExceptionMessage.SendLogMessage(ex, this.HttpContext); return(View(Epi.Web.MVC.Constants.Constant.EXCEPTION_PAGE)); } }
public ActionResult Index(string surveyid, int orgid = -1) { int UserId = SurveyHelper.GetDecryptUserId(Session["UserId"].ToString()); int OrgnizationId; Session["EditForm"] = null; Guid UserId1 = new Guid(); try { string SurveyMode = ""; //SurveyInfoModel surveyInfoModel = GetSurveyInfo(surveyid); // List<FormInfoModel> listOfformInfoModel = GetFormsInfoList(UserId1); FormModel FormModel; GetFormModel(surveyid, UserId, UserId1, out OrgnizationId, out FormModel); if (orgid == -1) { Session["SelectedOrgId"] = OrgnizationId; } else { Session["SelectedOrgId"] = orgid; } System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(@"(\r\n|\r|\n)+"); bool IsMobileDevice = false; IsMobileDevice = this.Request.Browser.IsMobileDevice; if (IsMobileDevice) // Because mobile doesn't need RootFormId until button click. { Session["RootFormId"] = null; Session["PageNumber"] = null; Session["SortOrder"] = null; Session["SortField"] = null; Session["SearchCriteria"] = null; Session["SearchModel"] = null; } Omniture OmnitureObj = Epi.Web.MVC.Utility.OmnitureHelper.GetSettings(SurveyMode, IsMobileDevice); ViewBag.Omniture = OmnitureObj; string version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); ViewBag.Version = version; return(View(Epi.Web.MVC.Constants.Constant.INDEX_PAGE, FormModel)); } catch (Exception ex) { Epi.Web.Utility.ExceptionMessage.SendLogMessage(ex, this.HttpContext); ExceptionModel ExModel = new ExceptionModel(); ExModel.ExceptionDetail = ex.StackTrace; ExModel.Message = ex.Message; return(View(Epi.Web.MVC.Constants.Constant.EXCEPTION_PAGE, ExModel)); } }
public static Omniture GetSettings(string SurveyMode, bool IsMobileDevice) { Omniture OmnitureObj = new Omniture(); string IsEnabled = ConfigurationManager.AppSettings["OMNITURE_IS_ENABLED"]; if (IsEnabled.ToUpper() == "TRUE") { OmnitureObj.IsEnabled = true; OmnitureObj.Level1 = ConfigurationManager.AppSettings["OMNITURE_LEVEL_1"]; OmnitureObj.Level2 = ConfigurationManager.AppSettings["OMNITURE_LEVEL_2"]; OmnitureObj.Level3 = ConfigurationManager.AppSettings["OMNITURE_LEVEL_3"]; OmnitureObj.TopicLevelJs = ConfigurationManager.AppSettings["OMNITURE_TOPIC_LEVEL_JS"]; OmnitureObj.SCodeJs = ConfigurationManager.AppSettings["OMNITURE_S_CODE_JS"]; OmnitureObj.MetricUrl = ConfigurationManager.AppSettings["OMNITURE_METRIC_URL"]; OmnitureObj.ChannelName = ConfigurationManager.AppSettings["OMNITURE_CHANNEL_NAME"]; //if (IsMobileDevice) // { // OmnitureObj.ChannelName = ConfigurationManager.AppSettings["OMNITURE_CHANNEL_NAME"] + "_" + SurveyMode.ToString().ToUpper()+"_MOBILE"; // } //else // { // OmnitureObj.ChannelName = ConfigurationManager.AppSettings["OMNITURE_CHANNEL_NAME"] + "_" + SurveyMode.ToString(); // } } else { OmnitureObj.IsEnabled = false; } return(OmnitureObj); }
public ActionResult Index(string surveyid) { try { Session["RootFormId"] = surveyid; string SurveyMode = ""; SurveyInfoModel surveyInfoModel = GetSurveyInfo(surveyid); System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(@"(\r\n|\r|\n)+"); if (surveyInfoModel.IntroductionText != null) { string introText = regex.Replace(surveyInfoModel.IntroductionText.Replace(" ", " "), "<br />"); surveyInfoModel.IntroductionText = MvcHtmlString.Create(introText).ToString(); } if (surveyInfoModel.IsDraftMode) { surveyInfoModel.IsDraftModeStyleClass = "draft"; SurveyMode = "draft"; } else { surveyInfoModel.IsDraftModeStyleClass = "final"; SurveyMode = "final"; } //create the responseid Guid ResponseID = Guid.NewGuid(); Session["RootResponseId"] = TempData[Epi.Web.MVC.Constants.Constant.RESPONSE_ID] = ResponseID.ToString(); surveyInfoModel.ResponseId = ResponseID.ToString(); string strPassCode = Epi.Web.MVC.Utility.SurveyHelper.GetPassCode(); surveyInfoModel.PassCode = strPassCode; TempData["PassCode"] = strPassCode; bool IsMobileDevice = false; IsMobileDevice = this.Request.Browser.IsMobileDevice; Omniture OmnitureObj = Epi.Web.MVC.Utility.OmnitureHelper.GetSettings(SurveyMode, IsMobileDevice); ViewBag.Omniture = OmnitureObj; string version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); ViewBag.Version = version; return(View(Epi.Web.MVC.Constants.Constant.INDEX_PAGE, surveyInfoModel)); } catch (Exception ex) { Epi.Web.Utility.ExceptionMessage.SendLogMessage(ex, this.HttpContext); return(View(Epi.Web.MVC.Constants.Constant.EXCEPTION_PAGE)); } }
public ActionResult Index(string surveyId, string final, string responseId) { try { string version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); ViewBag.Version = version; string SurveyMode = ""; SurveyInfoModel surveyInfoModel = GetSurveyInfo(surveyId); System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(@"(\r\n|\r|\n)+"); if (surveyInfoModel.ExitText != null) { string exitText = regex.Replace(surveyInfoModel.ExitText.Replace(" ", " "), "<br />"); surveyInfoModel.ExitText = MvcHtmlString.Create(exitText).ToString(); } string strPassCode = Epi.Web.MVC.Utility.SurveyHelper.GetPassCode(); surveyInfoModel.PassCode = strPassCode; TempData["PassCode"] = strPassCode; if (surveyInfoModel.IsDraftMode) { surveyInfoModel.IsDraftModeStyleClass = "draft"; } else { surveyInfoModel.IsDraftModeStyleClass = "final"; } bool IsMobileDevice = false; IsMobileDevice = this.Request.Browser.IsMobileDevice; Omniture OmnitureObj = Epi.Web.MVC.Utility.OmnitureHelper.GetSettings(SurveyMode, IsMobileDevice); ViewBag.ResponseId = responseId; ViewBag.Omniture = OmnitureObj; FormsAuthentication.SignOut(); // FormsAuthentication.SetAuthCookie("BeginSurvey", false); if (surveyInfoModel.XML.Contains("EIWS_MetaData_Email_Notification_hidden")) { SendNotification(surveyId, responseId); } return(View(Epi.Web.MVC.Constants.Constant.INDEX_PAGE, surveyInfoModel)); } catch (Exception ex) { Epi.Web.Utility.ExceptionMessage.SendLogMessage(ex, this.HttpContext); return(View(Epi.Web.MVC.Constants.Constant.EXCEPTION_PAGE)); } }