Refactorisation du workflow:

le manager devient statique, et les procédures
relatives au fichiers utisateur sont uniformisée,
que l'utilisateur soit enregistré ou anonyme,
que ce soit pour le blogspot, le frontoffice ou le workflow.

* YavscModel.csproj:
* Commande.cs:
* WorkFlowManager.cs:
* WebFileSystemManager.cs:
* UserFileSystemManager.cs: refactorisation du code, en vue de la mise
  en place
de la commande sans enregistrement du client sur le site.

* BasketController.cs:
* WorkFlowController.cs:
* FrontOfficeController.cs:
* FrontOfficeController.cs: Le manager de flux de travaux est devient
  un objet statique.

* FileSystemController.cs: refactorisation du code, en vue de la mise
  en place
de la commande sans enregistrement du client sur le site.

* Web.csproj: ajoute les références au déployement des sites
* Totem prod
* Totem pré
Leur configuration n'est pas maintenue sous Git.
This commit is contained in:
2015-11-22 14:00:59 +01:00
parent 77eed811f5
commit 439759cb16
13 changed files with 233 additions and 166 deletions

View File

@ -13,7 +13,7 @@ namespace Yavsc.Model.WorkFlow
/// It takes orders store them and raise some events for modules
/// It publishes estimates and invoices
/// </summary>
public class WorkFlowManager
public static class WorkFlowManager
{
/// <summary>
/// Gets or sets the catalog.
@ -26,7 +26,7 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// <returns>The command.</returns>
/// <param name="com">COM.</param>
public long RegisterCommand(Command com)
public static long RegisterCommand(Command com)
{
return ContentProvider.RegisterCommand (com);
}
@ -35,7 +35,7 @@ namespace Yavsc.Model.WorkFlow
/// Updates the estimate.
/// </summary>
/// <param name="estim">Estim.</param>
public void UpdateEstimate (Estimate estim)
public static void UpdateEstimate (Estimate estim)
{
ContentProvider.Update (estim);
}
@ -44,7 +44,7 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// <returns>The estimate.</returns>
/// <param name="estid">Estid.</param>
public Estimate GetEstimate (long estid)
public static Estimate GetEstimate (long estid)
{
return ContentProvider.Get (estid);
}
@ -54,7 +54,7 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// <returns>The estimates.</returns>
/// <param name="responsible">Responsible.</param>
public Estimate [] GetResponsibleEstimates (string responsible)
public static Estimate [] GetResponsibleEstimates (string responsible)
{
return ContentProvider.GetEstimates (null, responsible);
}
@ -64,7 +64,7 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// <returns>The client estimates.</returns>
/// <param name="client">Client.</param>
public Estimate [] GetClientEstimates (string client)
public static Estimate [] GetClientEstimates (string client)
{
return ContentProvider.GetEstimates (client, null);
}
@ -74,7 +74,7 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// <returns>The user estimates.</returns>
/// <param name="username">Username.</param>
public Estimate [] GetUserEstimates (string username)
public static Estimate [] GetUserEstimates (string username)
{
return ContentProvider.GetEstimates (username);
}
@ -84,7 +84,7 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// <returns>The stock status.</returns>
/// <param name="productReference">Product reference.</param>
public StockStatus GetStock(string productReference)
public static StockStatus GetStock(string productReference)
{
return ContentProvider.GetStockStatus (productReference);
}
@ -93,7 +93,7 @@ namespace Yavsc.Model.WorkFlow
/// Updates the writting.
/// </summary>
/// <param name="wr">Wr.</param>
public void UpdateWritting (Writting wr)
public static void UpdateWritting (Writting wr)
{
ContentProvider.UpdateWritting (wr);
}
@ -102,7 +102,7 @@ namespace Yavsc.Model.WorkFlow
/// Drops the writting.
/// </summary>
/// <param name="wrid">Wrid.</param>
public void DropWritting (long wrid)
public static void DropWritting (long wrid)
{
ContentProvider.DropWritting (wrid);
}
@ -110,19 +110,19 @@ namespace Yavsc.Model.WorkFlow
/// Drops the estimate.
/// </summary>
/// <param name="estid">Estid.</param>
public void DropEstimate (long estid)
public static void DropEstimate (long estid)
{
ContentProvider.DropEstimate(estid);
}
IContentProvider contentProvider;
static IContentProvider contentProvider;
/// <summary>
/// Gets the content provider.
/// </summary>
/// <value>The content provider.</value>
public IContentProvider ContentProvider {
public static IContentProvider ContentProvider {
get {
DataProviderConfigurationSection c = (DataProviderConfigurationSection) ConfigurationManager.GetSection ("system.web/workflow");
if (c == null)
@ -162,7 +162,7 @@ namespace Yavsc.Model.WorkFlow
/// <param name="client">Client.</param>
/// <param name="title">Title.</param>
/// <param name="description">Description.</param>
public Estimate CreateEstimate(string responsible, string client, string title, string description)
public static Estimate CreateEstimate(string responsible, string client, string title, string description)
{
Estimate created = ContentProvider.CreateEstimate (responsible, client, title, description);
return created;
@ -176,7 +176,7 @@ namespace Yavsc.Model.WorkFlow
/// <param name="ucost">Ucost.</param>
/// <param name="count">Count.</param>
/// <param name="productid">Productid.</param>
public long Write(long estid, string desc, decimal ucost, int count, string productid)
public static long Write(long estid, string desc, decimal ucost, int count, string productid)
{
if (!string.IsNullOrWhiteSpace(productid)) {
if (Catalog == null)
@ -197,7 +197,7 @@ namespace Yavsc.Model.WorkFlow
/// <param name="estid">Estid.</param>
/// <param name="status">Status.</param>
/// <param name="username">Username.</param>
public void SetEstimateStatus(long estid, int status, string username)
public static void SetEstimateStatus(long estid, int status, string username)
{
ContentProvider.SetEstimateStatus (estid, status, username);
}
@ -206,10 +206,17 @@ namespace Yavsc.Model.WorkFlow
/// </summary>
/// <returns>The commands.</returns>
/// <param name="username">Username.</param>
public CommandSet GetCommands(string username)
public static CommandSet GetCommands(string username)
{
return ContentProvider.GetCommands (username);
}
public static string [] APEDisponibles
{
get {
return new string[]{ "Chanteur", "DJ", "Musicien", "Clown" };
}
}
}
}