// // 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 Provider { get { if (provider == null) provider = ManagerHelper.GetDefaultProvider ("system.web/skillProviders"); return provider; } } /// /// Create or modifies the specified skill. /// /// the skill. public static long DeclareSkill(SkillEntity skill) { Provider.Declare(skill); return skill.Id; } /// /// Declares the skill. /// /// The skill. /// Dec. public static long DeclareUserSkill(UserSkillDeclaration dec) { return Provider.Declare(dec); } /// /// Rates the user skill. /// /// The user skill. /// Username. /// User skill. public static long RateUserSkill(string username, UserSkillRating userSkill) { return Provider.Rate(userSkill); } /// /// Rates the skill. /// /// Username. /// Skill. public static void RateSkill(string username, SkillRating skill) { Provider.Rate(skill); } /// /// Finds the skills. /// /// The skill identifier. /// Pattern. public static SkillEntity [] FindSkill(string pattern){ return Provider.FindSkill(pattern); } /// /// Finds the performer. /// /// The performer. /// Skill identifiers. public static string [] FindPerformer(long []skillIds){ return Provider.FindPerformer(skillIds); } /// /// Deletes the skill. /// /// Skill identifier. public static void DeleteSkill (long skillId) { Provider.DeleteSkill (skillId); } /// /// Deletes the user skill. /// /// Skill identifier. public static void DeleteUserSkill (long skillId) { Provider.DeleteUserSkill (skillId); } /// /// Gets the user skills. /// /// The user skills. /// User name. public static PerformerProfile GetUserSkills(string userName) { return Provider.GetUserSkills (userName); } } }