/// <summary> /// /// </summary> /// <param name="survey"></param> /// <param name="collector"></param> /// <param name="message"></param> /// <param name="recipient"></param> /// <returns></returns> internal static string GetRemoveRecipientLink(VLSurvey survey, VLCollector collector, VLMessage message, VLRecipient recipient) { var url = GetRemoveRecipientURL(survey, collector, message, recipient); return(string.Format("<a href=\"{0}\">{0}</a>", url)); }
/// <summary> /// Επιστρέφει ένα URL για την αφαίρεση του συγκεκριμένου recipient απο την address list του συγκεκριμένου πελάτη που τρέχει το survey. /// </summary> /// <param name="survey"></param> /// <param name="collector"></param> /// <param name="message"></param> /// <param name="recipient"></param> /// <returns></returns> internal static string GetRemoveRecipientURL(VLSurvey survey, VLCollector collector, VLMessage message, VLRecipient recipient) { var host = ValisSystem.Settings.Core.SystemPublicHostName; var _url = ValisSystem.Settings.Core.RemoveUrl.Url; var url = string.Format(@"{0}?rkey={1}&pid={2}&cid={3}&lang={4}", _url, recipient.RecipientKey, survey.PublicId, collector.CollectorId, BuiltinLanguages.PrimaryLanguage.LanguageId); url = string.Format("{0}/{1}", host, url).Replace("//", "/"); return(string.Format("http://{0}", url)); }
/// <summary> /// /// </summary> /// <param name="survey"></param> /// <param name="collector"></param> /// <param name="recipient"></param> /// <param name="manualEntry"></param> /// <returns></returns> internal static string GetSurveyRuntimeURL(VLSurvey survey, VLCollector collector, VLRecipient recipient, bool manualEntry = false) { var host = ValisSystem.Settings.Core.RuntimeEngine.Host; var absolutePath = GetSurveyRuntimeAbsolutePath(survey, collector, recipient, manualEntry); var url = string.Format(@"{0}{1}", host, absolutePath); if (collector.UseSSL) { return(string.Format("https://{0}", url)); } else { return(string.Format("http://{0}", url)); } }
/// <summary> /// /// </summary> /// <param name="survey"></param> /// <param name="collector"></param> /// <param name="recipient"></param> /// <param name="manualEntry"></param> /// <returns></returns> internal static string GetSurveyRuntimeLink(VLSurvey survey, VLCollector collector, VLRecipient recipient, bool manualEntry = false) { var url = GetSurveyRuntimeURL(survey, collector, recipient, manualEntry); return(string.Format("<a href=\"{0}\">{1}</a>", url, WebUtility.HtmlEncode(url))); }
/// <summary> /// /// </summary> /// <param name="survey"></param> /// <param name="collector"></param> /// <param name="recipient"></param> /// <param name="manualEntry"></param> /// <returns></returns> internal static string GetSurveyRuntimeAbsolutePath(VLSurvey survey, VLCollector collector, VLRecipient recipient, bool manualEntry) { if (collector.CollectorType != CollectorType.Email) { throw new VLException(string.Format("Collector '{0}', has wrong type!", collector.Name)); } if (manualEntry == false) { var absolutePath = string.Format(@"/em/{0}/{1}/{2}/{3}/", survey.PublicId, recipient.RecipientKey, collector.CollectorId, BuiltinLanguages.GetTwoLetterISOCode(collector.TextsLanguage)); return(absolutePath); } else { var absolutePath = string.Format(@"/emm/{0}/{1}/{2}/{3}/", survey.PublicId, recipient.RecipientKey, collector.CollectorId, BuiltinLanguages.GetTwoLetterISOCode(collector.TextsLanguage)); return(absolutePath); } }