Implemente la gestion des activités
* Activities.aspx: implémente la vue Html de la liste éditable des activités * Activity.ascx: implémente la vue Html d'une activité * NpgsqlContentProvider.cs: implemente la gestion des activités côté base de donnée Npgsql * TestAPI.csproj: ... une référence au framework 4.5.1 en moins ... * FrontOfficeController.cs: Le contrôleur du FrontOffice gére les activités * Global.asax.cs: nettoyage du code * activity.sql: Typo corrigée sur le terme "MEACode" * style.css: enlève des images qui n'ont plus rien à faire ici, tant ce fichier concerne maintenant uniquement la disposition ou les éléments de base. * AccountController.cs: implémente le contrôle par l'utilisateur du paramêtre de l'activité principale associé à son profile. * FrontOfficeController.cs: Implemente le contrôle de la page des activités, et simplifie le contrôle de la page des compétences. * HomeController.cs: formattage du code * ModuleController.cs: inutilisé * App.master: Theming explicite en page maître * Profile.aspx: Propose maintenant l'édition de l'activité principalement éxercée * Skills.aspx: supprime une ligne de log * Index.aspx: RAZ en home page * MarkdownDeep.dll: remplace le tag englobant les transformations, il était un "<p>", il est maintenant un "<span>". * BlogManager.cs: refactorisation * Activity.cs: implémente un type de commande à associer à une activité. * LocalizedText.fr.resx: * LocalizedText.Designer.cs: * LocalizedText.fr.Designer.cs: La traduction de "ne pas publier mon activité" * LocalizedText.resx: La traduction de "ne pas publier mon activité", et de "Votre activité" * ManagerHelper.cs: refabrique l'instanciation des fournisseurs du workflow, pour avoir une liste de toutes les activité prises en charges par tous les fournisseurs de contenu. * Profile.cs: Implement le code activité de l'objet `Profile` * ProfileEdition.cs: xmldoc * SkillManager.cs: Formattage du code source * IContentProvider.cs: reformattage du code+ propriété "Name" du fournisseur + definition des methodes relatives à la gestion des activités * WorkFlowManager.cs: Methodes de recupperation des activités fournies auprés des fournisseurs de contenu * YavscModel.csproj: renommage * Web.csproj: reference les nouveaux éléments du projet relatifs au activités * Web.config: references manquante en cas d'utilisation du paramértrage global du thème via la section system.web/pages du fichier de configuration.
This commit is contained in:
parent
f3bc91289d
commit
2fcaa1ded4
37 changed files with 804 additions and 341 deletions
|
|
@ -11,7 +11,6 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// </summary>
|
||||
public interface IContentProvider : IDbModule, IDisposable, IDataProvider<Estimate,long>
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Gets the different status labels.
|
||||
/// 0 is the starting status. Each status is an integer and the 0-based index
|
||||
|
|
@ -25,6 +24,52 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// </summary>
|
||||
/// <value>The final statuses.</value>
|
||||
bool [] FinalStatuses { get; }
|
||||
|
||||
string Name { get; }
|
||||
/// <summary>
|
||||
/// Creates the estimate.
|
||||
/// </summary>
|
||||
/// <returns>The estimate.</returns>
|
||||
/// <param name="responsible">Responsible.</param>
|
||||
/// <param name="client">Client.</param>
|
||||
/// <param name="title">Title.</param>
|
||||
/// <param name="description">Description.</param>
|
||||
Estimate CreateEstimate (string responsible, string client, string title, string description);
|
||||
|
||||
/// <summary>
|
||||
/// Drops the writting.
|
||||
/// </summary>
|
||||
/// <param name="wrid">Wrid.</param>
|
||||
void DropWritting (long wrid);
|
||||
|
||||
/// <summary>
|
||||
/// Drops the estimate.
|
||||
/// </summary>
|
||||
/// <param name="estid">Estid.</param>
|
||||
void DropEstimate (long estid);
|
||||
|
||||
/// <summary>
|
||||
/// Drops the tag writting.
|
||||
/// </summary>
|
||||
/// <param name="wrid">Wrid.</param>
|
||||
/// <param name="tag">Tag.</param>
|
||||
void DropWrittingTag (long wrid,string tag);
|
||||
|
||||
/// <summary>
|
||||
/// Finds the activity.
|
||||
/// </summary>
|
||||
/// <returns>The activity.</returns>
|
||||
/// <param name="pattern">Pattern.</param>
|
||||
/// <param name="exerted">If set to <c>true</c> exerted.</param>
|
||||
Activity [] FindActivity (string pattern, bool exerted);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the activity.
|
||||
/// </summary>
|
||||
/// <returns>The activity.</returns>
|
||||
/// <param name="MEACode">MAE code.</param>
|
||||
Activity GetActivity (string MEACode);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the writting status changes.
|
||||
/// </summary>
|
||||
|
|
@ -36,17 +81,80 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// </summary>
|
||||
/// <returns>The estimate statuses.</returns>
|
||||
/// <param name="estid">Estid.</param>
|
||||
StatusChange[] GetEstimateStatuses (long estid);
|
||||
StatusChange[] GetEstimateStatuses (long estid); /// <summary>
|
||||
|
||||
/// <summary>
|
||||
/// Creates the estimate.
|
||||
/// Gets the estimates.
|
||||
/// </summary>
|
||||
/// <returns>The estimate.</returns>
|
||||
/// <param name="responsible">Responsible.</param>
|
||||
/// <param name="client">Client.</param>
|
||||
/// <param name="title">Title.</param>
|
||||
/// <param name="description">Description.</param>
|
||||
Estimate CreateEstimate (string responsible, string client, string title, string description);
|
||||
/// <returns>The estimates.</returns>
|
||||
/// <param name="username">Username.</param>
|
||||
Estimate [] GetEstimates(string username);
|
||||
|
||||
/// <summary>
|
||||
/// Registers the activity.
|
||||
/// </summary>
|
||||
/// <param name="activity">Activity.</param>
|
||||
/// <param name="code">Code.</param>
|
||||
void RegisterActivity (string activityName, string meacode, string comment);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the estimates.
|
||||
/// </summary>
|
||||
/// <returns>The estimates.</returns>
|
||||
/// <param name="client">Client.</param>
|
||||
/// <param name="responsible">Responsible.</param>
|
||||
Estimate [] GetEstimates(string client, string responsible);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the commands.
|
||||
/// </summary>
|
||||
/// <returns>The commands.</returns>
|
||||
/// <param name="username">Username.</param>
|
||||
CommandSet GetCommands (string username);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the stock status.
|
||||
/// </summary>
|
||||
/// <returns>The stock status.</returns>
|
||||
/// <param name="productReference">Product reference.</param>
|
||||
StockStatus GetStockStatus (string productReference);
|
||||
|
||||
/// <summary>
|
||||
/// Registers the command.
|
||||
/// </summary>
|
||||
/// <returns>The command id in db.</returns>
|
||||
/// <param name="com">COM.</param>
|
||||
long RegisterCommand (Command com);
|
||||
/// <summary>
|
||||
/// Sets the writting status.
|
||||
/// </summary>
|
||||
/// <param name="wrtid">Wrtid.</param>
|
||||
/// <param name="status">Status.</param>
|
||||
/// <param name="username">Username.</param>
|
||||
void SetWrittingStatus (long wrtid,int status,string username);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the estimate status.
|
||||
/// </summary>
|
||||
/// <param name="estid">Estid.</param>
|
||||
/// <param name="status">Status.</param>
|
||||
/// <param name="username">Username.</param>
|
||||
void SetEstimateStatus (long estid,int status,string username);
|
||||
|
||||
/// <summary>
|
||||
/// Tags the writting.
|
||||
/// </summary>
|
||||
/// <param name="wrid">Wrid.</param>
|
||||
/// <param name="tag">Tag.</param>
|
||||
void TagWritting (long wrid,string tag);
|
||||
|
||||
/// <summary>
|
||||
/// Updates the writting.
|
||||
/// </summary>
|
||||
/// <param name="wr">Wr.</param>
|
||||
void UpdateWritting (Writting wr);
|
||||
|
||||
/// Add a line to the specified estimate by id,
|
||||
/// using the specified desc, ucost, count and productid.
|
||||
/// </summary>
|
||||
|
|
@ -57,79 +165,6 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// <param name="productid">Product identifier.</param>
|
||||
long Write (long estid, string desc, decimal ucost, int count, string productid);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the estimates created by
|
||||
/// or for the given user by user name.
|
||||
/// </summary>
|
||||
/// <returns>The estimates.</returns>
|
||||
/// <param name="username">user name.</param>
|
||||
Estimate [] GetEstimates(string username);
|
||||
/// <summary>
|
||||
/// Gets the estimates.
|
||||
/// </summary>
|
||||
/// <returns>The estimates.</returns>
|
||||
/// <param name="client">Client.</param>
|
||||
/// <param name="responsible">Responsible.</param>
|
||||
Estimate [] GetEstimates(string client, string responsible);
|
||||
/// <summary>
|
||||
/// Drops the writting.
|
||||
/// </summary>
|
||||
/// <param name="wrid">Wrid.</param>
|
||||
void DropWritting (long wrid);
|
||||
/// <summary>
|
||||
/// Drops the estimate.
|
||||
/// </summary>
|
||||
/// <param name="estid">Estid.</param>
|
||||
void DropEstimate (long estid);
|
||||
/// <summary>
|
||||
/// Tags the writting.
|
||||
/// </summary>
|
||||
/// <param name="wrid">Wrid.</param>
|
||||
/// <param name="tag">Tag.</param>
|
||||
void TagWritting (long wrid,string tag);
|
||||
/// <summary>
|
||||
/// Drops the tag writting.
|
||||
/// </summary>
|
||||
/// <param name="wrid">Wrid.</param>
|
||||
/// <param name="tag">Tag.</param>
|
||||
void DropWrittingTag (long wrid,string tag);
|
||||
/// <summary>
|
||||
/// Updates the writting.
|
||||
/// </summary>
|
||||
/// <param name="wr">Wr.</param>
|
||||
void UpdateWritting (Writting wr);
|
||||
/// <summary>
|
||||
/// Sets the writting status.
|
||||
/// </summary>
|
||||
/// <param name="wrtid">Wrtid.</param>
|
||||
/// <param name="status">Status.</param>
|
||||
/// <param name="username">Username.</param>
|
||||
void SetWrittingStatus (long wrtid,int status,string username);
|
||||
/// <summary>
|
||||
/// Sets the estimate status.
|
||||
/// </summary>
|
||||
/// <param name="estid">Estid.</param>
|
||||
/// <param name="status">Status.</param>
|
||||
/// <param name="username">Username.</param>
|
||||
void SetEstimateStatus (long estid,int status,string username);
|
||||
/// <summary>
|
||||
/// Registers the command.
|
||||
/// </summary>
|
||||
/// <returns>The command id in db.</returns>
|
||||
/// <param name="com">COM.</param>
|
||||
long RegisterCommand (Command com);
|
||||
/// <summary>
|
||||
/// Gets the commands.
|
||||
/// </summary>
|
||||
/// <returns>The commands.</returns>
|
||||
/// <param name="username">Username.</param>
|
||||
CommandSet GetCommands (string username);
|
||||
/// <summary>
|
||||
/// Gets the stock status.
|
||||
/// </summary>
|
||||
/// <returns>The stock status.</returns>
|
||||
/// <param name="productReference">Product reference.</param>
|
||||
StockStatus GetStockStatus (string productReference);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,19 +21,26 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// </summary>
|
||||
/// <returns>The activity.</returns>
|
||||
/// <param name="pattern">Pattern.</param>
|
||||
public static IEnumerable<Activity> FindActivity(string pattern = "%")
|
||||
/// <param name="exerted">If set to <c>true</c> exerted.</param>
|
||||
public static Activity[] FindActivity(string pattern = "%", bool exerted=true)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
List<Activity> activities = new List<Activity> ();
|
||||
foreach (var provider in Providers) {
|
||||
foreach (var act in provider.FindActivity (pattern, exerted))
|
||||
if (!activities.Contains(act))
|
||||
activities.Add(act);
|
||||
}
|
||||
return activities.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the activity.
|
||||
/// </summary>
|
||||
/// <returns>The activity.</returns>
|
||||
/// <param name="MAECode">MAE code.</param>
|
||||
public static Activity GetActivity (string MAECode)
|
||||
/// <param name="meacode">MAE code.</param>
|
||||
public static Activity GetActivity (string meacode)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
return DefaultProvider.GetActivity (meacode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -49,7 +56,7 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// <param name="com">COM.</param>
|
||||
public static long RegisterCommand(Command com)
|
||||
{
|
||||
return ContentProvider.RegisterCommand (com);
|
||||
return DefaultProvider.RegisterCommand (com);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -58,7 +65,7 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// <param name="estim">Estim.</param>
|
||||
public static void UpdateEstimate (Estimate estim)
|
||||
{
|
||||
ContentProvider.Update (estim);
|
||||
DefaultProvider.Update (estim);
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the estimate.
|
||||
|
|
@ -67,7 +74,7 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// <param name="estid">Estid.</param>
|
||||
public static Estimate GetEstimate (long estid)
|
||||
{
|
||||
return ContentProvider.Get (estid);
|
||||
return DefaultProvider.Get (estid);
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the estimates, refering the
|
||||
|
|
@ -77,7 +84,7 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// <param name="responsible">Responsible.</param>
|
||||
public static Estimate [] GetResponsibleEstimates (string responsible)
|
||||
{
|
||||
return ContentProvider.GetEstimates (null, responsible);
|
||||
return DefaultProvider.GetEstimates (null, responsible);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -87,7 +94,7 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// <param name="client">Client.</param>
|
||||
public static Estimate [] GetClientEstimates (string client)
|
||||
{
|
||||
return ContentProvider.GetEstimates (client, null);
|
||||
return DefaultProvider.GetEstimates (client, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -97,7 +104,7 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// <param name="username">Username.</param>
|
||||
public static Estimate [] GetUserEstimates (string username)
|
||||
{
|
||||
return ContentProvider.GetEstimates (username);
|
||||
return DefaultProvider.GetEstimates (username);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -107,7 +114,7 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// <param name="productReference">Product reference.</param>
|
||||
public static StockStatus GetStock(string productReference)
|
||||
{
|
||||
return ContentProvider.GetStockStatus (productReference);
|
||||
return DefaultProvider.GetStockStatus (productReference);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -116,7 +123,7 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// <param name="wr">Wr.</param>
|
||||
public static void UpdateWritting (Writting wr)
|
||||
{
|
||||
ContentProvider.UpdateWritting (wr);
|
||||
DefaultProvider.UpdateWritting (wr);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -125,7 +132,7 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// <param name="wrid">Wrid.</param>
|
||||
public static void DropWritting (long wrid)
|
||||
{
|
||||
ContentProvider.DropWritting (wrid);
|
||||
DefaultProvider.DropWritting (wrid);
|
||||
}
|
||||
/// <summary>
|
||||
/// Drops the estimate.
|
||||
|
|
@ -133,25 +140,38 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// <param name="estid">Estid.</param>
|
||||
public static void DropEstimate (long estid)
|
||||
{
|
||||
ContentProvider.DropEstimate(estid);
|
||||
DefaultProvider.DropEstimate(estid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static IContentProvider contentProvider;
|
||||
static IContentProvider defaultProvider;
|
||||
/// <summary>
|
||||
/// Gets the content provider.
|
||||
/// </summary>
|
||||
/// <value>The content provider.</value>
|
||||
public static IContentProvider ContentProvider {
|
||||
public static IContentProvider DefaultProvider {
|
||||
|
||||
get {
|
||||
if (contentProvider == null)
|
||||
contentProvider = ManagerHelper.GetDefaultProvider
|
||||
if (defaultProvider == null)
|
||||
defaultProvider = ManagerHelper.CreateDefaultProvider
|
||||
("system.web/workflow") as IContentProvider;
|
||||
return contentProvider;
|
||||
return defaultProvider;
|
||||
}
|
||||
}
|
||||
public static IContentProvider [] Providers {
|
||||
|
||||
get {
|
||||
if (providers == null) {
|
||||
var pbs = ManagerHelper.CreateProviders
|
||||
("system.web/workflow");
|
||||
providers = new IContentProvider [pbs.Length];
|
||||
for (var i=0;i<pbs.Length;i++)
|
||||
providers[i] = pbs[i] as IContentProvider;
|
||||
}
|
||||
return providers;
|
||||
}
|
||||
}
|
||||
|
||||
private static IContentProvider [] providers = null;
|
||||
|
||||
/// <summary>
|
||||
/// Creates the estimate.
|
||||
|
|
@ -163,7 +183,7 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// <param name="description">Description.</param>
|
||||
public static Estimate CreateEstimate(string responsible, string client, string title, string description)
|
||||
{
|
||||
Estimate created = ContentProvider.CreateEstimate (responsible, client, title, description);
|
||||
Estimate created = DefaultProvider.CreateEstimate (responsible, client, title, description);
|
||||
return created;
|
||||
}
|
||||
|
||||
|
|
@ -187,7 +207,7 @@ namespace Yavsc.Model.WorkFlow
|
|||
throw new Exception ("Product not found");
|
||||
// TODO new EstimateChange Event
|
||||
}
|
||||
return ContentProvider.Write(estid, desc, ucost, count, productid);
|
||||
return DefaultProvider.Write(estid, desc, ucost, count, productid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -198,7 +218,7 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// <param name="username">Username.</param>
|
||||
public static void SetEstimateStatus(long estid, int status, string username)
|
||||
{
|
||||
ContentProvider.SetEstimateStatus (estid, status, username);
|
||||
DefaultProvider.SetEstimateStatus (estid, status, username);
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the commands.
|
||||
|
|
@ -207,14 +227,12 @@ namespace Yavsc.Model.WorkFlow
|
|||
/// <param name="username">Username.</param>
|
||||
public static CommandSet GetCommands(string username)
|
||||
{
|
||||
return ContentProvider.GetCommands (username);
|
||||
return DefaultProvider.GetCommands (username);
|
||||
}
|
||||
|
||||
public static string [] APEDisponibles
|
||||
public static void RegisterActivity (string activityName, string meacode, string comment)
|
||||
{
|
||||
get {
|
||||
return new string[]{ "Chanteur", "DJ", "Musicien", "Clown" };
|
||||
}
|
||||
DefaultProvider.RegisterActivity (activityName, meacode, comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue