From 93c18633b98b66feb90f6883e2d05a6aa1334134 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Tue, 27 Jan 2015 14:17:33 +0100 Subject: [PATCH] xml doc --- WorkFlowProvider/NpgsqlContentProvider.cs | 3 +- web/Controllers/BasketController.cs | 10 --- web/Controllers/FrontOfficeController.cs | 79 +++++++++++-------- web/Formatters/ErrorHtmlFormatter.cs | 28 ++++++- web/Formatters/RssFeedsFormatter.cs | 16 +++- web/Helpers/Google/ApiClient.cs | 31 ++++++-- web/Helpers/Google/CalendarApi.cs | 31 ++++++++ web/Helpers/Google/EntityQuery.cs | 10 ++- web/Helpers/Google/MapTracks.cs | 22 +++++- web/Helpers/Google/OAuth2.cs | 59 +++++++++++--- web/Helpers/SimpleJsonPostMethod.cs | 8 +- web/Settings/ModuleConfigurationElement.cs | 16 +++- web/Settings/ModulesConfigurationSection.cs | 7 ++ web/Settings/ThanksConfigurationCollection.cs | 19 +++++ web/Settings/ThanksHelper.cs | 14 +++- web/Views/FrontOffice/Command.aspx | 10 ++- web/templates/TexEstimInit.cs | 3 + yavscModel/FrontOffice/Basket.cs | 35 ++++++++ .../{WorkFlow => FrontOffice}/Commande.cs | 5 +- yavscModel/LocalizedText.Designer.cs | 6 ++ yavscModel/LocalizedText.fr.resx | 2 +- yavscModel/LocalizedText.resx | 1 + yavscModel/WorkFlow/BasketImpact.cs | 16 ---- yavscModel/WorkFlow/IContentProvider.cs | 1 + yavscModel/WorkFlow/IWFModule.cs | 25 ------ yavscModel/WorkFlow/IWFOrder.cs | 22 ------ yavscModel/WorkFlow/WorkFlowManager.cs | 1 + yavscModel/YavscModel.csproj | 8 +- 28 files changed, 338 insertions(+), 150 deletions(-) create mode 100644 yavscModel/FrontOffice/Basket.cs rename yavscModel/{WorkFlow => FrontOffice}/Commande.cs (83%) delete mode 100644 yavscModel/WorkFlow/BasketImpact.cs delete mode 100644 yavscModel/WorkFlow/IWFModule.cs delete mode 100644 yavscModel/WorkFlow/IWFOrder.cs diff --git a/WorkFlowProvider/NpgsqlContentProvider.cs b/WorkFlowProvider/NpgsqlContentProvider.cs index 9385be7f..789b9cf1 100644 --- a/WorkFlowProvider/NpgsqlContentProvider.cs +++ b/WorkFlowProvider/NpgsqlContentProvider.cs @@ -7,6 +7,7 @@ using Yavsc.Model.WorkFlow; using System.Web.Mvc; using System.Configuration.Provider; using System.Collections.Generic; +using Yavsc.Model.FrontOffice; namespace WorkFlowProvider { @@ -18,7 +19,7 @@ namespace WorkFlowProvider using (NpgsqlConnection cnx = CreateConnection ()) { using (NpgsqlCommand cmd = cnx.CreateCommand ()) { cmd.CommandText = - "insert into commandes (pref,creation) values (@pref,@creat) returning _id"; + "insert into commandes (prdref,creation) values (@pref,@creat) returning id"; cmd.Parameters.Add ("@pref", com.ProdRef); cmd.Parameters.Add ("@creat", com.CreationDate); cnx.Open (); diff --git a/web/Controllers/BasketController.cs b/web/Controllers/BasketController.cs index 8b858533..53a5c1a6 100644 --- a/web/Controllers/BasketController.cs +++ b/web/Controllers/BasketController.cs @@ -64,15 +64,5 @@ namespace Yavsc.ApiControllers return wfmgr.GetEstimates ( Membership.GetUser().UserName); } - - /// - /// Order the specified bi. - /// - /// Bi. - [HttpGet] - public object Order (BasketImpact bi) - { - return new { c="lmk,", message="Panier impacté", impactRef=bi.ProductRef, count=bi.Count}; - } } } \ No newline at end of file diff --git a/web/Controllers/FrontOfficeController.cs b/web/Controllers/FrontOfficeController.cs index 63a8cf95..83ed31d6 100644 --- a/web/Controllers/FrontOfficeController.cs +++ b/web/Controllers/FrontOfficeController.cs @@ -13,6 +13,7 @@ using Yavsc.Model.WorkFlow; using WorkFlowProvider; using System.Web.Security; using System.Threading; +using Yavsc.Model.FrontOffice; namespace Yavsc.Controllers { @@ -26,6 +27,7 @@ namespace Yavsc.Controllers /// The wfmgr. /// protected WorkFlowManager wfmgr = null; + /// /// Initialize the specified requestContext. /// @@ -35,6 +37,7 @@ namespace Yavsc.Controllers base.Initialize (requestContext); wfmgr = new WorkFlowManager (); } + /// /// Index this instance. /// @@ -42,6 +45,7 @@ namespace Yavsc.Controllers { return View (); } + /// /// Estimates this instance. /// @@ -50,15 +54,16 @@ namespace Yavsc.Controllers { string username = Membership.GetUser ().UserName; - return View(wfmgr.GetEstimates (username)); + return View (wfmgr.GetEstimates (username)); } + /// /// Estimate the specified model and submit. /// /// Model. /// Submit. [Authorize] - public ActionResult Estimate(Estimate model,string submit) + public ActionResult Estimate (Estimate model, string submit) { ViewData ["WebApiBase"] = "http://" + Request.Url.Authority + "/api"; ViewData ["WABASEWF"] = ViewData ["WebApiBase"] + "/WorkFlow"; @@ -80,12 +85,12 @@ namespace Yavsc.Controllers } else { string username = HttpContext.User.Identity.Name; if (model.Id == 0) { - model.Responsible=username; + model.Responsible = username; ModelState.Clear (); } if (ModelState.IsValid) { if (username != model.Responsible - && !Roles.IsUserInRole ("FrontOffice")) + && !Roles.IsUserInRole ("FrontOffice")) throw new UnauthorizedAccessException ("You're not allowed to modify this estimate"); if (model.Id == 0) @@ -98,12 +103,13 @@ namespace Yavsc.Controllers } } } - return View(model); + return View (model); } + /// /// Catalog this instance. /// - [AcceptVerbs("GET")] + [AcceptVerbs ("GET")] public ActionResult Catalog () { return View ( @@ -114,12 +120,12 @@ namespace Yavsc.Controllers /// /// Catalog this instance. /// - [AcceptVerbs("GET")] + [AcceptVerbs ("GET")] public ActionResult Brand (string id) { Catalog c = CatalogManager.GetCatalog (Request.Url.AbsolutePath); ViewData ["BrandName"] = id; - return View ( c.GetBrand (id) ); + return View (c.GetBrand (id)); } /// @@ -128,7 +134,7 @@ namespace Yavsc.Controllers /// The category object. /// Brand id. /// Product category Id. - [AcceptVerbs("GET")] + [AcceptVerbs ("GET")] public ActionResult ProductCategory (string brandid, string pcid) { ViewData ["BrandId"] = brandid; @@ -137,13 +143,14 @@ namespace Yavsc.Controllers CatalogManager.GetCatalog (Request.Url.AbsolutePath).GetBrand (brandid).GetProductCategory (pcid) ); } + /// /// Product the specified id, pc and pref. /// /// Identifier. /// Pc. /// Preference. - [AcceptVerbs("GET")] + [AcceptVerbs ("GET")] public ActionResult Product (string id, string pc, string pref) { Product p = null; @@ -168,62 +175,68 @@ namespace Yavsc.Controllers } ViewData ["ProdCatName"] = pcat.Name; p = pcat.GetProduct (pref); - if (p.CommandForm==null) + if (p.CommandForm == null) p.CommandForm = b.DefaultForm; - return View ((p is Service)?"Service":"Product", p); + return View ((p is Service) ? "Service" : "Product", p); } + /// /// Command this instance. /// - public ActionResult Command() + public ActionResult Command () { return View (); } + private Basket GetBasket () + { + if (Session ["Basket"] == null) + Session ["Basket"] = new Basket(); + return Session ["Basket"] as Basket; + } + /// /// Command the specified collection. /// /// Collection. [HttpPost] [Authorize] - public ActionResult Command(FormCollection collection) + public ActionResult Command (FormCollection collection) { try { // get files from the request string fnre = "[A-Za-z0-9~\\-.]+"; HttpFileCollectionBase hfc = Request.Files; - foreach (String h in hfc.AllKeys) - { - if (!Regex.Match(hfc[h].FileName,fnre).Success) - { + foreach (String h in hfc.AllKeys) { + if (!Regex.Match (hfc [h].FileName, fnre).Success) { ViewData ["Message"] = "File name refused"; - ModelState.AddModelError( + ModelState.AddModelError ( h, - string.Format( + string.Format ( "The file name {0} dosn't match an acceptable file name {1}", - hfc[h].FileName,fnre)) - ; - return View(collection); + hfc [h].FileName, fnre)); + return View (collection); } } - foreach (String h in hfc.AllKeys) - { + foreach (String h in hfc.AllKeys) { // TODO Limit with hfc[h].ContentLength - hfc[h].SaveAs(Path.Combine(FileSystemController.BaseDir,hfc[h].FileName)); + hfc [h].SaveAs (Path.Combine (FileSystemController.BaseDir, hfc [h].FileName)); } - if (Session["Basket"]==null) - Session["Basket"]=new List(); - List basket = Session["Basket"] as List; // Add specified product command to the basket, - basket.Add(Commande.Create(collection)); + GetBasket().Add (Commande.Create (collection)); + ViewData ["Message"] = LocalizedText.Item_added_to_basket; return View (collection); - } catch (Exception e) - { - ViewData ["Message"] = "Exception:"+e.Message; + } catch (Exception e) { + ViewData ["Message"] = "Exception:" + e.Message; return View (collection); } } + + ActionResult YourCommands () + { + return View (GetBasket()); + } } } diff --git a/web/Formatters/ErrorHtmlFormatter.cs b/web/Formatters/ErrorHtmlFormatter.cs index 2ea24977..8ae1441d 100644 --- a/web/Formatters/ErrorHtmlFormatter.cs +++ b/web/Formatters/ErrorHtmlFormatter.cs @@ -30,11 +30,29 @@ using System.Net; namespace Yavsc.Formatters { - + /// + /// Formats a given error message to respond + /// in case of error, and in an html format + /// public class ErrorHtmlFormatter:SimpleFormatter { + + /// + /// Gets or sets the title. + /// + /// The title. public string Title { get ; set; } + /// + /// Gets or sets the error code. + /// + /// The error code. public HttpStatusCode ErrorCode { get ; set; } + string doctype=""; + /// + /// Initializes a new instance of the class. + /// + /// Error code. + /// Title. public ErrorHtmlFormatter (HttpStatusCode errorCode, string title):base("text/html") { @@ -42,7 +60,13 @@ namespace Yavsc.Formatters Title = title; } - + /// + /// Writes to stream. + /// + /// Type. + /// Value. + /// Stream. + /// Content headers. public override void WriteToStream (Type type, object value, Stream stream, HttpContentHeaders contentHeaders) { // TODO create a type containing T4 parameters, and generate from them diff --git a/web/Formatters/RssFeedsFormatter.cs b/web/Formatters/RssFeedsFormatter.cs index 8eff9b6c..56983bf8 100644 --- a/web/Formatters/RssFeedsFormatter.cs +++ b/web/Formatters/RssFeedsFormatter.cs @@ -32,18 +32,28 @@ using System.Text; namespace Yavsc.Formatters { - + /// + /// Rss feeds formatter. + /// public class RssFeedsFormatter:SimpleFormatter { string doctype = ""; - + /// + /// Initializes a new instance of the class. + /// public RssFeedsFormatter () : base ("application/rss+xml") { } private const string dateformat = "ddd, dd MMM yyyy HH:mm:ss K"; - + /// + /// Writes to stream. + /// + /// Type. + /// Value. + /// Stream. + /// Content headers. public override void WriteToStream (Type type, object value, Stream stream, HttpContentHeaders contentHeaders) { RssFeedsChannel feeds = value as RssFeedsChannel; diff --git a/web/Helpers/Google/ApiClient.cs b/web/Helpers/Google/ApiClient.cs index 9d7808c7..3e7ac935 100644 --- a/web/Helpers/Google/ApiClient.cs +++ b/web/Helpers/Google/ApiClient.cs @@ -30,29 +30,48 @@ using Newtonsoft.Json; namespace Yavsc.Helpers.Google { - + /// + /// Google base API client. + /// This class implements the identification values for a Google Api, + /// and provides some scope values. + /// public class ApiClient { + /// + /// The CLIENT Id. + /// protected static string CLIENT_ID = "325408689282-6bekh7p3guj4k0f3301a6frf025cnrk1.apps.googleusercontent.com"; + /// + /// The CLIENt SECREt + /// protected static string CLIENT_SECRET = "MaxYcvJJCs2gDGvaELZbzwfL"; + + /// + /// The API KEY. + /// protected static string API_KEY="AIzaSyBV_LQHb22nGgjNvFzZwnQHjao3Q7IewRw"; /* // to use in descendence * protected static string getPeopleUri = "https://www.googleapis.com/plus/v1/people"; private static string authUri = "https://accounts.google.com/o/oauth2/auth"; */ - + /// + /// The Map tracks scope . + /// protected static string scopeTracks = "https://www.googleapis.com/auth/tracks"; + /// + /// The calendar scope. + /// protected static string scopeCalendar = "https://www.googleapis.com/auth/calendar"; + + /// + /// The scope openid. + /// protected static string[] scopeOpenid = { "openid", "profile", "email" }; - - // private static string dateFormat = "yyyy-MM-ddTHH:mm:ss"; - - } } diff --git a/web/Helpers/Google/CalendarApi.cs b/web/Helpers/Google/CalendarApi.cs index 95254888..1a02706f 100644 --- a/web/Helpers/Google/CalendarApi.cs +++ b/web/Helpers/Google/CalendarApi.cs @@ -31,14 +31,36 @@ using System.Web; namespace Yavsc.Helpers.Google { + /// + /// Google Calendar API client. + /// public class CalendarApi: ApiClient { + /// + /// The get cal list URI. + /// protected static string getCalListUri = "https://www.googleapis.com/calendar/v3/users/me/calendarList"; + /// + /// The get cal entries URI. + /// protected static string getCalEntriesUri = "https://www.googleapis.com/calendar/v3/calendars/{0}/events"; + /// + /// The date format. + /// private static string dateFormat = "yyyy-MM-ddTHH:mm:ss"; + + /// + /// The time zone. TODO Fixme with machine time zone + /// private string timeZone = "+01:00"; + /// + /// Gets the calendar list. + /// + /// The calendars. + /// Cred. + /// Json. public CalendarList GetCalendars (string cred, out string json) { CalendarList res = null; @@ -59,6 +81,15 @@ namespace Yavsc.Helpers.Google return res; } + /// + /// Gets a calendar. + /// + /// The calendar. + /// Calid. + /// Mindate. + /// Maxdate. + /// Upr. + /// Response string. public CalendarEntryList GetCalendar (string calid, DateTime mindate, DateTime maxdate, ProfileBase upr, out string responseStr) { string uri = string.Format ( diff --git a/web/Helpers/Google/EntityQuery.cs b/web/Helpers/Google/EntityQuery.cs index 7059216b..9b393e7f 100644 --- a/web/Helpers/Google/EntityQuery.cs +++ b/web/Helpers/Google/EntityQuery.cs @@ -30,9 +30,17 @@ using Newtonsoft.Json; namespace Yavsc.Helpers.Google { - + /// + /// Entity query. + /// public class EntityQuery { + /// + /// The entity identifiers. + /// public string [] EntityIds; + /// + /// The minimum identifier. + /// public string MinId; } } diff --git a/web/Helpers/Google/MapTracks.cs b/web/Helpers/Google/MapTracks.cs index 2aaf89b7..388e40c2 100644 --- a/web/Helpers/Google/MapTracks.cs +++ b/web/Helpers/Google/MapTracks.cs @@ -29,8 +29,14 @@ using Newtonsoft.Json; namespace Yavsc.Helpers.Google { - + /// + /// Google Map tracks Api client. + /// public class MapTracks:ApiClient { + + /// + /// The google map tracks path (uri of the service). + /// protected static string googleMapTracksPath = "https://www.googleapis.com/tracks/v1/"; // entities/[create|list|delete] // collections/[list|create|[add|remove]entities|delete] @@ -41,8 +47,12 @@ namespace Yavsc.Helpers.Google // collections/[list|create|[add|remove]entities|delete] // crumbs/[record|getrecent|gethistory|report|summarize|getlocationinfo|delete - - static string [] CreateEntity( Entity[] entities ) { + /// + /// Creates the entity. + /// + /// The entity. + /// Entities. + public static string [] CreateEntity( Entity[] entities ) { string [] ans = null; using (SimpleJsonPostMethod< Entity[] ,string []> wr = new SimpleJsonPostMethod< Entity[] ,string[]> (googleMapTracksPath + "entities/create")) @@ -51,6 +61,12 @@ namespace Yavsc.Helpers.Google } return ans; } + + /// + /// Lists the entities. + /// + /// The entities. + /// Eq. static Entity[] ListEntities (EntityQuery eq) { Entity [] ans = null; diff --git a/web/Helpers/Google/OAuth2.cs b/web/Helpers/Google/OAuth2.cs index 7f01d100..76e79948 100644 --- a/web/Helpers/Google/OAuth2.cs +++ b/web/Helpers/Google/OAuth2.cs @@ -30,11 +30,18 @@ using Yavsc.Model; namespace Yavsc.Helpers.Google { - + /// + /// Google People API. + /// public class PeopleApi: ApiClient { private static string getPeopleUri = "https://www.googleapis.com/plus/v1/people"; + /// + /// Gets the People object associated to the given Google Access Token + /// + /// The me. + /// The Google Access Token object class. public static People GetMe (AuthToken gat) { People me; @@ -57,13 +64,31 @@ namespace Yavsc.Helpers.Google } } + /// + /// Google O auth2 client. + /// public class OAuth2:ApiClient { + /// + /// The URI used to get tokens. + /// protected static string tokenUri = "https://accounts.google.com/o/oauth2/token"; + + /// + /// The URI used to get authorized to. + /// protected static string authUri = "https://accounts.google.com/o/oauth2/auth"; + /// + /// Gets or sets the redirect URI sent to Google. + /// + /// The redirect URI. public string RedirectUri { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// Redirect URI. public OAuth2 (string redirectUri) { RedirectUri = redirectUri; @@ -84,7 +109,11 @@ namespace Yavsc.Helpers.Google CLIENT_ID, RedirectUri, scope, state); GetAuthResponse (bresp, prms); } - + /// + /// Gets the cal authorization. + /// + /// Bresp. + /// State. public void GetCalAuth (HttpResponseBase bresp, string state) { string scope = string.Join ("%20", scopeOpenid); @@ -130,7 +159,13 @@ namespace Yavsc.Helpers.Google HttpUtility.UrlEncode (code)); return postdata; } - + /// + /// Gets the Google Authorization token. + /// + /// The token. + /// Rq. + /// State. + /// Message. public AuthToken GetToken (HttpRequestBase rq, string state, out string message) { string code = OAuth2.GetCodeFromRequest (rq, state, out message); @@ -138,12 +173,6 @@ namespace Yavsc.Helpers.Google return GetTokenPosting (postdata); } - [Obsolete ("Use GetToken instead.")] - public static AuthToken GetTokenFromBody (string postdata) - { - throw new NotImplementedException (); - } - internal static AuthToken GetTokenPosting (string postdata) { HttpWebRequest webreq = WebRequest.CreateHttp (tokenUri); @@ -174,6 +203,13 @@ namespace Yavsc.Helpers.Google return gat; } + /// + /// Gets the code from the Google request. + /// + /// The code from request. + /// Rq. + /// State. + /// Message. public static string GetCodeFromRequest (HttpRequestBase rq, string state, out string message) { message = ""; @@ -194,6 +230,11 @@ namespace Yavsc.Helpers.Google return code; } + /// + /// Gets fresh google credential. + /// + /// The fresh google credential. + /// Pr. public static string GetFreshGoogleCredential (ProfileBase pr) { string token = (string)pr.GetPropertyValue ("gtoken"); diff --git a/web/Helpers/SimpleJsonPostMethod.cs b/web/Helpers/SimpleJsonPostMethod.cs index 3f34713a..5073c649 100644 --- a/web/Helpers/SimpleJsonPostMethod.cs +++ b/web/Helpers/SimpleJsonPostMethod.cs @@ -97,14 +97,10 @@ namespace Yavsc.Helpers } #region IDisposable implementation + /// - /// Releases all resource used by the object. + /// Releases all resource used by the Yavsc.Helpers.SimpleJsonPostMethod object. /// - /// Call when you are finished using the . The - /// method leaves the in an unusable state. - /// After calling , you must release all references to the - /// so the garbage collector can reclaim the memory that the - /// was occupying. public void Dispose () { if (Request != null) Request.Abort (); diff --git a/web/Settings/ModuleConfigurationElement.cs b/web/Settings/ModuleConfigurationElement.cs index 0d9f8a40..aeb4c166 100644 --- a/web/Settings/ModuleConfigurationElement.cs +++ b/web/Settings/ModuleConfigurationElement.cs @@ -23,12 +23,21 @@ using System.Configuration; namespace Yavsc.Settings { + /// + /// Module configuration element. (NOTUSED) + /// public class ModuleConfigurationElement : ConfigurationElement { + /// + /// Initializes a new instance of the class. + /// public ModuleConfigurationElement () { } - + /// + /// Gets or sets the name of the module. + /// + /// The name. [ConfigurationProperty("name", IsKey=true, IsRequired=true)] public string Name { get { @@ -36,7 +45,10 @@ namespace Yavsc.Settings } set { base ["name"] = value; } } - + /// + /// Gets or sets the name of the class. + /// + /// The name of the class. [ConfigurationProperty("name", IsKey=true, IsRequired=true)] public string ClassName { get { diff --git a/web/Settings/ModulesConfigurationSection.cs b/web/Settings/ModulesConfigurationSection.cs index f4b9af45..221739d8 100644 --- a/web/Settings/ModulesConfigurationSection.cs +++ b/web/Settings/ModulesConfigurationSection.cs @@ -23,8 +23,15 @@ using System.Configuration; namespace Yavsc.Settings { + /// + /// Modules configuration section. + /// This class is not yet used ... + /// public class ModulesConfigurationSection : ConfigurationSection { + /// + /// Initializes a new instance of the class. + /// public ModulesConfigurationSection () { } diff --git a/web/Settings/ThanksConfigurationCollection.cs b/web/Settings/ThanksConfigurationCollection.cs index d97460a7..426969bf 100644 --- a/web/Settings/ThanksConfigurationCollection.cs +++ b/web/Settings/ThanksConfigurationCollection.cs @@ -3,16 +3,35 @@ using System.Configuration; namespace Yavsc { + /// + /// Thanks configuration collection. + /// Imlements the configuration, + /// providing the thanks collection + /// public class ThanksConfigurationCollection : ConfigurationElementCollection { + /// + /// Gets the element key. + /// + /// The element key. + /// Element. protected override object GetElementKey (ConfigurationElement element) { return ((ThanksConfigurationElement) element).Name; } + /// + /// Creates the new element. + /// + /// The new element. protected override ConfigurationElement CreateNewElement () { return new ThanksConfigurationElement(); } + /// + /// Gets the element. + /// + /// The element. + /// Name. public ThanksConfigurationElement GetElement (string name) { return this.BaseGet(name) as ThanksConfigurationElement; diff --git a/web/Settings/ThanksHelper.cs b/web/Settings/ThanksHelper.cs index 7d76b66d..ff07bee8 100644 --- a/web/Settings/ThanksHelper.cs +++ b/web/Settings/ThanksHelper.cs @@ -4,8 +4,16 @@ using System.Collections.Generic; namespace Yavsc { + /// + /// Thanks helper. + /// public static class ThanksHelper { - static private ThanksConfigurationSection configurationSection=null; + + static private ThanksConfigurationSection configurationSection=null; + /// + /// Gets the configuration section. + /// + /// The configuration section. static public ThanksConfigurationSection ConfigurationSection { get { if (configurationSection==null) @@ -13,7 +21,9 @@ namespace Yavsc return configurationSection; } } - + /// + /// Html code for each entry + /// public static string[] Links () { List result = new List() ; diff --git a/web/Views/FrontOffice/Command.aspx b/web/Views/FrontOffice/Command.aspx index 0658cd52..57569e5e 100644 --- a/web/Views/FrontOffice/Command.aspx +++ b/web/Views/FrontOffice/Command.aspx @@ -1,4 +1,12 @@ <%@ Page Title="Commande" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %> -rha + + + +
  • + <%= Html.ActionLink("Catalog","Catalog" ) %> +
  • + <%= Html.ActionLink("Estimates","Estimates" ) %> +
+
\ No newline at end of file diff --git a/web/templates/TexEstimInit.cs b/web/templates/TexEstimInit.cs index ea25eee4..72a3f9fd 100644 --- a/web/templates/TexEstimInit.cs +++ b/web/templates/TexEstimInit.cs @@ -24,6 +24,9 @@ namespace Yavsc.templates { public partial class Estim { + /// + /// Inits this instance. + /// public void Init () { this.Initialize(); diff --git a/yavscModel/FrontOffice/Basket.cs b/yavscModel/FrontOffice/Basket.cs new file mode 100644 index 00000000..23f8d79d --- /dev/null +++ b/yavscModel/FrontOffice/Basket.cs @@ -0,0 +1,35 @@ +// +// Basket.cs +// +// Author: +// Paul Schneider +// +// Copyright (c) 2015 Paul Schneider +// +// 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.Collections.Generic; +using Yavsc.Model.WorkFlow; + +namespace Yavsc.Model.FrontOffice +{ + public class Basket: List + { + public Basket () + { + } + + } +} + diff --git a/yavscModel/WorkFlow/Commande.cs b/yavscModel/FrontOffice/Commande.cs similarity index 83% rename from yavscModel/WorkFlow/Commande.cs rename to yavscModel/FrontOffice/Commande.cs index 1ca2d31b..0946b92f 100644 --- a/yavscModel/WorkFlow/Commande.cs +++ b/yavscModel/FrontOffice/Commande.cs @@ -3,9 +3,10 @@ using Yavsc; using SalesCatalog; using SalesCatalog.Model; using System.Collections.Specialized; +using Yavsc.Model.WorkFlow; -namespace Yavsc.Model.WorkFlow +namespace Yavsc.Model.FrontOffice { public class Commande { @@ -19,7 +20,7 @@ namespace Yavsc.Model.WorkFlow { Commande cmd = new Commande (); // string catref=collection["catref"]; // Catalog Url from which formdata has been built - cmd.ProdRef=collection["prodref"]; // Required product reference + cmd.ProdRef=collection["ref"]; // Required product reference cmd.CreationDate = DateTime.Now; WorkFlowManager wm = new WorkFlowManager (); wm.RegisterCommand (cmd); // sets cmd.Id diff --git a/yavscModel/LocalizedText.Designer.cs b/yavscModel/LocalizedText.Designer.cs index fe05112f..5b1cebf9 100644 --- a/yavscModel/LocalizedText.Designer.cs +++ b/yavscModel/LocalizedText.Designer.cs @@ -52,6 +52,12 @@ namespace Yavsc.Model { } } + public static string Item_added_to_basket { + get { + return ResourceManager.GetString("Item_added_to_basket", resourceCulture); + } + } + public static string Unitary_cost { get { return ResourceManager.GetString("Unitary_cost", resourceCulture); diff --git a/yavscModel/LocalizedText.fr.resx b/yavscModel/LocalizedText.fr.resx index 73c7fc00..70b98371 100644 --- a/yavscModel/LocalizedText.fr.resx +++ b/yavscModel/LocalizedText.fr.resx @@ -45,5 +45,5 @@ Il n'y avait pas 'utilisateur dans le rôle '{1}'. Vous ({0}) avez été ajouté au rôle '{1}'. Vous n'êtes pas administrateur Rôle créé - + Article ajouté au panier diff --git a/yavscModel/LocalizedText.resx b/yavscModel/LocalizedText.resx index aefc294b..6a3537a1 100644 --- a/yavscModel/LocalizedText.resx +++ b/yavscModel/LocalizedText.resx @@ -45,4 +45,5 @@ There was no user in the '{1}' role. You ({0}) was just added as firt user in the '{1}' role. You're not administrator role created + Item added to basket diff --git a/yavscModel/WorkFlow/BasketImpact.cs b/yavscModel/WorkFlow/BasketImpact.cs deleted file mode 100644 index 82211d33..00000000 --- a/yavscModel/WorkFlow/BasketImpact.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; - -namespace Yavsc.Model.WorkFlow -{ - - public class BasketImpact - { - public string ProductRef { get; set; } - public int Count { get; set; } - public string Message { get; set; } - } - -} diff --git a/yavscModel/WorkFlow/IContentProvider.cs b/yavscModel/WorkFlow/IContentProvider.cs index f97d8b74..74737c65 100644 --- a/yavscModel/WorkFlow/IContentProvider.cs +++ b/yavscModel/WorkFlow/IContentProvider.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Web.Mvc; +using Yavsc.Model.FrontOffice; namespace Yavsc.Model.WorkFlow { diff --git a/yavscModel/WorkFlow/IWFModule.cs b/yavscModel/WorkFlow/IWFModule.cs deleted file mode 100644 index b0f31efa..00000000 --- a/yavscModel/WorkFlow/IWFModule.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using Yavsc.Model.WorkFlow; -using System.Web.Mvc; - -namespace Yavsc.Model.WorkFlow -{ - public interface IWFModule - { - /// - /// Gets the state for an order (assuming it was passed to Handle). - /// - /// The state. - /// C. - int GetState (IWFOrder c); - /// - /// Handle the specified order and form input value collection. - /// - /// l'ordre - /// La collection de valeur de champs d'entée de formulaires. - /// 0 when the module accepts to handle the order, non null value otherwize - int Handle (IWFOrder order,FormCollection collection); - - } -} - diff --git a/yavscModel/WorkFlow/IWFOrder.cs b/yavscModel/WorkFlow/IWFOrder.cs deleted file mode 100644 index 9ba4bbf6..00000000 --- a/yavscModel/WorkFlow/IWFOrder.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Yavsc.Model.WorkFlow -{ - public interface IWFOrder - { - /// - /// Gets the unique Identifier for this order, in this application. - /// - /// The unique I. - long UniqueID { - get; - } - /// - /// Gets the actual status for this order. - /// - /// The status. - string GetStatus(); - } -} - diff --git a/yavscModel/WorkFlow/WorkFlowManager.cs b/yavscModel/WorkFlow/WorkFlowManager.cs index 5e502b56..d9014dc8 100644 --- a/yavscModel/WorkFlow/WorkFlowManager.cs +++ b/yavscModel/WorkFlow/WorkFlowManager.cs @@ -4,6 +4,7 @@ using System.Configuration; using Yavsc.Model.WorkFlow.Configuration; using System.Collections.Specialized; using SalesCatalog.Model; +using Yavsc.Model.FrontOffice; namespace Yavsc.Model.WorkFlow { diff --git a/yavscModel/YavscModel.csproj b/yavscModel/YavscModel.csproj index 119fec0c..b2ddb0f6 100644 --- a/yavscModel/YavscModel.csproj +++ b/yavscModel/YavscModel.csproj @@ -58,10 +58,7 @@ - - - @@ -70,8 +67,6 @@ - - @@ -102,6 +97,8 @@ + + @@ -111,6 +108,7 @@ +