コード例 #1
0
 public void DeleteLibraryQuestionOption(VLLibraryOption option)
 {
     if (option == null)
     {
         throw new ArgumentNullException("option");
     }
     DeleteLibraryQuestionOption(option.Question, option.OptionId);
 }
コード例 #2
0
        public VLLibraryOption CreateLibraryQuestionOption(Int32 question, string optionText, QuestionOptionType type = QuestionOptionType.Default, short textsLanguage = /*DefaultLanguage*/ -2)
        {
            VLLibraryOption option = new VLLibraryOption();

            option.Question   = question;
            option.OptionText = optionText;
            option.OptionType = type;
            return(LibrariesDal.CreateLibraryOption(this.AccessTokenId, option, textsLanguage));
        }
コード例 #3
0
 internal VLLibraryOption(VLLibraryOption source)
 {
     this.m_question       = default(Int32);
     this.m_optionId       = default(byte);
     this.m_optionType     = source.m_optionType;
     this.m_displayOrder   = default(Int16);
     this.m_optionValue    = source.m_optionValue;
     this.m_attributeFlags = default(Int32);
     this.m_textsLanguage  = source.m_textsLanguage;
     this.m_optionText     = source.m_optionText;
 }
コード例 #4
0
        public VLLibraryOption UpdateLibraryQuestionOption(VLLibraryOption option)
        {
            if (option == null)
            {
                throw new ArgumentNullException("option");
            }
            option.ValidateInstance();

            //διαβάζουμε το option απο την βάση μας:
            var existingItem = LibrariesDal.GetLibraryOptionById(AccessTokenId, option.Question, option.OptionId, option.TextsLanguage);

            if (existingItem == null)
            {
                throw new VLException(SR.GetString(SR.There_is_no_item_with_id, "Option", option.OptionId));
            }


            existingItem.OptionText = option.OptionText;

            return(LibrariesDal.UpdateLibraryOption(AccessTokenId, existingItem));
        }