// // SkillManager.cs // // Author: // Paul Schneider // // Copyright (c) 2015 GNU GPL // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see . using System; using System.Configuration; using System.Reflection; using System.Configuration.Provider; using Yavsc.Model.FrontOffice; namespace Yavsc.Model.Skill { /// /// Skill manager. /// public static class SkillManager { private static SkillProvider provider = null; /// /// Gets the provider. /// /// The provider. private static SkillProvider DefaultProvider { get { if (provider == null) provider = ManagerHelper.CreateDefaultProvider ("system.web/skillProviders"); return provider; } } /// /// Create or modifies the specified skill. /// /// the skill. public static long DeclareSkill(SkillEntity skill) { DefaultProvider.Declare(skill); return skill.Id; } /// /// Declares the skill. /// /// The skill. /// Dec. public static long DeclareUserSkill(UserSkillDeclaration dec) { return DefaultProvider.Declare(dec); } /// /// Rates the user skill. /// /// The user skill. /// Username. /// User skill. public static long RateUserSkill(string username, UserSkillRating userSkill) { return DefaultProvider.Rate(userSkill); } /// /// Rates the skill. /// /// Username. /// Skill. public static void RateSkill(string username, AuthentificatedSkillRating skill) { DefaultProvider.Rate(skill); } /// /// Finds the skills. /// /// The skill identifier. /// Pattern. /// code APE. public static SkillEntity [] FindSkill(string pattern, string MEACode=null){ return DefaultProvider.FindSkill(pattern, MEACode); } /// /// Finds the performer. /// /// The performer. /// MEA Code. /// skills. public static string [] FindPerformer(string MEACode, SkillRating [] skills) { return DefaultProvider.FindPerformer(MEACode, skills); } /// /// Deletes the skill. /// /// Skill identifier. public static void DeleteSkill (long skillId) { DefaultProvider.DeleteSkill (skillId); } /// /// Deletes the user skill. /// /// Skill identifier. public static void DeleteUserSkill (long skillId) { DefaultProvider.DeleteUserSkill (skillId); } /// /// Gets the user skills. /// /// The user skills. /// User name. public static PerformerProfile GetUserSkills(string userName) { return DefaultProvider.GetUserSkills (userName); } } }