Files
yavsc/yavscModel/Skill/SkillManager.cs
Paul Schneider fe97f14831 Réorganisations.
La page de reservation par défaut est maintenant la reservation dite simple.

Fonctionnalités en cours de développement:

1) la reservation dite simple
2) la notification à la reservation
3) l'activité principale exercée
4) l'integration d'un premier thème clair

* MEA.sql: définit la valeur MEA du profile (Main Exerted Activity)
  dans la base de donnée

* Booking.aspx: Imlémente la vue du formulaire de reservation simple,
c'etait avant la reservation classique, sur une période plutôt qu'un
  jour.
La reservation classique est renomée `EavyBooking`.

* SimpleBookingQuery.cs: Implémente une simple commande de
  rendez-vous,
en tant que commande du workflow.

* .gitignore: ignorer les configuration des pré et prod totem.

* SkillEntity.cs:
* SkillManager.cs:
* Skills.aspx:
* SkillProvider.cs:
* SkillController.cs:
* UserSkills.aspx:
* NpgsqlSkillProvider.cs: refactorisation (-Skill+SkillEntity)

* NpgsqlProfileProvider.cs: Fixe un bug introduit avec
  l'implementation des profiles anonymes.

* FrontOfficeController.cs: definit l'interface de cotation des
  compétences attendues

* UserCard.ascx: Imlémente une carte utilisateur.

* Web.config: déclare le code activité principale exercée parmis les
  valeurs du profile authentifié.

* Web.csproj: ajoute les nouveaux formulaire de reservation au projet.

* PerformerProfile.cs: S'assure d'avoir une valeur pour le nom
  d'utilisateur à la création.

* LocalizedText.resx:
* LocalizedText.Designer.cs: "date préférée" en anglais

* LocalizedText.fr.resx:
* LocalizedText.fr.Designer.cs: "date préférée" en français

* Profile.cs: à la creation d'un profile, on doit avoir un nom
  d'utilisateur,
même dans le cas où le profile est anonyme (dans ce cas,
on l'appelle identifiant anonyme).
Sinon, on lève une exception.

* YavscModel.csproj: * refactorisation: le nom `Skill` est celui de
  l'espace,
celui de la classe devient `SkillEntity`.
* Creation de la requête dite simple d'un rendez-vous (pour
  prestation)
à une date donnée (sans heure), concernant simplement une activité.

* EavyBooking.aspx: Implémente la reservation lourde
2015-11-23 00:43:57 +01:00

129 lines
3.6 KiB
C#

//
// SkillManager.cs
//
// Author:
// Paul Schneider <paul@pschneider.fr>
//
// 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 <http://www.gnu.org/licenses/>.
using System;
using System.Configuration;
using System.Reflection;
using System.Configuration.Provider;
using Yavsc.Model.FrontOffice;
namespace Yavsc.Model.Skill
{
/// <summary>
/// Skill manager.
/// </summary>
public static class SkillManager
{
private static SkillProvider provider = null;
/// <summary>
/// Gets the provider.
/// </summary>
/// <value>The provider.</value>
private static SkillProvider Provider {
get {
if (provider == null)
provider = ManagerHelper.GetDefaultProvider<SkillProvider>
("system.web/skillProviders");
return provider;
}
}
/// <summary>
/// Create or modifies the specified skill.
/// </summary>
/// <param name="skill">the skill.</param>
public static long DeclareSkill(SkillEntity skill) {
Provider.Declare(skill);
return skill.Id;
}
/// <summary>
/// Declares the skill.
/// </summary>
/// <returns>The skill.</returns>
/// <param name="dec">Dec.</param>
public static long DeclareUserSkill(UserSkillDeclaration dec) {
return Provider.Declare(dec);
}
/// <summary>
/// Rates the user skill.
/// </summary>
/// <returns>The user skill.</returns>
/// <param name="username">Username.</param>
/// <param name="userSkill">User skill.</param>
public static long RateUserSkill(string username, UserSkillRating userSkill) {
return Provider.Rate(userSkill);
}
/// <summary>
/// Rates the skill.
/// </summary>
/// <param name="username">Username.</param>
/// <param name="skill">Skill.</param>
public static void RateSkill(string username, SkillRating skill) {
Provider.Rate(skill);
}
/// <summary>
/// Finds the skills.
/// </summary>
/// <returns>The skill identifier.</returns>
/// <param name="pattern">Pattern.</param>
public static SkillEntity [] FindSkill(string pattern){
return Provider.FindSkill(pattern);
}
/// <summary>
/// Finds the performer.
/// </summary>
/// <returns>The performer.</returns>
/// <param name="skillIds">Skill identifiers.</param>
public static string [] FindPerformer(long []skillIds){
return Provider.FindPerformer(skillIds);
}
/// <summary>
/// Deletes the skill.
/// </summary>
/// <param name="skillId">Skill identifier.</param>
public static void DeleteSkill (long skillId)
{
Provider.DeleteSkill (skillId);
}
/// <summary>
/// Deletes the user skill.
/// </summary>
/// <param name="skillId">Skill identifier.</param>
public static void DeleteUserSkill (long skillId)
{
Provider.DeleteUserSkill (skillId);
}
/// <summary>
/// Gets the user skills.
/// </summary>
/// <returns>The user skills.</returns>
/// <param name="userName">User name.</param>
public static PerformerProfile GetUserSkills(string userName)
{
return Provider.GetUserSkills (userName);
}
}
}