From 439759cb168d503a977c826484e20ef95ff66479 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 22 Nov 2015 14:00:59 +0100 Subject: [PATCH] =?UTF-8?q?Refactorisation=20du=20workflow:=20le=20manager?= =?UTF-8?q?=20devient=20statique,=20et=20les=20proc=C3=A9dures=20relatives?= =?UTF-8?q?=20au=20fichiers=20utisateur=20sont=20uniformis=C3=A9e,=20que?= =?UTF-8?q?=20l'utilisateur=20soit=20enregistr=C3=A9=20ou=20anonyme,=20que?= =?UTF-8?q?=20ce=20soit=20pour=20le=20blogspot,=20le=20frontoffice=20ou=20?= =?UTF-8?q?le=20workflow.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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. --- web/ApiControllers/BasketController.cs | 17 +-- web/ApiControllers/FrontOfficeController.cs | 18 +-- web/ApiControllers/WorkFlowController.cs | 31 +---- web/ChangeLog | 18 +++ web/Controllers/FileSystemController.cs | 9 +- web/Controllers/FrontOfficeController.cs | 29 +--- web/Web.csproj | 2 + yavscModel/ChangeLog | 10 ++ .../FileSystem/UserFileSystemManager.cs | 131 ++++++++++++++++++ yavscModel/FileSystem/WebFileSystemManager.cs | 80 ++++------- yavscModel/FrontOffice/Commande.cs | 10 +- yavscModel/WorkFlow/WorkFlowManager.cs | 41 +++--- yavscModel/YavscModel.csproj | 3 +- 13 files changed, 233 insertions(+), 166 deletions(-) create mode 100644 yavscModel/FileSystem/UserFileSystemManager.cs diff --git a/web/ApiControllers/BasketController.cs b/web/ApiControllers/BasketController.cs index b31cc91d..2281d00d 100644 --- a/web/ApiControllers/BasketController.cs +++ b/web/ApiControllers/BasketController.cs @@ -17,20 +17,6 @@ namespace Yavsc.ApiControllers /// public class BasketController : ApiController { - /// - /// The wfmgr. - /// - protected WorkFlowManager wfmgr = null; - - /// - /// Initialize the specified controllerContext. - /// - /// Controller context. - protected override void Initialize (System.Web.Http.Controllers.HttpControllerContext controllerContext) - { - base.Initialize (controllerContext); - wfmgr = new WorkFlowManager (); - } /// /// Gets the current basket, creates a new one, if it doesn't exist. @@ -38,7 +24,8 @@ namespace Yavsc.ApiControllers /// The current basket. protected CommandSet CurrentBasket { get { - CommandSet b = wfmgr.GetCommands (Membership.GetUser ().UserName); + CommandSet b = WorkFlowManager.GetCommands ( + Membership.GetUser ().UserName); if (b == null) b = new CommandSet (); return b; } diff --git a/web/ApiControllers/FrontOfficeController.cs b/web/ApiControllers/FrontOfficeController.cs index 2b13ba51..e9c86d59 100644 --- a/web/ApiControllers/FrontOfficeController.cs +++ b/web/ApiControllers/FrontOfficeController.cs @@ -24,20 +24,6 @@ namespace Yavsc.ApiControllers /// public class FrontOfficeController : YavscController { - /// - /// The wfmgr. - /// - protected WorkFlowManager wfmgr = null; - - /// - /// Initialize the specified controllerContext. - /// - /// Controller context. - protected override void Initialize (System.Web.Http.Controllers.HttpControllerContext controllerContext) - { - base.Initialize (controllerContext); - wfmgr = new WorkFlowManager (); - } /// /// Catalog this instance. @@ -71,7 +57,7 @@ namespace Yavsc.ApiControllers [HttpGet] public Estimate GetEstimate (long id) { - Estimate est = wfmgr.ContentProvider.Get (id); + Estimate est = WorkFlowManager.ContentProvider.Get (id); string username = Membership.GetUser ().UserName; if (est.Client != username) if (!Roles.IsUserInRole("Admin")) @@ -109,7 +95,7 @@ namespace Yavsc.ApiControllers private string estimateToTex (long estimid) { Yavsc.templates.Estim tmpe = new Yavsc.templates.Estim (); - Estimate e = wfmgr.GetEstimate (estimid); + Estimate e = WorkFlowManager.GetEstimate (estimid); tmpe.Session = new Dictionary (); tmpe.Session.Add ("estim", e); Profile prpro = new Profile (ProfileBase.Create (e.Responsible)); diff --git a/web/ApiControllers/WorkFlowController.cs b/web/ApiControllers/WorkFlowController.cs index ca0cf435..56c56a2c 100644 --- a/web/ApiControllers/WorkFlowController.cs +++ b/web/ApiControllers/WorkFlowController.cs @@ -19,25 +19,6 @@ namespace Yavsc.ApiControllers /// public class WorkFlowController : ApiController { - string adminRoleName="Admin"; - /// - /// The wfmgr. - /// - protected WorkFlowManager wfmgr = null; - /// - /// Initialize the specified controllerContext. - /// - /// Controller context. - protected override void Initialize (HttpControllerContext controllerContext) - { - // TODO move it in a module initialization - base.Initialize (controllerContext); - if (!Roles.RoleExists (adminRoleName)) { - Roles.CreateRole (adminRoleName); - } - wfmgr = new WorkFlowManager (); - } - /// /// Creates the estimate. /// @@ -49,7 +30,7 @@ namespace Yavsc.ApiControllers [Authorize] public Estimate CreateEstimate (string title,string client,string description) { - return wfmgr.CreateEstimate ( + return WorkFlowManager.CreateEstimate ( Membership.GetUser().UserName,client,title,description); } @@ -102,7 +83,7 @@ namespace Yavsc.ApiControllers [Authorize] public void DropWritting(long wrid) { - wfmgr.DropWritting (wrid); + WorkFlowManager.DropWritting (wrid); } /// @@ -114,14 +95,14 @@ namespace Yavsc.ApiControllers public void DropEstimate(long estid) { string username = Membership.GetUser().UserName; - Estimate e = wfmgr.GetEstimate (estid); + Estimate e = WorkFlowManager.GetEstimate (estid); if (e == null) throw new InvalidOperationException("not an estimate id:"+estid); if (username != e.Responsible && !Roles.IsUserInRole ("FrontOffice")) throw new UnauthorizedAccessException ("You're not allowed to drop this estimate"); - wfmgr.DropEstimate (estid); + WorkFlowManager.DropEstimate (estid); } /// @@ -146,7 +127,7 @@ namespace Yavsc.ApiControllers [ValidateAjax] public HttpResponseMessage UpdateWritting([FromBody] Writting wr) { - wfmgr.UpdateWritting (wr); + WorkFlowManager.UpdateWritting (wr); return Request.CreateResponse (System.Net.HttpStatusCode.OK,"WrittingUpdated:"+wr.Id); } @@ -166,7 +147,7 @@ namespace Yavsc.ApiControllers } try { return Request.CreateResponse(System.Net.HttpStatusCode.OK, - wfmgr.Write(estid, wr.Description, + WorkFlowManager.Write(estid, wr.Description, wr.UnitaryCost, wr.Count, wr.ProductReference)); } catch (Exception ex) { diff --git a/web/ChangeLog b/web/ChangeLog index ed07c255..4884a5be 100644 --- a/web/ChangeLog +++ b/web/ChangeLog @@ -1,3 +1,21 @@ +2015-11-22 Paul Schneider + + * 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. + 2015-11-21 Paul Schneider * Microsoft.Web.XmlTransform.dll: Copié de l'import Nuget de diff --git a/web/Controllers/FileSystemController.cs b/web/Controllers/FileSystemController.cs index 2dac4b11..a22e0790 100644 --- a/web/Controllers/FileSystemController.cs +++ b/web/Controllers/FileSystemController.cs @@ -31,10 +31,9 @@ namespace Yavsc.Controllers /// Index this instance. /// [Authorize] - public ActionResult Index (string user, string filename) + public ActionResult Index (string username, string filename) { - WebFileSystemManager fsmgr = new WebFileSystemManager (); - var files = fsmgr.GetFiles (user,filename); + var files = UserFileSystemManager.GetFiles (username,filename); return View (files); } @@ -54,14 +53,12 @@ namespace Yavsc.Controllers /// Filename. public ActionResult Details (string user, string filename) { - WebFileSystemManager fsmgr = new WebFileSystemManager (); - FileInfo fi = fsmgr.FileInfo (filename); ViewData ["filename"] = filename; // TODO : ensure that we use the default port for // the used sheme ViewData ["url"] = Url.Content("~/users/"+user+"/"+filename); - return View (fi); + return View (UserFileSystemManager.Detail(user,filename)); } } } \ No newline at end of file diff --git a/web/Controllers/FrontOfficeController.cs b/web/Controllers/FrontOfficeController.cs index b4322b68..7934aebf 100644 --- a/web/Controllers/FrontOfficeController.cs +++ b/web/Controllers/FrontOfficeController.cs @@ -26,21 +26,6 @@ namespace Yavsc.Controllers /// public class FrontOfficeController : Controller { - /// - /// The wfmgr. - /// - protected WorkFlowManager wfmgr = null; - - /// - /// Initialize the specified requestContext. - /// - /// Request context. - protected override void Initialize (System.Web.Routing.RequestContext requestContext) - { - base.Initialize (requestContext); - wfmgr = new WorkFlowManager (); - } - /// /// Index this instance. /// @@ -68,7 +53,7 @@ namespace Yavsc.Controllers throw new ConfigurationErrorsException ("no redirection to any login page"); string username = u.UserName; - Estimate [] estims = wfmgr.GetUserEstimates (username); + Estimate [] estims = WorkFlowManager.GetUserEstimates (username); ViewData ["UserName"] = username; ViewData ["ResponsibleCount"] = Array.FindAll ( @@ -88,7 +73,7 @@ namespace Yavsc.Controllers /// Identifier. public ActionResult Get (long estimid) { - Estimate f = wfmgr.GetEstimate (estimid); + Estimate f = WorkFlowManager.GetEstimate (estimid); if (f == null) { ModelState.AddModelError ("Id", "Wrong Id"); return View (new Estimate () { Id=estimid } ); @@ -110,7 +95,7 @@ namespace Yavsc.Controllers ViewData ["WABASEWF"] = ViewData ["WebApiBase"] + "/WorkFlow"; if (submit == null) { if (model.Id > 0) { - Estimate f = wfmgr.GetEstimate (model.Id); + Estimate f = WorkFlowManager.GetEstimate (model.Id); if (f == null) { ModelState.AddModelError ("Id", "Wrong Id"); return View (model); @@ -136,12 +121,12 @@ namespace Yavsc.Controllers if (ModelState.IsValid) { if (model.Id == 0) - model = wfmgr.CreateEstimate ( + model = WorkFlowManager.CreateEstimate ( username, model.Client, model.Title, model.Description); else { - wfmgr.UpdateEstimate (model); - model = wfmgr.GetEstimate (model.Id); + WorkFlowManager.UpdateEstimate (model); + model = WorkFlowManager.GetEstimate (model.Id); } } } @@ -237,7 +222,7 @@ namespace Yavsc.Controllers [Authorize] public ActionResult Basket () { - return View (wfmgr.GetCommands (Membership.GetUser ().UserName)); + return View (WorkFlowManager.GetCommands (Membership.GetUser ().UserName)); } /// diff --git a/web/Web.csproj b/web/Web.csproj index 70ec4def..67a447fd 100644 --- a/web/Web.csproj +++ b/web/Web.csproj @@ -506,6 +506,8 @@ + + diff --git a/yavscModel/ChangeLog b/yavscModel/ChangeLog index f8e81113..6226b17b 100644 --- a/yavscModel/ChangeLog +++ b/yavscModel/ChangeLog @@ -1,3 +1,13 @@ +2015-11-22 Paul Schneider + + * 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. + 2015-11-21 Paul Schneider * UserNameBase.cs: Permet l'usage des espaces dans les noms diff --git a/yavscModel/FileSystem/UserFileSystemManager.cs b/yavscModel/FileSystem/UserFileSystemManager.cs new file mode 100644 index 00000000..1faff5ef --- /dev/null +++ b/yavscModel/FileSystem/UserFileSystemManager.cs @@ -0,0 +1,131 @@ +// +// UserFileSystemManager.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.IO; +using System.Web; +using System.Web.Security; +using System.Collections.Generic; +using System.Collections.Specialized; + +namespace Yavsc.Model.FileSystem +{ + /// + /// User file system. + /// + internal class UserFileSystem : WebFileSystemManager { + /// + /// Initializes a new instance of the class. + /// + /// Username. + /// Root. + public UserFileSystem(string username, string root="~/users") { + base.Prefix = UserFileSystemManager.UserFileRoot(username,root); + } + } + + /// + /// User file system manager. + /// + public static class UserFileSystemManager + { + /// + /// Initializes a new instance of the class. + /// + /// Root directory. + public static string CurrentUserFileRoot (string rootDirectory="~/users") + { + if (!HttpContext.Current.User.Identity.IsAuthenticated) + throw new Exception ("Not membership available"); + return UserFileRoot (HttpContext.Current.User.Identity.Name,rootDirectory); + } + /// + /// Users the file root. + /// + /// The file root. + /// Username. + /// Root directory. + public static string UserFileRoot (string username, string rootDirectory="~/users") + { + string rootpath = HttpContext.Current.Server.MapPath (rootDirectory); + return Path.Combine(rootpath, username); + } + private static WebFileSystemManager manager=null; + /// + /// Gets or sets the file manager. + /// + /// The file manager. + public static WebFileSystemManager FileManager { + get + { + if (manager == null) + manager = new UserFileSystem ( + HttpContext.Current.User.Identity.Name); + return manager; + } + set { + manager = value; + } + } + /// + /// Gets the files. + /// + /// The files. + /// Subdir. + public static IEnumerable GetFiles (string subdir) + { + return GetFiles (HttpContext.Current.User.Identity.Name, subdir); + } + /// + /// Gets the files. + /// + /// The files. + /// Username. + /// Subdir. + public static IEnumerable GetFiles (string username, string subdir) + { + return FileManager.GetFiles (Path.Combine(UserFileRoot(username),subdir)); + } + + /// + /// Put the specified destDir and files. + /// + /// Destination dir. + /// Files. + public static void Put(string destDir, NameObjectCollectionBase files) + { + FileManager.ValidateSubDir (destDir); + FileManager.Put( + Path.Combine(CurrentUserFileRoot(),destDir), + files); + } + + /// + /// Detail the specified filePath and username. + /// + /// File path. + /// Username. + public static FileInfo Detail(string filePath, string username=null) + { + return FileManager.FileInfo (UserFileRoot (username)); + } + } +} + diff --git a/yavscModel/FileSystem/WebFileSystemManager.cs b/yavscModel/FileSystem/WebFileSystemManager.cs index b9d51179..22ac852d 100644 --- a/yavscModel/FileSystem/WebFileSystemManager.cs +++ b/yavscModel/FileSystem/WebFileSystemManager.cs @@ -38,7 +38,7 @@ namespace Yavsc.Model.FileSystem /// It just provides simple method for a small set of /// files, in a small tree of sub-folders . /// - public class WebFileSystemManager + public abstract class WebFileSystemManager { /// /// Gets or sets the size of the max file. @@ -53,35 +53,8 @@ namespace Yavsc.Model.FileSystem public long MaxUserStorage { get; set; } - /// - /// Initializes a new instance of the class. - /// - public WebFileSystemManager (string rootDirectory="~/users") - { - string rootpath = HttpContext.Current.Server.MapPath (rootDirectory); - var rdi = new DirectoryInfo (rootpath); - if (!rdi.Exists) - rdi.Create (); - MembershipUser user = Membership.GetUser (); - if (user == null) - throw new Exception ("Not membership available"); - Prefix = Path.Combine(rootpath, user.ProviderUserKey.ToString()); - } - string regexFileName = "^[A-Za-z0-9#^!+ _~\\-.]+$"; - /// - /// Determines if the specified name is OK. - /// - /// true if is this name O the specified name; otherwise, false. - /// Name. - public static bool IsThisNameOK(string name) - { - foreach (char x in Path.GetInvalidPathChars()) { - if (name.Contains (x)) - return false; - } - return true; - } + /// /// Put the specified files in destDir, as sub dir of the current user's home dir. /// @@ -99,8 +72,7 @@ namespace Yavsc.Model.FileSystem } } // do the job - - CheckSubDir (destDir); + ValidateSubDir (destDir,true); DirectoryInfo di = new DirectoryInfo ( Path.Combine (Prefix, destDir)); if (!di.Exists) @@ -133,15 +105,25 @@ namespace Yavsc.Model.FileSystem /// concerning the allowed character class. /// /// Subdir. - private void CheckSubDir (string subdir) + /// throw ex. + public bool ValidateSubDir (string subdir, bool throwex = false) { foreach (string dirname in subdir.Split(Path.DirectorySeparatorChar)) { - if (!Regex.Match (dirname, regexFileName).Success) - throw new InvalidDirNameException (dirname); + if (!Regex.Match (dirname, regexFileName).Success) { + if (throwex) + throw new InvalidDirNameException (dirname); + else + return false; + } foreach (char x in dirname) - if (subdir.Contains (x)) - throw new InvalidDirNameException (subdir); + if (subdir.Contains (x)) { + if (throwex) + throw new InvalidDirNameException (subdir); + else + return false; + } } + return true; } /// /// Gets the files owned by the current logged user. @@ -150,28 +132,14 @@ namespace Yavsc.Model.FileSystem /// /// The files. /// Subdir. - public IEnumerable GetFiles (string subdir) - { - string path = Prefix; - if (subdir != null) { - CheckSubDir (subdir); // checks for specification validity - path = Path.Combine (Prefix, subdir); - } - DirectoryInfo di = new DirectoryInfo (path); - return (di.GetFiles ()); - } - - public FileInfo[] GetFiles (string username, string subdir) + public virtual IEnumerable GetFiles (string subdir) { string path = Prefix; if (subdir != null) { - CheckSubDir (subdir); // checks for specification validity + ValidateSubDir (subdir,true); // checks for specification validity path = Path.Combine (Prefix, subdir); } DirectoryInfo di = new DirectoryInfo (path); - - if (!di.Exists) - return new FileInfo[0]; return (di.GetFiles ()); } @@ -179,11 +147,11 @@ namespace Yavsc.Model.FileSystem /// Files the info. /// /// The info. - /// Identifier. - public FileInfo FileInfo(string id) + /// file Path. + public FileInfo FileInfo(string filePath) { - CheckSubDir (id); - return new FileInfo(Path.Combine (Prefix, id)); + ValidateSubDir (filePath,true); + return new FileInfo(Path.Combine (Prefix, filePath)); } } } diff --git a/yavscModel/FrontOffice/Commande.cs b/yavscModel/FrontOffice/Commande.cs index 0b77b051..2f5742b3 100644 --- a/yavscModel/FrontOffice/Commande.cs +++ b/yavscModel/FrontOffice/Commande.cs @@ -46,7 +46,7 @@ namespace Yavsc.Model.FrontOffice IEnumerable Files { get { - return GetFSM().GetFiles (Id.ToString()); + return UserFileSystemManager.GetFiles (Id.ToString()); } } /// @@ -72,10 +72,9 @@ namespace Yavsc.Model.FrontOffice if (key!="ref") Parameters.Add (key, collection [key]); } - WorkFlowManager wfm = new WorkFlowManager (); - wfm.RegisterCommand (this); // overrides this.Id + WorkFlowManager.RegisterCommand (this); // gives a value to this.Id string strcmdid = Id.ToString (); - GetFSM().Put (strcmdid, files); + UserFileSystemManager.Put(Path.Combine("commandes",strcmdid),files); } /// @@ -89,9 +88,6 @@ namespace Yavsc.Model.FrontOffice FromPost (collection, files); } - private WebFileSystemManager GetFSM() { - return new WebFileSystemManager ("~/commands/{0}"); - } } } diff --git a/yavscModel/WorkFlow/WorkFlowManager.cs b/yavscModel/WorkFlow/WorkFlowManager.cs index 4e09e862..f4df6bae 100644 --- a/yavscModel/WorkFlow/WorkFlowManager.cs +++ b/yavscModel/WorkFlow/WorkFlowManager.cs @@ -13,7 +13,7 @@ namespace Yavsc.Model.WorkFlow /// It takes orders store them and raise some events for modules /// It publishes estimates and invoices /// - public class WorkFlowManager + public static class WorkFlowManager { /// /// Gets or sets the catalog. @@ -26,7 +26,7 @@ namespace Yavsc.Model.WorkFlow /// /// The command. /// COM. - 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. /// /// Estim. - public void UpdateEstimate (Estimate estim) + public static void UpdateEstimate (Estimate estim) { ContentProvider.Update (estim); } @@ -44,7 +44,7 @@ namespace Yavsc.Model.WorkFlow /// /// The estimate. /// Estid. - public Estimate GetEstimate (long estid) + public static Estimate GetEstimate (long estid) { return ContentProvider.Get (estid); } @@ -54,7 +54,7 @@ namespace Yavsc.Model.WorkFlow /// /// The estimates. /// Responsible. - public Estimate [] GetResponsibleEstimates (string responsible) + public static Estimate [] GetResponsibleEstimates (string responsible) { return ContentProvider.GetEstimates (null, responsible); } @@ -64,7 +64,7 @@ namespace Yavsc.Model.WorkFlow /// /// The client estimates. /// Client. - public Estimate [] GetClientEstimates (string client) + public static Estimate [] GetClientEstimates (string client) { return ContentProvider.GetEstimates (client, null); } @@ -74,7 +74,7 @@ namespace Yavsc.Model.WorkFlow /// /// The user estimates. /// Username. - public Estimate [] GetUserEstimates (string username) + public static Estimate [] GetUserEstimates (string username) { return ContentProvider.GetEstimates (username); } @@ -84,7 +84,7 @@ namespace Yavsc.Model.WorkFlow /// /// The stock status. /// Product reference. - 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. /// /// Wr. - 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. /// /// Wrid. - 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. /// /// Estid. - public void DropEstimate (long estid) + public static void DropEstimate (long estid) { ContentProvider.DropEstimate(estid); } - IContentProvider contentProvider; + static IContentProvider contentProvider; /// /// Gets the content provider. /// /// The content provider. - 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 /// Client. /// Title. /// Description. - 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 /// Ucost. /// Count. /// Productid. - 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 /// Estid. /// Status. /// Username. - 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 /// /// The commands. /// Username. - 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" }; + } + } } } diff --git a/yavscModel/YavscModel.csproj b/yavscModel/YavscModel.csproj index c20f30d8..47a7b279 100644 --- a/yavscModel/YavscModel.csproj +++ b/yavscModel/YavscModel.csproj @@ -21,7 +21,6 @@ 4 false bin\Debug\YavscModel.xml - v4.5 full @@ -30,7 +29,6 @@ prompt 4 false - v4.5 false @@ -201,6 +199,7 @@ +