Example #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="supportedLanguagesIds"></param>
 public VLSupportedLanguagesColection(string supportedLanguagesIds)
 {
     m_SupportedLanguages = new Collection <VLLanguage>();
     if (!string.IsNullOrWhiteSpace(supportedLanguagesIds))
     {
         var tokens = supportedLanguagesIds.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
         foreach (string token in tokens)
         {
             var language = BuiltinLanguages.GetLanguageById(Convert.ToInt16(token, CultureInfo.InvariantCulture), false);
             if (language != null)
             {
                 m_SupportedLanguages.Add(language);
             }
         }
     }
 }
        /// <summary>
        /// Επιστρέφει το absolutepath του συγκεκριμένου συλλέκτη/survey.
        /// <para>O συλλέκτης πρέπει να είναι τύπου WebLink</para>
        /// </summary>
        /// <param name="survey"></param>
        /// <param name="collector"></param>
        /// <param name="manualEntry"></param>
        /// <returns></returns>
        internal static string GetSurveyRuntimeAbsolutePath(VLSurvey survey, VLCollector collector, bool manualEntry)
        {
            if (collector.CollectorType != CollectorType.WebLink)
            {
                throw new VLException(string.Format("Collector '{0}', has wrong type!", collector.Name));
            }

            if (manualEntry == false)
            {
                var absolutePath = string.Format(@"/w/{0}/{1}/", collector.WebLink, BuiltinLanguages.GetTwoLetterISOCode(collector.TextsLanguage));
                return(absolutePath);
            }
            else
            {
                var absolutePath = string.Format(@"/wm/{0}/{1}/", collector.WebLink, BuiltinLanguages.GetTwoLetterISOCode(collector.TextsLanguage));
                return(absolutePath);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="survey"></param>
        /// <returns></returns>
        internal static string GetSurveyPreviewAbsolutePath(VLSurvey survey)
        {
            var absolutePath = string.Format(@"/s/{0}/{1}/", survey.PublicId, BuiltinLanguages.GetTwoLetterISOCode(survey.TextsLanguage));

            return(absolutePath);
        }
        /// <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);
            }
        }
 public override string ToString()
 {
     return(string.Format("{0}:{1} -> {2}", this.OptionId, BuiltinLanguages.GetLanguageById(this.TextsLanguage).Name, this.OptionText));
 }
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public override string ToString()
 {
     return(string.Format("{0}:{1} -> {2}", this.PageId, BuiltinLanguages.GetLanguageById(this.TextsLanguage).Name, this.ShowTitle));
 }