/// <summary> /// /// </summary> /// <param name="name"></param> /// <param name="textsLanguage"></param> /// <returns></returns> public VLLibraryQuestionCategory CreateLibraryQuestionCategory(string name, short textsLanguage = -2) { Utility.CheckParameter(ref name, true, true, false, 128, "Name"); #region SecurityLayer if (this.PrincipalType == Core.PrincipalType.SystemUser) { CheckPermissions(VLPermissions.ManageSystem, VLPermissions.Developer, VLPermissions.SystemService, VLPermissions.ManageBuidingBlocks); } else { throw new VLAccessDeniedException(); } #endregion /* * Ελέγχουμε εάν υπάρχει ήδη στην βάση αυτό το name, σε οποιαδήποτε γλώσσα: */ var existingItem = LibrariesDal.GetLibraryQuestionCategoryByName(this.AccessTokenId, name, textsLanguage); if (existingItem != null) { throw new VLException(SR.GetString(SR.Value_is_already_in_use, "Name", name)); } var category = new VLLibraryQuestionCategory(); category.Name = name; return(LibrariesDal.CreateLibraryQuestionCategory(this.AccessTokenId, category, textsLanguage)); }