From ae38718dd9392a1fd345fc8b6709480dd8de829d Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Tue, 27 Jan 2015 00:41:20 +0100 Subject: [PATCH] * Makefile: builds the doc & htmldoc folders * DataManager.cs: Doc generations * T.cs: * Global.asax.cs: * Export.cs: * Estim.tt: * Estim.cs: * TaskOutput.cs: * FileInfoCollection.cs: * RegisterPage.cs: * BBCodeHelper.cs: * MvcActionValueBinder.cs: * YavscHelpers.cs: * ValidateAjaxAttribute.cs: * Entity.cs: * IOrderInfo.cs: * HomeController.cs: * SimpleFormatter.cs: * BlogsController.cs: * AdminController.cs: * SimpleJsonPostMethod.cs: * WebCatalogExtensions.cs: * GoogleController.cs: * ModuleController.cs: * BasketController.cs: * AccountController.cs: * TemplateException.cs: * BlogsApiController.cs: * EstimToPdfFormatter.cs: * WorkFlowController.cs: * FileSystemController.cs: * BackOfficeController.cs: * FrontOfficeController.cs: * ThanksConfigurationSection.cs: * ThanksConfigurationElement.cs: * FrontOfficeApiController.cs: * ModuleConfigurationElementCollection.cs: * Web.csproj: cleaning an obsolete IOrderIfno --- Makefile | 8 + web/Admin/DataManager.cs | 33 ++- web/Admin/Export.cs | 10 + web/Admin/TaskOutput.cs | 15 ++ web/CatExts/WebCatalogExtensions.cs | 20 +- web/Controllers/AccountController.cs | 74 +++++- web/Controllers/AdminController.cs | 72 +++++- web/Controllers/BackOfficeController.cs | 6 + web/Controllers/BasketController.cs | 19 +- web/Controllers/BlogsApiController.cs | 23 +- web/Controllers/BlogsController.cs | 80 ++++++- web/Controllers/FileSystemController.cs | 53 ++++- web/Controllers/FrontOfficeApiController.cs | 68 +++--- web/Controllers/FrontOfficeController.cs | 54 +++-- web/Controllers/GoogleController.cs | 46 +++- web/Controllers/HomeController.cs | 19 +- web/Controllers/IOrderInfo.cs | 37 --- web/Controllers/ModuleController.cs | 11 +- web/Controllers/TemplateException.cs | 1 - web/Controllers/WorkFlowController.cs | 41 +++- web/FileInfoCollection.cs | 7 + web/Formatters/EstimToPdfFormatter.cs | 26 ++- web/Formatters/SimpleFormatter.cs | 27 ++- web/Global.asax.cs | 14 +- web/Helpers/BBCodeHelper.cs | 27 ++- web/Helpers/Google/Entity.cs | 18 +- web/Helpers/SimpleJsonPostMethod.cs | 30 ++- web/Helpers/T.cs | 8 + web/Helpers/YavscHelpers.cs | 7 + web/MvcActionValueBinder.cs | 8 + .../ModuleConfigurationElementCollection.cs | 17 +- web/Settings/ThanksConfigurationElement.cs | 17 +- web/Settings/ThanksConfigurationSection.cs | 17 +- web/ValidateAjaxAttribute.cs | 12 + web/Views/RegisterPage.cs | 16 +- web/Web.csproj | 2 +- web/templates/Estim.cs | 213 +++++++++--------- web/templates/Estim.tt | 1 - 38 files changed, 864 insertions(+), 293 deletions(-) delete mode 100644 web/Controllers/IOrderInfo.cs diff --git a/Makefile b/Makefile index 9a03daf2..b4ecf4f8 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,8 @@ LOCALHOSTDIR=localhost:/srv/www/lua TESTHOSTDIR=localhost:/srv/www/yavsc PREPRODHOSTDIR=lua.localdomain:/srv/yavsc PRODHOSTDIR=lua.localdomain:/srv/www/lua +DOCASSBS=NpgsqlBlogProvider.dll WorkFlowProvider.dll Yavsc.WebControls.dll ITContentProvider.dll NpgsqlMRPProviders.dll Yavsc.dll SalesCatalog.dll YavscModel.dll + all: deploy ddir: @@ -46,3 +48,9 @@ sourcepkg: debug: build (cd web; export MONO_OPTIONS=--debug; xsp4 --port 8080) +xmldoc: build + (cd web/bin; monodocer -pretty -o ../xmldoc $(DOCASSBS)) + +htmldoc: xmldoc + (cd web; monodocs2html -o htmldoc xmldoc) + diff --git a/web/Admin/DataManager.cs b/web/Admin/DataManager.cs index 5a3160a5..76d33937 100644 --- a/web/Admin/DataManager.cs +++ b/web/Admin/DataManager.cs @@ -7,13 +7,24 @@ using System.Resources; namespace Yavsc.Admin { + /// + /// Data manager. + /// public class DataManager { DataAccess da; + /// + /// Initializes a new instance of the class. + /// + /// Datac. public DataManager (DataAccess datac) { da = datac; } + /// + /// Creates the backup. + /// + /// The backup. public Export CreateBackup () { Environment.SetEnvironmentVariable("PGPASSWORD", da.Password); @@ -51,6 +62,11 @@ namespace Yavsc.Admin p.Close (); } } + /// + /// Restore the specified fileName and dataOnly. + /// + /// File name. + /// If set to true data only. public TaskOutput Restore (string fileName, bool dataOnly) { Environment.SetEnvironmentVariable("PGPASSWORD", da.Password); @@ -65,7 +81,10 @@ namespace Yavsc.Admin */ return t; } - + /// + /// Creates the db. + /// + /// The db. public TaskOutput CreateDb () { TaskOutput res = new TaskOutput (); @@ -97,7 +116,12 @@ namespace Yavsc.Admin return res; } - + /// + /// Tags the backup. + /// + /// The backup. + /// Filename. + /// Tags. public Export TagBackup (string filename, string [] tags) { /* FileInfo fi = new FileInfo (filename); @@ -106,6 +130,11 @@ namespace Yavsc.Admin } */ throw new NotImplementedException (); } + /// + /// Tags the restore. + /// + /// The restore. + /// File name. public TaskOutput TagRestore (string fileName) { Environment.SetEnvironmentVariable ("PGPASSWORD", da.Password); diff --git a/web/Admin/Export.cs b/web/Admin/Export.cs index 046512f7..6b3256de 100644 --- a/web/Admin/Export.cs +++ b/web/Admin/Export.cs @@ -3,11 +3,21 @@ using System.ComponentModel; namespace Yavsc.Admin { + /// + /// Export. + /// public class Export: TaskOutput { + /// + /// Initializes a new instance of the class. + /// public Export () { } + /// + /// Gets or sets the name of the file. + /// + /// The name of the file. public string FileName { get; set; } } } diff --git a/web/Admin/TaskOutput.cs b/web/Admin/TaskOutput.cs index b84225ab..078099bd 100644 --- a/web/Admin/TaskOutput.cs +++ b/web/Admin/TaskOutput.cs @@ -3,9 +3,24 @@ using System.ComponentModel; namespace Yavsc.Admin { + /// + /// Task output. + /// public class TaskOutput { + /// + /// Gets or sets the message. + /// + /// The message. public string Message { get; set; } + /// + /// Gets or sets the error. + /// + /// The error. public string Error { get; set; } + /// + /// Gets or sets the exit code. + /// + /// The exit code. public int ExitCode { get; set; } } diff --git a/web/CatExts/WebCatalogExtensions.cs b/web/CatExts/WebCatalogExtensions.cs index 01e07b9f..b7679832 100644 --- a/web/CatExts/WebCatalogExtensions.cs +++ b/web/CatExts/WebCatalogExtensions.cs @@ -9,8 +9,18 @@ using System.Web.Mvc.Html; namespace Yavsc.CatExts { + /// + /// Web catalog extensions. + /// public static class WebCatalogExtensions { + /// + /// Commands the form. + /// + /// The form. + /// Helper. + /// Position. + /// Atc. public static string CommandForm(this HtmlHelper helper, Product pos,string atc="Add to backet") { StringBuilder sb = new StringBuilder (); sb.Append (helper.ValidationSummary ()); @@ -43,6 +53,13 @@ namespace Yavsc.CatExts sb.Append (ft.ToString ()); return sb.ToString (); } + /// + /// Commands the form. + /// + /// The form. + /// Helper. + /// Position. + /// Atc. public static string CommandForm(this HtmlHelper helper, Product pos,string atc="Add to backet") { StringBuilder sb = new StringBuilder (); sb.Append (helper.ValidationSummary ()); @@ -72,9 +89,6 @@ namespace Yavsc.CatExts sb.Append (ft.ToString ()); return sb.ToString (); } - - - } } diff --git a/web/Controllers/AccountController.cs b/web/Controllers/AccountController.cs index bf62d12b..70b0ae3f 100644 --- a/web/Controllers/AccountController.cs +++ b/web/Controllers/AccountController.cs @@ -15,6 +15,9 @@ using Yavsc.Helpers; namespace Yavsc.Controllers { + /// + /// Account controller. + /// public class AccountController : Controller { private static string registrationMessage = @@ -25,7 +28,7 @@ namespace Yavsc.Controllers /// /// Gets or sets the avatar dir. /// This value is past to Server.MapPath, - /// it should start with ~/, and we assume it + /// it should start with ~/, and we assume it /// to be relative to the application path. /// /// The avatar dir. @@ -33,18 +36,28 @@ namespace Yavsc.Controllers get { return avatarDir; } set { avatarDir = value; } } - + /// + /// Index this instance. + /// public ActionResult Index () { return View (); } - + /// + /// Login the specified returnUrl. + /// + /// Return URL. public ActionResult Login (string returnUrl) { ViewData ["returnUrl"] = returnUrl; return View (); } + /// + /// Gets the profile. + /// + /// The profile. + /// User. public static Profile GetProfile (string user) { return new Profile (ProfileBase.Create (user)); @@ -52,6 +65,12 @@ namespace Yavsc.Controllers // TODO [ValidateAntiForgeryToken] + /// + /// Dos the login. + /// + /// The login. + /// Model. + /// Return URL. public ActionResult DoLogin (LoginModel model, string returnUrl) { if (ModelState.IsValid) { @@ -71,7 +90,11 @@ namespace Yavsc.Controllers // If we got this far, something failed, redisplay form return View ("Login", model); } - + /// + /// Register the specified model and returnUrl. + /// + /// Model. + /// Return URL. public ActionResult Register (RegisterViewModel model, string returnUrl) { ViewData ["returnUrl"] = returnUrl; @@ -151,19 +174,29 @@ namespace Yavsc.Controllers } return View (model); } - + /// + /// Changes the password success. + /// + /// The password success. public ActionResult ChangePasswordSuccess () { return View (); } - + + /// + /// Changes the password. + /// + /// The password. [HttpGet] [Authorize] public ActionResult ChangePassword () { return View (); } - + /// + /// Unregister the specified confirmed. + /// + /// If set to true confirmed. [Authorize] public ActionResult Unregister (bool confirmed = false) { @@ -175,6 +208,12 @@ namespace Yavsc.Controllers return RedirectToAction ("Index", "Home"); } + + /// + /// Changes the password. + /// + /// The password. + /// Model. [Authorize] [HttpPost] public ActionResult ChangePassword (ChangePasswordModel model) @@ -210,7 +249,10 @@ namespace Yavsc.Controllers return View (model); } - + /// + /// Profile the specified model. + /// + /// Model. [Authorize] [HttpGet] public ActionResult Profile (Profile model) @@ -222,9 +264,13 @@ namespace Yavsc.Controllers return View (model); } + /// + /// Profile the specified model and AvatarFile. + /// + /// Model. + /// Avatar file. [Authorize] [HttpPost] - //public ActionResult UpdateProfile(HttpPostedFileBase Avatar, string Address, string CityAndState, string ZipCode, string Country, string WebSite) public ActionResult Profile (Profile model, HttpPostedFileBase AvatarFile) { string username = Membership.GetUser ().UserName; @@ -275,6 +321,10 @@ namespace Yavsc.Controllers return View (model); } + /// + /// Logout the specified returnUrl. + /// + /// Return URL. [Authorize] public ActionResult Logout (string returnUrl) { @@ -283,7 +333,11 @@ namespace Yavsc.Controllers } - + /// + /// Validate the specified id and key. + /// + /// Identifier. + /// Key. [HttpGet] public ActionResult Validate (string id, string key) { diff --git a/web/Controllers/AdminController.cs b/web/Controllers/AdminController.cs index 27fe3af4..3710770d 100644 --- a/web/Controllers/AdminController.cs +++ b/web/Controllers/AdminController.cs @@ -20,6 +20,9 @@ namespace Yavsc.Controllers /// public class AdminController : Controller { + /// + /// Index this instance. + /// public ActionResult Index() { if (!Roles.RoleExists (adminRoleName)) { @@ -27,7 +30,12 @@ namespace Yavsc.Controllers } return View (); } - + /// + /// Inits the db. + /// + /// The db. + /// Datac. + /// Do init. public ActionResult InitDb(DataAccess datac, string doInit) { if (doInit=="on") { @@ -41,13 +49,21 @@ namespace Yavsc.Controllers } return View (); } + /// + /// Backups the specified model. + /// + /// Model. [Authorize(Roles="Admin")] public ActionResult Backups(DataAccess model) { return View (model); } - + /// + /// Creates the backup. + /// + /// The backup. + /// Datac. [Authorize(Roles="Admin")] public ActionResult CreateBackup(DataAccess datac) { @@ -67,18 +83,31 @@ namespace Yavsc.Controllers } return View (datac); } - + /// + /// Creates the user backup. + /// + /// The user backup. + /// Datac. + /// Username. [Authorize(Roles="Admin")] public ActionResult CreateUserBackup(DataAccess datac,string username) { throw new NotImplementedException(); } - + /// + /// Upgrade the specified datac. + /// + /// Datac. [Authorize(Roles="Admin")] public ActionResult Upgrade(DataAccess datac) { throw new NotImplementedException(); } - + /// + /// Restore the specified datac, backupName and dataOnly. + /// + /// Datac. + /// Backup name. + /// If set to true data only. [Authorize(Roles="Admin")] public ActionResult Restore(DataAccess datac,string backupName,bool dataOnly=true) { @@ -108,14 +137,25 @@ namespace Yavsc.Controllers bks.Add (ti.Name); ViewData ["Backups"] = bks.ToArray (); } - + /// + /// Removes from role. + /// + /// The from role. + /// Username. + /// Rolename. + /// Return URL. [Authorize(Roles="Admin")] public ActionResult RemoveFromRole(string username, string rolename, string returnUrl) { Roles.RemoveUserFromRole(username,rolename); return Redirect(returnUrl); } - + /// + /// Removes the user. + /// + /// The user. + /// Username. + /// Submitbutton. [Authorize(Roles="Admin")] public ActionResult RemoveUser (string username, string submitbutton) { @@ -126,6 +166,12 @@ namespace Yavsc.Controllers } return RedirectToAction("UserList"); } + /// + /// Removes the role. + /// + /// The role. + /// Rolename. + /// Submitbutton. [Authorize(Roles="Admin")] public ActionResult RemoveRole (string rolename, string submitbutton) { @@ -135,14 +181,22 @@ namespace Yavsc.Controllers } return RedirectToAction("RoleList"); } - + /// + /// Removes the role query. + /// + /// The role query. + /// Rolename. [Authorize(Roles="Admin")] public ActionResult RemoveRoleQuery(string rolename) { ViewData["roletoremove"] = rolename; return View (); } - + /// + /// Removes the user query. + /// + /// The user query. + /// Username. [Authorize(Roles="Admin")] public ActionResult RemoveUserQuery(string username) { diff --git a/web/Controllers/BackOfficeController.cs b/web/Controllers/BackOfficeController.cs index c005838a..882a61a2 100644 --- a/web/Controllers/BackOfficeController.cs +++ b/web/Controllers/BackOfficeController.cs @@ -8,8 +8,14 @@ using Yavsc.Admin; namespace Yavsc.Controllers { + /// + /// Back office controller. + /// public class BackOfficeController : Controller { + /// + /// Index this instance. + /// [Authorize(Roles="Admin,Providers")] public ActionResult Index() { diff --git a/web/Controllers/BasketController.cs b/web/Controllers/BasketController.cs index 57e9503a..8b858533 100644 --- a/web/Controllers/BasketController.cs +++ b/web/Controllers/BasketController.cs @@ -8,10 +8,19 @@ using Yavsc.Model.WorkFlow; namespace Yavsc.ApiControllers { - // TODO should mostly be an API Controller + /// + /// Basket controller. + /// 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); @@ -44,6 +53,10 @@ namespace Yavsc.ApiControllers throw new NotImplementedException (); } + /// + /// Yours the estimates. + /// + /// The estimates. [HttpGet] [Authorize] public Estimate[] YourEstimates() @@ -52,6 +65,10 @@ namespace Yavsc.ApiControllers Membership.GetUser().UserName); } + /// + /// Order the specified bi. + /// + /// Bi. [HttpGet] public object Order (BasketImpact bi) { diff --git a/web/Controllers/BlogsApiController.cs b/web/Controllers/BlogsApiController.cs index 1ad9763a..04620933 100644 --- a/web/Controllers/BlogsApiController.cs +++ b/web/Controllers/BlogsApiController.cs @@ -9,10 +9,17 @@ using Yavsc.Model.Blogs; namespace Yavsc.ApiControllers { + /// + /// Blogs API controller. + /// public class BlogsApiController : ApiController { private const string adminRoleName = "Admin"; + /// + /// Initialize the specified controllerContext. + /// + /// Controller context. protected override void Initialize (System.Web.Http.Controllers.HttpControllerContext controllerContext) { base.Initialize (controllerContext); @@ -21,6 +28,11 @@ namespace Yavsc.ApiControllers } } + /// + /// Tag the specified postid and tag. + /// + /// Postid. + /// Tag. public long Tag (long postid,string tag) { BlogEntry e = BlogManager.GetPost (postid); if (!Roles.IsUserInRole ("Admin")) { @@ -34,7 +46,11 @@ namespace Yavsc.ApiControllers } return BlogManager.Tag (postid, tag); } - + /// + /// Removes the post. + /// + /// User. + /// Title. public static void RemovePost(string user, string title) { if (!Roles.IsUserInRole ("Admin")) { string rguser = Membership.GetUser ().UserName; @@ -53,7 +69,10 @@ namespace Yavsc.ApiControllers } BlogManager.RemovePost (user, title); } - + /// + /// Removes the tag. + /// + /// Tagid. public void RemoveTag(long tagid) { throw new NotImplementedException (); } diff --git a/web/Controllers/BlogsController.cs b/web/Controllers/BlogsController.cs index d95df3b4..d2185855 100644 --- a/web/Controllers/BlogsController.cs +++ b/web/Controllers/BlogsController.cs @@ -22,6 +22,9 @@ using System.Net; namespace Yavsc.Controllers { + /// + /// Blogs controller. + /// public class BlogsController : Controller { string defaultAvatarMimetype; @@ -29,11 +32,17 @@ namespace Yavsc.Controllers WebConfigurationManager.AppSettings ["Name"]; string avatarDir = "~/avatars"; + /// + /// Gets or sets the avatar dir. + /// + /// The avatar dir. public string AvatarDir { get { return avatarDir; } set { avatarDir = value; } } - + /// + /// Initializes a new instance of the class. + /// public BlogsController () { string[] defaultAvatarSpec = ConfigurationManager.AppSettings.Get ("DefaultAvatar").Split (';'); @@ -42,7 +51,13 @@ namespace Yavsc.Controllers defaultAvatar = defaultAvatarSpec [0]; defaultAvatarMimetype = defaultAvatarSpec [1]; } - + /// + /// Index the specified user, title, pageIndex and pageSize. + /// + /// User. + /// Title. + /// Page index. + /// Page size. public ActionResult Index (string user = null, string title = null, int pageIndex=0, int pageSize=10) { if (string.IsNullOrEmpty (user)) { @@ -64,7 +79,12 @@ namespace Yavsc.Controllers } } - + /// + /// Blogs the list. + /// + /// The list. + /// Page index. + /// Page size. public ActionResult BlogList (int pageIndex = 0, int pageSize = 10) { ViewData ["SiteName"] = sitename; @@ -75,7 +95,13 @@ namespace Yavsc.Controllers ViewData ["PageIndex"] = pageIndex; return View ("Index", bs); } - + /// + /// Users the posts. + /// + /// The posts. + /// User. + /// Page index. + /// Page size. [HttpGet] public ActionResult UserPosts (string user, int pageIndex = 0, int pageSize = 10) { @@ -97,7 +123,11 @@ namespace Yavsc.Controllers return View ("UserPosts", c); } - + /// + /// Removes the comment. + /// + /// The comment. + /// Cmtid. [Authorize] public ActionResult RemoveComment(long cmtid) { @@ -138,7 +168,12 @@ namespace Yavsc.Controllers ViewData ["Comments"] = BlogManager.GetComments (e.Id); return View ("UserPost", e); } - + /// + /// Users the post. + /// + /// The post. + /// User. + /// Title. public ActionResult UserPost (string user, string title) { ViewData ["BlogUser"] = user; @@ -152,7 +187,11 @@ namespace Yavsc.Controllers string prevstr = LocalizedText.Preview; return UserPost (BlogManager.GetPost (user, title)); } - + /// + /// Post the specified user and title. + /// + /// User. + /// Title. [Authorize] public ActionResult Post (string user, string title) { @@ -163,7 +202,11 @@ namespace Yavsc.Controllers ViewData ["UserName"] = un; return View (new BlogEditEntryModel { Title = title }); } - + /// + /// Validates the post. + /// + /// The post. + /// Model. [Authorize] public ActionResult ValidatePost (BlogEditEntryModel model) { @@ -178,7 +221,11 @@ namespace Yavsc.Controllers } return View ("Post", model); } - + /// + /// Validates the edit. + /// + /// The edit. + /// Model. [Authorize] public ActionResult ValidateEdit (BlogEditEntryModel model) { @@ -192,7 +239,10 @@ namespace Yavsc.Controllers } return View ("Edit", model); } - + /// + /// Edit the specified model. + /// + /// Model. [Authorize] public ActionResult Edit (BlogEditEntryModel model) { @@ -219,7 +269,10 @@ namespace Yavsc.Controllers return View (model); } - + /// + /// Comment the specified model. + /// + /// Model. [Authorize] public ActionResult Comment (BlogEditCommentModel model) { string username = Membership.GetUser ().UserName; @@ -234,7 +287,10 @@ namespace Yavsc.Controllers } string defaultAvatar; - + /// + /// Avatar the specified user. + /// + /// User. [AcceptVerbs (HttpVerbs.Get)] public ActionResult Avatar (string user) { diff --git a/web/Controllers/FileSystemController.cs b/web/Controllers/FileSystemController.cs index 075ba10b..a9a847c8 100644 --- a/web/Controllers/FileSystemController.cs +++ b/web/Controllers/FileSystemController.cs @@ -9,16 +9,24 @@ using System.Text.RegularExpressions; namespace Yavsc.Controllers { + /// + /// File system controller. + /// public class FileSystemController : Controller { private static string usersDir ="~/users"; - + /// + /// Gets the users dir. + /// + /// The users dir. public static string UsersDir { get { return usersDir; } } - + /// + /// Index this instance. + /// [Authorize] public ActionResult Index() { @@ -33,7 +41,10 @@ namespace Yavsc.Controllers di.Create (); return View (new FileInfoCollection( di.GetFiles())); } - + /// + /// Details the specified id. + /// + /// Identifier. public ActionResult Details(string id) { foreach (char x in Path.GetInvalidPathChars()) { @@ -51,11 +62,18 @@ namespace Yavsc.Controllers return View (fi); } - + /// + /// Create this instance. + /// public ActionResult Create() { return View (); } + + /// + /// Create the specified collection. + /// + /// Collection. [HttpPost] [Authorize] public ActionResult Create(FormCollection collection) @@ -92,14 +110,24 @@ namespace Yavsc.Controllers } } - + /// + /// Gets the base dir. + /// + /// The base dir. public static string BaseDir { get { return Path.Combine (UsersDir, Membership.GetUser ().UserName); } } - + /// + /// Edit the specified id. + /// + /// Identifier. public ActionResult Edit(int id) { return View (); } - + /// + /// Edit the specified id and collection. + /// + /// Identifier. + /// Collection. [HttpPost] public ActionResult Edit(int id, FormCollection collection) { @@ -109,12 +137,19 @@ namespace Yavsc.Controllers return View (); } } - + /// + /// Delete the specified id. + /// + /// Identifier. public ActionResult Delete(int id) { return View (); } - + /// + /// Delete the specified id and collection. + /// + /// Identifier. + /// Collection. [HttpPost] public ActionResult Delete(int id, FormCollection collection) { diff --git a/web/Controllers/FrontOfficeApiController.cs b/web/Controllers/FrontOfficeApiController.cs index 3dd7a266..d94f0744 100644 --- a/web/Controllers/FrontOfficeApiController.cs +++ b/web/Controllers/FrontOfficeApiController.cs @@ -26,80 +26,66 @@ using Yavsc.Model; namespace Yavsc.ApiControllers { - + /// + /// Front office controller. + /// public class FrontOfficeController : 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 (); } + /// + /// Catalog this instance. + /// [AcceptVerbs("GET")] public Catalog Catalog () { Catalog c = CatalogManager.GetCatalog (Request.RequestUri.AbsolutePath); return c; } - + /// + /// Gets the product categorie. + /// + /// The product categorie. + /// Brand name. + /// Prod categorie. [AcceptVerbs("GET")] public ProductCategory GetProductCategorie (string brandName, string prodCategorie) { return CatalogManager.GetCatalog (Request.RequestUri.AbsolutePath).GetBrand (brandName).GetProductCategory (prodCategorie) ; } - /* - public HttpResponseMessage Post() - { - HttpResponseMessage result = null; - var httpRequest = HttpContext.Current.Request; - if (httpRequest.Files.Count > 0) - { - string username = HttpContext.Current.User.Identity.Name; - int nbf = 0; - foreach(string file in httpRequest.Files) - { - var postedFile = httpRequest.Files[file]; - string filePath = HttpContext.Current.Server.MapPath("~/users/"+username+"/"+ postedFile.FileName); - postedFile.SaveAs(filePath); - nbf++; - } - result = Request.CreateResponse (HttpStatusCode.Created, - string.Format("Received {0} files",nbf)); - - } - else - { - result = Request.CreateResponse (HttpStatusCode.BadRequest,"No file received"); - } - - return result; - } -*/ - /* - [Authorize] - public IOrderInfo Order() - { - - } - */ - [Authorize] - [HttpGet] /// /// Gets the estimate. /// /// The estimate. - /// Estid. + /// Estimate Id. + [Authorize] + [HttpGet] public Estimate GetEstimate (long Id) { Estimate est = wfmgr.ContentProvider.GetEstimate (Id); return est; } + /// + /// Gets the estim tex. + /// + /// The estim tex. + /// Estimid. [AcceptVerbs("GET")] public HttpResponseMessage GetEstimTex(long estimid) { diff --git a/web/Controllers/FrontOfficeController.cs b/web/Controllers/FrontOfficeController.cs index dbc9d373..63a8cf95 100644 --- a/web/Controllers/FrontOfficeController.cs +++ b/web/Controllers/FrontOfficeController.cs @@ -22,19 +22,29 @@ 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. + /// public ActionResult Index () { return View (); } - + /// + /// Estimates this instance. + /// [Authorize] public ActionResult Estimates () { @@ -42,7 +52,11 @@ namespace Yavsc.Controllers return View(wfmgr.GetEstimates (username)); } - + /// + /// Estimate the specified model and submit. + /// + /// Model. + /// Submit. [Authorize] public ActionResult Estimate(Estimate model,string submit) { @@ -86,7 +100,9 @@ namespace Yavsc.Controllers } return View(model); } - + /// + /// Catalog this instance. + /// [AcceptVerbs("GET")] public ActionResult Catalog () { @@ -109,18 +125,24 @@ namespace Yavsc.Controllers /// /// get the product category /// - /// The category. - /// Bn. - /// Pc. + /// The category object. + /// Brand id. + /// Product category Id. [AcceptVerbs("GET")] - public ActionResult ProductCategory (string id, string pc) + public ActionResult ProductCategory (string brandid, string pcid) { - ViewData ["BrandName"] = id; + ViewData ["BrandId"] = brandid; + ViewData ["ProductCategoryId"] = pcid; return View ( - CatalogManager.GetCatalog (Request.Url.AbsolutePath).GetBrand (id).GetProductCategory (pc) + CatalogManager.GetCatalog (Request.Url.AbsolutePath).GetBrand (brandid).GetProductCategory (pcid) ); } - + /// + /// Product the specified id, pc and pref. + /// + /// Identifier. + /// Pc. + /// Preference. [AcceptVerbs("GET")] public ActionResult Product (string id, string pc, string pref) { @@ -151,12 +173,18 @@ namespace Yavsc.Controllers return View ((p is Service)?"Service":"Product", p); } - + /// + /// Command this instance. + /// public ActionResult Command() { return View (); } + /// + /// Command the specified collection. + /// + /// Collection. [HttpPost] [Authorize] public ActionResult Command(FormCollection collection) diff --git a/web/Controllers/GoogleController.cs b/web/Controllers/GoogleController.cs index 7612a9d3..101f953a 100644 --- a/web/Controllers/GoogleController.cs +++ b/web/Controllers/GoogleController.cs @@ -20,6 +20,9 @@ using Yavsc.Helpers.Google; namespace Yavsc.Controllers { + /// + /// Google controller. + /// public class GoogleController : Controller { @@ -44,7 +47,10 @@ namespace Yavsc.Controllers Request.Url.Authority + "/Google/CalAuth"; } } - + /// + /// Login the specified returnUrl. + /// + /// Return URL. public void Login (string returnUrl) { if (string.IsNullOrWhiteSpace (returnUrl)) @@ -54,13 +60,15 @@ namespace Yavsc.Controllers oa.Login (Response, SetSessionSate ()); } - [HttpGet] - [Authorize] + /// /// Called after the Google authorizations screen, /// we assume that Session contains a redirectUrl entry /// /// The auth. + [HttpGet] + [Authorize] + public ActionResult CalAuth () { string msg; @@ -95,10 +103,9 @@ namespace Yavsc.Controllers HttpContext.Profile.Save (); } - - - - + /// + /// Auth this instance. + /// [HttpGet] public ActionResult Auth () { @@ -205,6 +212,11 @@ namespace Yavsc.Controllers return View (); } + /// + /// Chooses the calendar. + /// + /// The calendar. + /// Return URL. [Authorize] [HttpGet] public ActionResult ChooseCalendar (string returnUrl) @@ -222,7 +234,12 @@ namespace Yavsc.Controllers ViewData ["json"] = json; return View (cl); } - + + /// + /// Sets the calendar. + /// + /// The calendar. + /// Calchoice. [HttpPost] [Authorize] public ActionResult SetCalendar (string calchoice) @@ -237,14 +254,23 @@ namespace Yavsc.Controllers } return Redirect ("/"); } - + + /// + /// Dates the query. + /// + /// The query. [Authorize] [HttpGet] public ActionResult DateQuery () { return View (new AskForADate ()); } - + + /// + /// Dates the query. + /// + /// The query. + /// Model. [Authorize] [HttpPost] public ActionResult DateQuery (AskForADate model) diff --git a/web/Controllers/HomeController.cs b/web/Controllers/HomeController.cs index 3052e370..e10bf1f7 100644 --- a/web/Controllers/HomeController.cs +++ b/web/Controllers/HomeController.cs @@ -14,6 +14,9 @@ using Yavsc.Model; namespace Yavsc.Controllers { + /// + /// Home controller. + /// public class HomeController : Controller { // Site name @@ -43,7 +46,10 @@ namespace Yavsc.Controllers return admail; } } - + /// + /// Assemblies the info. + /// + /// The info. public ActionResult AssemblyInfo() { AssemblyName[] model = GetType ().Assembly.GetReferencedAssemblies (); @@ -66,7 +72,9 @@ namespace Yavsc.Controllers owneremail = value; } } - + /// + /// Index this instance. + /// public ActionResult Index () { string startPage = WebConfigurationManager.AppSettings ["StartPage"]; @@ -75,7 +83,12 @@ namespace Yavsc.Controllers ViewData ["Message"] = LocalizedText.Welcome; return View (); } - + /// + /// Contact the specified email, reason and body. + /// + /// Email. + /// Reason. + /// Body. public ActionResult Contact (string email, string reason, string body) { if (email==null) diff --git a/web/Controllers/IOrderInfo.cs b/web/Controllers/IOrderInfo.cs deleted file mode 100644 index 9af566d6..00000000 --- a/web/Controllers/IOrderInfo.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using Yavsc; -using SalesCatalog; -using SalesCatalog.Model; -using System.Web.Routing; -using System.Threading.Tasks; -using System.Diagnostics; -using System.Web.Http; -using System.Net.Http; -using System.Web; -using System.Linq; -using System.IO; -using System.Net; -using WorkFlowProvider; -using System.Web.Security; -using Yavsc.Model.WorkFlow; -using System.Reflection; -using System.Collections.Generic; -using Yavsc.Model.RolesAndMembers; -using Yavsc.Controllers; -using Yavsc.Formatters; -using System.Text; -using System.Web.Profile; - -namespace Yavsc.ApiControllers -{ - - public interface IOrderInfo - { - DateTime Creation { get; set; } - string Status { get; set; } - long OrderId { get; set; } - Object [] Details { get; set; } - } - -} - diff --git a/web/Controllers/ModuleController.cs b/web/Controllers/ModuleController.cs index 4149508d..79c75063 100644 --- a/web/Controllers/ModuleController.cs +++ b/web/Controllers/ModuleController.cs @@ -8,8 +8,15 @@ using System.Configuration; namespace Yavsc.Controllers { + /// + /// Module controller. + /// public class ModuleController : Controller { + /// + /// Initialize the specified requestContext. + /// + /// Request context. protected override void Initialize (System.Web.Routing.RequestContext requestContext) { base.Initialize (requestContext); @@ -18,7 +25,9 @@ namespace Yavsc.Controllers } // List modules = new List (); - + /// + /// Index this instance. + /// public ActionResult Index() { return View (); diff --git a/web/Controllers/TemplateException.cs b/web/Controllers/TemplateException.cs index 87806ec5..19c49980 100644 --- a/web/Controllers/TemplateException.cs +++ b/web/Controllers/TemplateException.cs @@ -25,7 +25,6 @@ using System.Collections.Specialized; namespace Yavsc.ApiControllers { - class TemplateException : Exception { public TemplateException(string message):base(message) diff --git a/web/Controllers/WorkFlowController.cs b/web/Controllers/WorkFlowController.cs index b2fe7dee..e5fde235 100644 --- a/web/Controllers/WorkFlowController.cs +++ b/web/Controllers/WorkFlowController.cs @@ -12,10 +12,20 @@ using System.Web.Http; namespace Yavsc.ApiControllers { + /// + /// Work flow controller. + /// 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 @@ -26,6 +36,13 @@ namespace Yavsc.ApiControllers wfmgr = new WorkFlowManager (); } + /// + /// Creates the estimate. + /// + /// The estimate. + /// Title. + /// Client. + /// Description. [HttpGet] [Authorize] public Estimate CreateEstimate (string title,string client,string description) @@ -34,6 +51,10 @@ namespace Yavsc.ApiControllers Membership.GetUser().UserName,client,title,description); } + /// + /// Drops the writting. + /// + /// Wrid. [HttpGet] [Authorize] public void DropWritting(long wrid) @@ -41,8 +62,10 @@ namespace Yavsc.ApiControllers wfmgr.DropWritting (wrid); } - - + /// + /// Drops the estimate. + /// + /// Estid. [HttpGet] [Authorize] public void DropEstimate(long estid) @@ -50,6 +73,9 @@ namespace Yavsc.ApiControllers wfmgr.DropEstimate (estid); } + /// + /// Index this instance. + /// [HttpGet] [Authorize] public object Index() @@ -71,6 +97,11 @@ namespace Yavsc.ApiControllers errs); } + /// + /// Updates the writting. + /// + /// The writting. + /// Wr. [Authorize] [AcceptVerbs("POST")] [ValidateAjax] @@ -80,14 +111,14 @@ namespace Yavsc.ApiControllers return Request.CreateResponse (System.Net.HttpStatusCode.OK); } - [AcceptVerbs("POST")] - [Authorize] - [ValidateAjax] /// /// Adds the specified imputation to the given estimation by estimation id. /// /// Estimation identifier /// Imputation to add + [AcceptVerbs("POST")] + [Authorize] + [ValidateAjax] public HttpResponseMessage Write ([FromUri] long estid, [FromBody] Writting wr) { if (estid <= 0) { ModelState.AddModelError ("EstimationId", "Spécifier un identifiant d'estimation valide"); diff --git a/web/FileInfoCollection.cs b/web/FileInfoCollection.cs index 7212f4ed..f8d738c2 100644 --- a/web/FileInfoCollection.cs +++ b/web/FileInfoCollection.cs @@ -4,8 +4,15 @@ using System.IO; namespace Yavsc { + /// + /// File info collection. + /// public class FileInfoCollection : List { + /// + /// Initializes a new instance of the class. + /// + /// Collection. public FileInfoCollection (System.IO.FileInfo[] collection) { this.AddRange (collection); diff --git a/web/Formatters/EstimToPdfFormatter.cs b/web/Formatters/EstimToPdfFormatter.cs index fab8d94d..3d058e67 100644 --- a/web/Formatters/EstimToPdfFormatter.cs +++ b/web/Formatters/EstimToPdfFormatter.cs @@ -31,18 +31,32 @@ using System.Diagnostics; namespace Yavsc.Formatters { + /// + /// Estim to pdf formatter. + /// public class EstimToPdfFormatter: BufferedMediaTypeFormatter { + /// + /// Initializes a new instance of the class. + /// public EstimToPdfFormatter () { SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/pdf")); } - + /// + /// Determines whether this instance can read type the specified type. + /// + /// true if this instance can read type the specified type; otherwise, false. + /// Type. public override bool CanReadType(Type type) { return false; } - + /// + /// Determines whether this instance can write type the specified type. + /// + /// true if this instance can write type the specified type; otherwise, false. + /// Type. public override bool CanWriteType(System.Type type) { if (type == typeof(Estimate)) @@ -55,7 +69,13 @@ namespace Yavsc.Formatters return enumerableType.IsAssignableFrom(type); } } - + /// + /// 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 generation parameters, including a template path, and generate from them diff --git a/web/Formatters/SimpleFormatter.cs b/web/Formatters/SimpleFormatter.cs index 3506de19..e745c692 100644 --- a/web/Formatters/SimpleFormatter.cs +++ b/web/Formatters/SimpleFormatter.cs @@ -29,13 +29,24 @@ using System.Net; namespace Yavsc.Formatters { + /// + /// Simple formatter. + /// public class SimpleFormatter : BufferedMediaTypeFormatter { + /// + /// Initializes a new instance of the class. + /// + /// Mimetype. public SimpleFormatter (string mimetype) { SupportedMediaTypes.Add(new MediaTypeHeaderValue(mimetype)); } - + /// + /// Determines whether this instance can write type the specified type. + /// + /// true if this instance can write type the specified type; otherwise, false. + /// Type. public override bool CanWriteType(System.Type type) { if (type == typeof(string)) @@ -48,12 +59,22 @@ namespace Yavsc.Formatters return enumerableType.IsAssignableFrom(type); } } - + /// + /// Determines whether this instance can read type the specified type. + /// + /// true if this instance can read type the specified type; otherwise, false. + /// Type. public override bool CanReadType(Type type) { return false; } - + /// + /// 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/Global.asax.cs b/web/Global.asax.cs index b1fa79bb..30678f1f 100644 --- a/web/Global.asax.cs +++ b/web/Global.asax.cs @@ -11,8 +11,15 @@ using Yavsc.Formatters; namespace Yavsc { + /// + /// Mvc application. + /// public class MvcApplication : System.Web.HttpApplication { + /// + /// Registers the routes. + /// + /// Routes. public static void RegisterRoutes (RouteCollection routes) { @@ -20,7 +27,8 @@ namespace Yavsc routes.IgnoreRoute ("Scripts/{*pathInfo}"); routes.IgnoreRoute ("Theme/{*pathInfo}"); routes.IgnoreRoute ("images/{*pathInfo}"); - + routes.IgnoreRoute ("xmldoc/{*pathInfo}"); // xml doc + routes.IgnoreRoute ("htmldoc/{*pathInfo}"); // html doc routes.MapRoute ( "Blog", "Blog/{user}/{title}", @@ -38,7 +46,9 @@ namespace Yavsc new { controller = "Blogs", action = "Index", user=UrlParameter.Optional, title = UrlParameter.Optional } ); } - + /// + /// Applications the start. + /// protected void Application_Start () { AreaRegistration.RegisterAllAreas (); diff --git a/web/Helpers/BBCodeHelper.cs b/web/Helpers/BBCodeHelper.cs index 456e0bef..29d3da39 100644 --- a/web/Helpers/BBCodeHelper.cs +++ b/web/Helpers/BBCodeHelper.cs @@ -7,13 +7,19 @@ using System.Text; namespace Yavsc.Helpers { - + /// + /// BB code helper. + /// public static class BBCodeHelper { static Dictionary parent = new Dictionary (); private static string tclass="shoh"; private static string cclass="hiduh"; private static string mp4=null, ogg=null, webm=null; + /// + /// Gets or sets the BB code view class. + /// + /// The BB code view class. public static string BBCodeViewClass { get { return cclass; @@ -22,7 +28,10 @@ namespace Yavsc.Helpers cclass = value; } } - + /// + /// Gets or sets the BB code case class. + /// + /// The BB code case class. public static string BBCodeCaseClass { get { return tclass; @@ -31,7 +40,10 @@ namespace Yavsc.Helpers tclass = value; } } - + /// + /// Gets the BB tags usage. + /// + /// The BB tags usage. public static string[] BBTagsUsage { get { @@ -85,7 +97,9 @@ namespace Yavsc.Helpers private static int sect2; private static int sect3; private static Dictionary d = new Dictionary (); - + /// + /// Init this instance. + /// public static void Init () { sect1 = 0; @@ -263,7 +277,10 @@ namespace Yavsc.Helpers sb.Append (cnt); return sb.ToString(); } - + /// + /// Gets the parser. + /// + /// The parser. public static BBCodeParser Parser { get { if (parser == null) { diff --git a/web/Helpers/Google/Entity.cs b/web/Helpers/Google/Entity.cs index c592b92d..73ee123f 100644 --- a/web/Helpers/Google/Entity.cs +++ b/web/Helpers/Google/Entity.cs @@ -30,17 +30,25 @@ using Newtonsoft.Json; namespace Yavsc.Helpers.Google { + /// + /// Entity. + /// public class Entity { + /// + /// The I. + /// public string ID; + /// + /// The name. + /// public string Name; /// - /// The type: - // AUTOMOBILE: A car or passenger vehicle. - // TRUCK: A truck or cargo vehicle. - // WATERCRAFT: A boat or other waterborne vehicle. - // PERSON: A person. + /// The type: AUTOMOBILE: A car or passenger vehicle. + /// * TRUCK: A truck or cargo vehicle. + /// * WATERCRAFT: A boat or other waterborne vehicle. + /// * PERSON: A person. /// public string Type; } diff --git a/web/Helpers/SimpleJsonPostMethod.cs b/web/Helpers/SimpleJsonPostMethod.cs index a28bd7c6..3f34713a 100644 --- a/web/Helpers/SimpleJsonPostMethod.cs +++ b/web/Helpers/SimpleJsonPostMethod.cs @@ -26,6 +26,9 @@ using Newtonsoft.Json; namespace Yavsc.Helpers { + /// + /// Simple json post method. + /// public class SimpleJsonPostMethod: IDisposable { internal HttpWebRequest request = null; @@ -36,15 +39,25 @@ namespace Yavsc.Helpers set { Request.TransferEncoding=value;} } string Method { get { return Request.Method; } } - + /// + /// Gets the path. + /// + /// The path. public string Path { get{ return Request.RequestUri.ToString(); } } - + /// + /// Sets the credential. + /// + /// Cred. public void SetCredential(string cred) { Request.Headers.Add(HttpRequestHeader.Authorization,cred); } + /// + /// Initializes a new instance of the Yavsc.Helpers.SimpleJsonPostMethod class. + /// + /// Path to method. public SimpleJsonPostMethod (string pathToMethod) { // ASSERT Request == null @@ -55,7 +68,10 @@ namespace Yavsc.Helpers Request.ContentType = "application/json"; Request.TransferEncoding = "UTF-8"; } - + /// + /// Invoke the specified query. + /// + /// Query. public TAnswer Invoke(TQuery query) { Byte[] bytes = System.Text.Encoding.UTF8.GetBytes (JsonConvert.SerializeObject(query)); @@ -81,6 +97,14 @@ namespace Yavsc.Helpers } #region IDisposable implementation + /// + /// Releases all resource used by the 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/Helpers/T.cs b/web/Helpers/T.cs index 645c558c..e5cdd1da 100644 --- a/web/Helpers/T.cs +++ b/web/Helpers/T.cs @@ -12,8 +12,16 @@ using Yavsc.Model; namespace Yavsc.Helpers { + /// + /// T. + /// public class T { + /// + /// Gets the string. + /// + /// The string. + /// Message. public static string GetString(string msg) { string tr = LocalizedText.ResourceManager.GetString (msg.Replace (" ", "_")); diff --git a/web/Helpers/YavscHelpers.cs b/web/Helpers/YavscHelpers.cs index 2c3ef918..5da47eb9 100644 --- a/web/Helpers/YavscHelpers.cs +++ b/web/Helpers/YavscHelpers.cs @@ -4,9 +4,16 @@ using System.Configuration; namespace Yavsc.Helpers { + /// + /// Yavsc helpers. + /// public static class YavscHelpers { private static string siteName = null; + /// + /// Gets the name of the site. + /// + /// The name of the site. public static string SiteName { get { if (siteName == null) diff --git a/web/MvcActionValueBinder.cs b/web/MvcActionValueBinder.cs index 725dcf0f..83e19df7 100644 --- a/web/MvcActionValueBinder.cs +++ b/web/MvcActionValueBinder.cs @@ -16,11 +16,19 @@ using System.Web.Http.ValueProviders.Providers; namespace Basic { // Binder with MVC semantics. Treat the body as KeyValue pairs and model bind it. + /// + /// Mvc action value binder. + /// public class MvcActionValueBinder : DefaultActionValueBinder { // Per-request storage, uses the Request.Properties bag. We need a unique key into the bag. private const string Key = "5DC187FB-BFA0-462A-AB93-9E8036871EC8"; + /// + /// Gets the binding. + /// + /// The binding. + /// Action descriptor. public override HttpActionBinding GetBinding (HttpActionDescriptor actionDescriptor) { diff --git a/web/Settings/ModuleConfigurationElementCollection.cs b/web/Settings/ModuleConfigurationElementCollection.cs index b880a002..ec33c853 100644 --- a/web/Settings/ModuleConfigurationElementCollection.cs +++ b/web/Settings/ModuleConfigurationElementCollection.cs @@ -23,19 +23,32 @@ using System.Configuration; namespace Yavsc.Settings { + /// + /// Module configuration element collection. + /// public class ModuleConfigurationElementCollection : ConfigurationElementCollection { + /// + /// Initializes a new instance of the class. + /// public ModuleConfigurationElementCollection () { } #region implemented abstract members of ConfigurationElementCollection - + /// + /// Creates the new element. + /// + /// The new element. protected override ConfigurationElement CreateNewElement () { throw new NotImplementedException (); } - + /// + /// Gets the element key. + /// + /// The element key. + /// Element. protected override object GetElementKey (ConfigurationElement element) { throw new NotImplementedException (); diff --git a/web/Settings/ThanksConfigurationElement.cs b/web/Settings/ThanksConfigurationElement.cs index a4b71f14..44b8e883 100644 --- a/web/Settings/ThanksConfigurationElement.cs +++ b/web/Settings/ThanksConfigurationElement.cs @@ -3,8 +3,15 @@ using System.Configuration; namespace Yavsc { + /// + /// Thanks configuration element. + /// public class ThanksConfigurationElement : ConfigurationElement { + /// + /// Gets or sets the name. + /// + /// The name. [ConfigurationProperty("name", IsKey=true, IsRequired=true)] public string Name { get { @@ -12,7 +19,10 @@ namespace Yavsc } set { base ["name"] = value; } } - + /// + /// Gets or sets the URL. + /// + /// The URL. [ConfigurationProperty("url")] public string Url { get { @@ -20,7 +30,10 @@ namespace Yavsc } set { base ["url"] = value; } } - + /// + /// Gets or sets the image. + /// + /// The image. [ConfigurationProperty("image")] public string Image { get { diff --git a/web/Settings/ThanksConfigurationSection.cs b/web/Settings/ThanksConfigurationSection.cs index c86382ea..7e205f72 100644 --- a/web/Settings/ThanksConfigurationSection.cs +++ b/web/Settings/ThanksConfigurationSection.cs @@ -3,8 +3,15 @@ using System.Configuration; namespace Yavsc { + /// + /// Thanks configuration section. + /// public class ThanksConfigurationSection : ConfigurationSection { + /// + /// Gets or sets to. + /// + /// To. [ConfigurationProperty("to")] public ThanksConfigurationCollection To { get { @@ -14,7 +21,10 @@ namespace Yavsc this ["to"] = value; } } - + /// + /// Gets or sets the html class. + /// + /// The html class. [ConfigurationProperty("html_class")] public string HtmlClass { get { @@ -24,7 +34,10 @@ namespace Yavsc this ["html_class"] = value; } } - + /// + /// Gets or sets the title format. + /// + /// The title format. [ConfigurationProperty("title_format")] public string TitleFormat { get { diff --git a/web/ValidateAjaxAttribute.cs b/web/ValidateAjaxAttribute.cs index bc565d6c..759df742 100644 --- a/web/ValidateAjaxAttribute.cs +++ b/web/ValidateAjaxAttribute.cs @@ -27,8 +27,16 @@ using System.Web.Http.ModelBinding; namespace Yavsc { + /// + /// Validate ajax attribute. + /// public class ValidateAjaxAttribute : ActionFilterAttribute { + /// + /// Gets the error model object. + /// + /// The error model object. + /// Model state. public static object GetErrorModelObject(ModelStateDictionary modelState) { var errorModel = from x in modelState.Keys @@ -43,6 +51,10 @@ namespace Yavsc return errorModel; } + /// + /// Raises the action executing event. + /// + /// Action context. public override void OnActionExecuting (System.Web.Http.Controllers.HttpActionContext actionContext) { var modelState = actionContext.ModelState; diff --git a/web/Views/RegisterPage.cs b/web/Views/RegisterPage.cs index 695b7f5a..90103029 100644 --- a/web/Views/RegisterPage.cs +++ b/web/Views/RegisterPage.cs @@ -5,14 +5,26 @@ using Yavsc.Model.RolesAndMembers; namespace Yavsc { + /// + /// Register page. + /// public class RegisterPage : System.Web.Mvc.ViewPage { + /// + /// Initializes a new instance of the class. + /// public RegisterPage () { } - + /// + /// The createuserwizard1. + /// public CreateUserWizard Createuserwizard1; - + /// + /// Raises the register send mail event. + /// + /// Sender. + /// E. public void OnRegisterSendMail(object sender, MailMessageEventArgs e) { // Set MailMessage fields. diff --git a/web/Web.csproj b/web/Web.csproj index 0daf034b..7153f9ca 100644 --- a/web/Web.csproj +++ b/web/Web.csproj @@ -40,6 +40,7 @@ false Yavsc true + bin\Yavsc.xml false @@ -154,7 +155,6 @@ - diff --git a/web/templates/Estim.cs b/web/templates/Estim.cs index cb7adba3..2058b477 100644 --- a/web/templates/Estim.cs +++ b/web/templates/Estim.cs @@ -49,395 +49,407 @@ namespace Yavsc.templates { #line hidden #line 14 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write("\n\n\\documentclass[french,11pt]{article}\n\\usepackage{babel}\n\\usepackage[T1]{fontenc}\n\\usepackage[utf8]{inputenc}\n\\usepackage[a4paper]{geometry}\n\\usepackage{units}\n\\usepackage{bera}\n\\usepackage{graphicx}\n\\usepackage{fancyhdr}\n\\usepackage{fp}\n\n\\def\\TVA{20} % Taux de la TVA\n\n\\def\\TotalHT{0}\n\\def\\TotalTVA{0}\n\n\n\\newcommand{\\AjouterService}[3]{% Arguments : Désignation, quantité, prix\n \\FPround{\\prix}{#3}{2}\n \\FPeval{\\montant}{#2 * #3}\n \\FPround{\\montant}{\\montant}{2}\n \\FPadd{\\TotalHT}{\\TotalHT}{\\montant}\n \n \\eaddto\\ListeProduits{#1 & \\prix & #2 & \\montant \\cr}\n}\n\n\n\\newcommand{\\AfficheResultat}{%\n \\ListeProduits\n \n \\FPeval{\\TotalTVA}{\\TotalHT * \\TVA / 100}\n \\FPadd{\\TotalTTC}{\\TotalHT}{\\TotalTVA}\n \\FPround{\\TotalHT}{\\TotalHT}{2}\n \\FPround{\\TotalTVA}{\\TotalTVA}{2}\n \\FPround{\\TotalTTC}{\\TotalTTC}{2}\n \\global\\let\\TotalHT\\TotalHT\n \\global\\let\\TotalTVA\\TotalTVA\n \\global\\let\\TotalTTC\\TotalTTC\n \n\n \\cr \n \\hline\n \\textbf{Total} & & & \\TotalHT\n}\n\n\\newcommand*\\eaddto[2]{% version développée de \\addto\n \\edef\\tmp{#2}%\n \\expandafter\\addto\n \\expandafter#1%\n \\expandafter{\\tmp}%\n}\n\n\\newcommand{\\ListeProduits}{}\n\n\n\n\n%%%%%%%%%%%%%%%%%%%%% A MODIFIER DANS LA FACTURE %%%%%%%%%%%%%%%%%%%%%\n\n\\def\\FactureNum {"); + this.Write("\n\\documentclass[french,11pt]{article}\n\\usepackage{babel}\n\\usepackage[T1]{fontenc}\n\\usepackage[utf8]{inputenc}\n\\usepackage[a4paper]{geometry}\n\\usepackage{units}\n\\usepackage{bera}\n\\usepackage{graphicx}\n\\usepackage{fancyhdr}\n\\usepackage{fp}\n\n\\def\\TVA{20} % Taux de la TVA\n\n\\def\\TotalHT{0}\n\\def\\TotalTVA{0}\n\n\n\\newcommand{\\AjouterService}[3]{% Arguments : Désignation, quantité, prix\n \\FPround{\\prix}{#3}{2}\n \\FPeval{\\montant}{#2 * #3}\n \\FPround{\\montant}{\\montant}{2}\n \\FPadd{\\TotalHT}{\\TotalHT}{\\montant}\n \n \\eaddto\\ListeProduits{#1 & \\prix & #2 & \\montant \\cr}\n}\n\n\n\\newcommand{\\AfficheResultat}{%\n \\ListeProduits\n \n \\FPeval{\\TotalTVA}{\\TotalHT * \\TVA / 100}\n \\FPadd{\\TotalTTC}{\\TotalHT}{\\TotalTVA}\n \\FPround{\\TotalHT}{\\TotalHT}{2}\n \\FPround{\\TotalTVA}{\\TotalTVA}{2}\n \\FPround{\\TotalTTC}{\\TotalTTC}{2}\n \\global\\let\\TotalHT\\TotalHT\n \\global\\let\\TotalTVA\\TotalTVA\n \\global\\let\\TotalTTC\\TotalTTC\n \n\n \\cr \n \\hline\n \\textbf{Total} & & & \\TotalHT\n}\n\n\\newcommand*\\eaddto[2]{% version développée de \\addto\n \\edef\\tmp{#2}%\n \\expandafter\\addto\n \\expandafter#1%\n \\expandafter{\\tmp}%\n}\n\n\\newcommand{\\ListeProduits}{}\n\n\n\n\n%%%%%%%%%%%%%%%%%%%%% A MODIFIER DANS LA FACTURE %%%%%%%%%%%%%%%%%%%%%\n\n\\def\\FactureNum {"); #line default #line hidden - #line 75 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 74 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( estim.Id.ToString() )); #line default #line hidden - #line 75 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 74 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("} % Numéro de facture\n\\def\\FactureAcquittee {non} % Facture acquittée : oui/non\n\\def\\FactureLieu {"); #line default #line hidden - #line 77 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 76 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( from.CityAndState )); #line default #line hidden - #line 77 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 76 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("} % Lieu de l'édition de la facture\n\\def\\FactureObjet {Facture : "); #line default #line hidden - #line 78 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 77 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( estim.Title )); #line default #line hidden - #line 78 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 77 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("} % Objet du document\n% Description de la facture\n\\def\\FactureDescr {%\n "); #line default #line hidden - #line 81 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 80 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( estim.Description )); #line default #line hidden - #line 81 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 80 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("\n}\n\n% Infos Client\n\\def\\ClientNom{"); #line default #line hidden - #line 85 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 84 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( to.Name )); #line default #line hidden - #line 85 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 84 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("} % Nom du client\n\\def\\ClientAdresse{% % Adresse du client\n "); #line default #line hidden - #line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 86 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( to.Address )); #line default #line hidden - #line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 86 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("\\\\\n "); #line default #line hidden - #line 88 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( to.ZipCode )); #line default #line hidden - #line 88 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" "); #line default #line hidden - #line 88 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( to.CityAndState )); #line default #line hidden - #line 88 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("\\\\\n"); #line default #line hidden - #line 89 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 88 "/home/paul/workspace/yavsc/web/templates/Estim.tt" if (!string.IsNullOrWhiteSpace(to.Phone)) { #line default #line hidden - #line 90 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 89 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" Téléphone fixe: "); #line default #line hidden - #line 90 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 89 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( to.Phone )); #line default #line hidden - #line 90 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 89 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("\\\\\n"); #line default #line hidden + #line 90 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + } + + #line default + #line hidden + #line 91 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - } - - #line default - #line hidden - - #line 92 "/home/paul/workspace/yavsc/web/templates/Estim.tt" if (!string.IsNullOrWhiteSpace(to.Mobile)) { #line default #line hidden - #line 93 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 92 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" Mobile: "); #line default #line hidden - #line 93 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 92 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( to.Mobile )); #line default #line hidden - #line 93 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 92 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("\\\\\n"); #line default #line hidden + #line 93 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + } + + #line default + #line hidden + #line 94 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - } - - #line default - #line hidden - - #line 95 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" E-mail: "); #line default #line hidden - #line 95 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 94 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( to.Email )); #line default #line hidden - #line 95 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 94 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("\n}\n\n% Liste des produits facturés : Désignation, prix\n\n "); #line default #line hidden - #line 100 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 99 "/home/paul/workspace/yavsc/web/templates/Estim.tt" foreach (Writting wr in estim.Lines) { #line default #line hidden - #line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 100 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("\\AjouterService {"); #line default #line hidden - #line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 100 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture(wr.Description)); #line default #line hidden - #line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 100 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" "); #line default #line hidden - #line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 100 "/home/paul/workspace/yavsc/web/templates/Estim.tt" if (!string.IsNullOrWhiteSpace(wr.ProductReference)) { #line default #line hidden - #line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" ("); #line default #line hidden - #line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture(wr.ProductReference)); #line default #line hidden - #line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(")"); #line default #line hidden - #line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt" } #line default #line hidden - #line 103 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("} {"); #line default #line hidden - #line 103 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture(wr.Count)); #line default #line hidden - #line 103 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("} {"); #line default #line hidden - #line 103 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture(wr.UnitaryCost)); #line default #line hidden - #line 103 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("} \n "); #line default #line hidden - #line 104 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 103 "/home/paul/workspace/yavsc/web/templates/Estim.tt" } #line default #line hidden - #line 105 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 104 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n\\geometry{verbose,tmargin=4em,bmargin=8em,lmargin=6em,rmargin=6em}\n\\setlength{\\parindent}{0pt}\n\\setlength{\\parskip}{1ex plus 0.5ex minus 0.2ex}\n\n\\thispagestyle{fancy}\n\\pagestyle{fancy}\n\\setlength{\\parindent}{0pt}\n\n\\renewcommand{\\headrulewidth}{0pt}\n\\cfoot{\n "); #line default #line hidden - #line 118 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture(from.Name)); #line default #line hidden - #line 118 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" - "); #line default #line hidden - #line 118 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture(from.Address )); #line default #line hidden - #line 118 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" - "); #line default #line hidden - #line 118 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( from.CityAndState )); #line default #line hidden - #line 118 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" \\newline\n \\small{\n E-mail: "); #line default #line hidden - #line 120 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 119 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( from.Email )); #line default #line hidden - #line 120 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 119 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("\n "); #line default #line hidden - #line 121 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 120 "/home/paul/workspace/yavsc/web/templates/Estim.tt" if (!string.IsNullOrWhiteSpace(from.Mobile)) { #line default #line hidden - #line 122 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 121 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" - Téléphone mobile: "); #line default #line hidden - #line 122 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 121 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( from.Mobile )); #line default #line hidden - #line 122 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 121 "/home/paul/workspace/yavsc/web/templates/Estim.tt" } #line default #line hidden - #line 123 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 122 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" "); #line default #line hidden - #line 123 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 122 "/home/paul/workspace/yavsc/web/templates/Estim.tt" if (!string.IsNullOrWhiteSpace(from.Phone)) { #line default #line hidden - #line 124 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 123 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" - Téléphone fixe: "); #line default #line hidden - #line 124 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 123 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( from.Phone )); #line default #line hidden - #line 124 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 123 "/home/paul/workspace/yavsc/web/templates/Estim.tt" } #line default #line hidden - #line 125 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 124 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" }\n}\n\n\\begin{document}\n\n% Logo de la société\n%\\includegraphics{logo.jpg}\n\n% Nom et adresse de la société\n"); #line default #line hidden - #line 134 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 133 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( from.Name )); #line default #line hidden + #line 133 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write("\\\\\n"); + + #line default + #line hidden + + #line 134 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture( from.Address )); + + #line default + #line hidden + #line 134 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("\\\\\n"); @@ -445,108 +457,96 @@ namespace Yavsc.templates { #line hidden #line 135 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( from.Address )); - - #line default - #line hidden - - #line 135 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write("\\\\\n"); - - #line default - #line hidden - - #line 136 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture(from.ZipCode )); #line default #line hidden - #line 136 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 135 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" "); #line default #line hidden - #line 136 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 135 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture(from.CityAndState)); #line default #line hidden - #line 136 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 135 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("\\\\\n\nFacture n°\\FactureNum\n\n\n{\\addtolength{\\leftskip}{10.5cm} %in ERT\n \\textbf{\\ClientNom} \\\\\n \\ClientAdresse \\\\\n\n} %in ERT\n\n\n\\hspace*{10.5cm}\n\\FactureLieu, le \\today\n\n~\\\\~\\\\\n\n\\textbf{Objet : \\FactureObjet \\\\}\n\n\\textnormal{\\FactureDescr}\n\n~\\\\\n\n\\begin{center}\n \\begin{tabular}{lrrr}\n \\textbf{Désignation ~~~~~~} & \\textbf{Prix unitaire} & \\textbf{Quantité} & \\textbf{Montant (EUR)} \\\\\n \\hline\n \\AfficheResultat{}\n \\end{tabular}\n\\end{center}\n\n\\begin{flushright}\n\\textit{Auto entreprise en franchise de TVA}\\\\\n\n\\end{flushright}\n~\\\\\n\n\\ifthenelse{\\equal{\\FactureAcquittee}{oui}}{\n Facture acquittée.\n}{\n\n À régler par chèque ou par virement bancaire :\n\n \\begin{center}\n \\begin{tabular}{|c c c c|}\n \\hline \\textbf{Code banque} & \\textbf{Code guichet} & \\textbf{N° de Compte} & \\textbf{Clé RIB} \\\\\n "); #line default #line hidden - #line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( from.BankCode )); #line default #line hidden - #line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" & "); #line default #line hidden - #line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( from.WicketCode )); #line default #line hidden - #line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" & "); #line default #line hidden - #line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture(from.AccountNumber )); #line default #line hidden - #line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" & "); #line default #line hidden - #line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture(from.BankedKey)); #line default #line hidden - #line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" \\\\\n \\hline \\textbf{IBAN N°} & \\multicolumn{3}{|l|}{ "); #line default #line hidden - #line 183 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( from.IBAN )); #line default #line hidden - #line 183 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" } \\\\\n \\hline \\textbf{Code BIC} & \\multicolumn{3}{|l|}{ "); #line default #line hidden - #line 184 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 183 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( from.BIC )); #line default #line hidden - #line 184 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 183 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" } \\\\\n \\hline\n \\end{tabular}\n \\end{center}\n}\n\\end{document}\n"); #line default @@ -554,7 +554,7 @@ namespace Yavsc.templates { return this.GenerationEnvironment.ToString(); } - protected virtual void Initialize() { + public virtual void Initialize() { if ((this.Errors.HasErrors == false)) { bool _estimAcquired = false; if (((this.Session != null) && this.Session.ContainsKey("estim"))) { @@ -747,7 +747,10 @@ namespace Yavsc.templates { public class ToStringInstanceHelper { private global::System.IFormatProvider formatProvider = global::System.Globalization.CultureInfo.InvariantCulture; - + /// + /// Gets or sets the format provider. + /// + /// The format provider. public global::System.IFormatProvider FormatProvider { get { return this.formatProvider; @@ -759,7 +762,11 @@ namespace Yavsc.templates { this.formatProvider = value; } } - + /// + /// Tos the string with culture. + /// + /// The string with culture. + /// Object to convert. public string ToStringWithCulture(object objectToConvert) { if ((objectToConvert == null)) { throw new global::System.ArgumentNullException("objectToConvert"); diff --git a/web/templates/Estim.tt b/web/templates/Estim.tt index 00406bf6..caab404a 100644 --- a/web/templates/Estim.tt +++ b/web/templates/Estim.tt @@ -12,7 +12,6 @@ <#@ parameter type="Profile" name="from" #> <#@ parameter type="Profile" name="to" #> - \documentclass[french,11pt]{article} \usepackage{babel} \usepackage[T1]{fontenc}