diff --git a/Makefile b/Makefile index e1ca0257..6e65698c 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ clean: rm -rf $(DESTDIR) -rsync-all: rsync_local rsync_test rsync_preprod rsync_prod +allrsync: rsync_local rsync_test rsync_preprod rsync_prod sourcepkg: git archive --format=tar --prefix=yavsc-$(CONFIG)/ $(CONFIG) | bzip2 > yavsc-$(CONFIG).tar.bz2 @@ -67,5 +67,4 @@ htmldoc: xmldoc docdeploy-prod: htmldoc rsync -ravu web/htmldoc root@$(PRODHOSTDIR) -.PHONY: rsync-local diff --git a/web/ApiControllers/FrontOfficeApiController.cs b/web/ApiControllers/FrontOfficeApiController.cs index 6535c12b..cac2a6c2 100644 --- a/web/ApiControllers/FrontOfficeApiController.cs +++ b/web/ApiControllers/FrontOfficeApiController.cs @@ -89,30 +89,10 @@ namespace Yavsc.ApiControllers [AcceptVerbs ("GET")] public HttpResponseMessage EstimateToTex (long id) { - string texest = null; - try { - texest = estimateToTex (id); - } catch (TemplateException ex) { - return new HttpResponseMessage (HttpStatusCode.OK) { Content = - new ObjectContent (typeof(string), - ex.Message, new ErrorHtmlFormatter (HttpStatusCode.NotAcceptable, - LocalizedText.DocTemplateException - )) - }; - } catch (Exception ex) { - return new HttpResponseMessage (HttpStatusCode.OK) { Content = - new ObjectContent (typeof(string), - ex.Message, new ErrorHtmlFormatter (HttpStatusCode.InternalServerError, - LocalizedText.DocTemplateException)) - }; - } + string texest = estimateToTex (id); if (texest == null) - return new HttpResponseMessage (HttpStatusCode.OK) { Content = - new ObjectContent (typeof(string), "Not an estimation id:" + id, - new ErrorHtmlFormatter (HttpStatusCode.NotFound, - LocalizedText.Estimate_not_found)) - }; - + throw new InvalidOperationException ( + "Not an estimate"); return new HttpResponseMessage () { Content = new ObjectContent (typeof(string), texest, @@ -146,11 +126,11 @@ namespace Yavsc.ApiControllers /// The to pdf. /// Estimid. [AcceptVerbs("GET")] - public HttpResponseMessage EstimateToPdf (long estimid) + public HttpResponseMessage EstimateToPdf (long id) { string texest = null; try { - texest = estimateToTex (estimid); + texest = estimateToTex (id); } catch (TemplateException ex) { return new HttpResponseMessage (HttpStatusCode.OK) { Content = new ObjectContent (typeof(string), @@ -167,7 +147,7 @@ namespace Yavsc.ApiControllers } if (texest == null) return new HttpResponseMessage (HttpStatusCode.OK) { Content = - new ObjectContent (typeof(string), "Not an estimation id:" + estimid, + new ObjectContent (typeof(string), "Not an estimation id:" + id, new ErrorHtmlFormatter (HttpStatusCode.NotFound, LocalizedText.Estimate_not_found)) }; @@ -193,7 +173,7 @@ namespace Yavsc.ApiControllers /// Model. [Authorize()] [ValidateAjaxAttribute] - public HttpResponseMessage Register ([FromBody] RegisterModel model) + public HttpResponseMessage Register ([FromBody] RegisterClientModel model) { if (ModelState.IsValid) { if (model.IsApprouved) @@ -225,6 +205,14 @@ namespace Yavsc.ApiControllers case MembershipCreateStatus.Success: if (!model.IsApprouved) Yavsc.Helpers.YavscHelpers.SendActivationEmail (user); + ProfileBase prtu = ProfileBase.Create (model.UserName); + prtu.SetPropertyValue("Name",model.Name); + prtu.SetPropertyValue("Address",model.Address); + prtu.SetPropertyValue("CityAndState",model.CityAndState); + prtu.SetPropertyValue("Mobile",model.Mobile); + prtu.SetPropertyValue("Phone",model.Phone); + prtu.SetPropertyValue("ZipCode",model.ZipCode); + break; default: break; diff --git a/web/ApiControllers/WorkFlowController.cs b/web/ApiControllers/WorkFlowController.cs index ee96bfb2..9b78b2d0 100644 --- a/web/ApiControllers/WorkFlowController.cs +++ b/web/ApiControllers/WorkFlowController.cs @@ -7,11 +7,10 @@ using System.Web.Security; using Yavsc; using Yavsc.Model.WorkFlow; using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.ModelBinding; using Yavsc.Model.RolesAndMembers; using Yavsc.Helpers; using Yavsc.Model; +using System.Web.Http.Controllers; namespace Yavsc.ApiControllers { @@ -135,18 +134,6 @@ namespace Yavsc.ApiControllers return new { test=string.Format("Hello {0}!",username) }; } - private HttpResponseMessage CreateModelStateErrorResponse () { - // strip exceptions - Dictionary errs = new Dictionary (); - - foreach (KeyValuePair st - in ModelState.Where (x => x.Value.Errors.Count > 0)) - errs.Add(st.Key, st.Value.Errors.Select(x=>x.ErrorMessage).ToArray()); - - return Request.CreateResponse(System.Net.HttpStatusCode.BadRequest, - errs); - } - /// /// Updates the writting. /// diff --git a/web/CatExts/WebCatalogExtensions.cs b/web/CatExts/WebCatalogExtensions.cs index e811e836..178db006 100644 --- a/web/CatExts/WebCatalogExtensions.cs +++ b/web/CatExts/WebCatalogExtensions.cs @@ -3,8 +3,8 @@ using System.Web; using System.Text; using System.Web.Mvc; using System.Web.Routing; -using System.Web.Mvc.Html; using Yavsc.Model.FrontOffice; +using System.Web.Mvc.Html; namespace Yavsc.CatExts { diff --git a/web/Controllers/AccountController.cs b/web/Controllers/AccountController.cs index ee4f9095..bcbc9bc9 100644 --- a/web/Controllers/AccountController.cs +++ b/web/Controllers/AccountController.cs @@ -5,13 +5,12 @@ using System.Linq; using System.Net.Mail; using System.Web; using System.Web.Configuration; -using System.Web.Mvc; -using System.Web.Mvc.Ajax; using System.Web.Profile; using System.Web.Security; using Yavsc; using Yavsc.Model.RolesAndMembers; using Yavsc.Helpers; +using System.Web.Mvc; namespace Yavsc.Controllers { @@ -34,6 +33,7 @@ namespace Yavsc.Controllers get { return avatarDir; } set { avatarDir = value; } } + /// /// Index this instance. /// @@ -68,6 +68,7 @@ namespace Yavsc.Controllers // If we got this far, something failed, redisplay form return View (model); } + /// /// Register the specified model and returnUrl. /// @@ -122,6 +123,7 @@ namespace Yavsc.Controllers } return View (model); } + /// /// Changes the password success. /// @@ -142,6 +144,7 @@ namespace Yavsc.Controllers { return View (); } + /// /// Unregister the specified confirmed. /// @@ -211,70 +214,75 @@ namespace Yavsc.Controllers ViewData ["UserName"] = logdu; if (user == null) user = logdu; - Profile model= new Profile (ProfileBase.Create (user)); + Profile model = new Profile (ProfileBase.Create (user)); model.RememberMe = FormsAuthentication.GetAuthCookie (user, true) == null; return View (model); } /// - /// Profile the specified model and AvatarFile. + /// Profile the specified user, model and AvatarFile. /// + /// User. /// Model. /// Avatar file. [Authorize] [HttpPost] - // ASSERT("Membership.GetUser ().UserName is made of simple characters, no slash nor backslash" - public ActionResult Profile (string username, Profile model, HttpPostedFileBase AvatarFile) + public ActionResult Profile (string user, Profile model, HttpPostedFileBase AvatarFile) { + // ASSERT("Membership.GetUser ().UserName is made of simple characters, no slash nor backslash" string logdu = Membership.GetUser ().UserName; ViewData ["UserName"] = logdu; - if (username != logdu) + bool editsMyProfile = (user == logdu); + if (!editsMyProfile) if (!Roles.IsUserInRole ("Admin")) if (!Roles.IsUserInRole ("FrontOffice")) throw new UnauthorizedAccessException ("Your are not authorized to modify this profile"); - ProfileBase prtoup = ProfileBase.Create (username); - if (AvatarFile != null) { + + if (AvatarFile != null) { // if said valid, move as avatar file // else invalidate the model if (AvatarFile.ContentType == "image/png") { string avdir = Server.MapPath (AvatarDir); - string avpath = Path.Combine (avdir, username + ".png"); + string avpath = Path.Combine (avdir, user + ".png"); AvatarFile.SaveAs (avpath); - model.avatar = Request.Url.Scheme+ "://"+ Request.Url.Authority + AvatarDir.Substring (1)+ "/" + username + ".png"; - } else + model.avatar = Request.Url.Scheme + "://" + Request.Url.Authority + AvatarDir.Substring (1) + "/" + user + ".png"; + } else ModelState.AddModelError ("Avatar", string.Format ("Image type {0} is not supported (suported formats : {1})", AvatarFile.ContentType, "image/png")); } - /* Sync the property in the Profile model to display : + /* Sync the property in the Profile model to display : * string cAvat = HttpContext.Profile.GetPropertyValue ("avatar") as string; if (cAvat != null) if (model.avatar == null) model.avatar = cAvat; */ if (ModelState.IsValid) { - if (model.avatar != null) - prtoup.SetPropertyValue ("avatar", model.avatar); - prtoup.SetPropertyValue ("Address", model.Address); - prtoup.SetPropertyValue ("BlogTitle", model.BlogTitle); - prtoup.SetPropertyValue ("BlogVisible", model.BlogVisible); - prtoup.SetPropertyValue ("CityAndState", model.CityAndState); - prtoup.SetPropertyValue ("ZipCode", model.ZipCode); - prtoup.SetPropertyValue ("Country", model.Country); - prtoup.SetPropertyValue ("WebSite", model.WebSite); - prtoup.SetPropertyValue ("Name", model.Name); - prtoup.SetPropertyValue ("Phone", model.Phone); - prtoup.SetPropertyValue ("Mobile", model.Mobile); - prtoup.SetPropertyValue ("BankCode", model.BankCode); - prtoup.SetPropertyValue ("WicketCode", model.WicketCode); - prtoup.SetPropertyValue ("AccountNumber", model.AccountNumber); - prtoup.SetPropertyValue ("BankedKey", model.BankedKey); - prtoup.SetPropertyValue ("BIC", model.BIC); - prtoup.SetPropertyValue ("IBAN", model.IBAN); - prtoup.Save (); - FormsAuthentication.SetAuthCookie (username, model.RememberMe); - ViewData ["Message"] = "Profile enregistré, cookie modifié."; + ProfileBase prf = ProfileBase .Create (model.UserName); + prf.SetPropertyValue ("BlogVisible", model.BlogVisible); + prf.SetPropertyValue ("BlogTitle", model.BlogTitle); + prf.SetPropertyValue ("avatar", model.avatar); + prf.SetPropertyValue ("Address", model.Address); + prf.SetPropertyValue ("CityAndState", model.CityAndState); + prf.SetPropertyValue ("Country", model.Country); + prf.SetPropertyValue ("ZipCode", model.ZipCode); + prf.SetPropertyValue ("WebSite", model.WebSite); + prf.SetPropertyValue ("Name", model.Name); + prf.SetPropertyValue ("Phone", model.Phone); + prf.SetPropertyValue ("Mobile", model.Mobile); + prf.SetPropertyValue ("BankCode", model.BankCode); + prf.SetPropertyValue ("IBAN", model.IBAN); + prf.SetPropertyValue ("BIC", model.BIC); + prf.SetPropertyValue ("WicketCode", model.WicketCode); + prf.SetPropertyValue ("AccountNumber", model.AccountNumber); + prf.SetPropertyValue ("BankedKey", model.BankedKey); + prf.SetPropertyValue ("gcalid", model.GoogleCalendar); + prf.Save (); + // only do the following if this profile belongs to current user + if (editsMyProfile) + FormsAuthentication.SetAuthCookie (user, model.RememberMe); + ViewData ["Message"] = "Profile enregistré"+((editsMyProfile)?", cookie modifié.":""); } return View (model); } @@ -290,7 +298,6 @@ namespace Yavsc.Controllers return Redirect (returnUrl); } - /// /// Validate the specified id and key. /// diff --git a/web/Controllers/BlogsController.cs b/web/Controllers/BlogsController.cs index 63d69fd0..43d6f12a 100644 --- a/web/Controllers/BlogsController.cs +++ b/web/Controllers/BlogsController.cs @@ -7,8 +7,6 @@ using System.Net.Mime; using System.Runtime.Serialization.Formatters.Binary; using System.Web; using System.Web.Configuration; -using System.Web.Mvc; -using System.Web.Mvc.Ajax; using System.Web.Profile; using System.Web.Security; using CodeKicker.BBCode; @@ -19,6 +17,7 @@ using Yavsc.Model.Blogs; using Yavsc.ApiControllers; using Yavsc.Model.RolesAndMembers; using System.Net; +using System.Web.Mvc; namespace Yavsc.Controllers { diff --git a/web/Controllers/GoogleController.cs b/web/Controllers/GoogleController.cs index 15b6dc1a..ac43f3d0 100644 --- a/web/Controllers/GoogleController.cs +++ b/web/Controllers/GoogleController.cs @@ -11,7 +11,6 @@ using System.Web; using System.Web.Mvc; using System.Web.Profile; using System.Web.Security; -using Mono.Security.Protocol.Tls; using Newtonsoft.Json; using Yavsc.Model; using Yavsc.Model.Google; diff --git a/web/Controllers/HomeController.cs b/web/Controllers/HomeController.cs index 9300a66a..357aaff2 100644 --- a/web/Controllers/HomeController.cs +++ b/web/Controllers/HomeController.cs @@ -5,16 +5,15 @@ using System.Linq; using System.Net.Mail; using System.Web; using System.Web.Configuration; -using System.Web.Mvc; -using System.Web.Mvc.Ajax; using System.Reflection; using System.Resources; using Yavsc.Model; using Npgsql.Web; -using ITContentProvider; using Npgsql.Web.Blog; using Yavsc.Helpers; using Yavsc; +using System.Web.Mvc; +using ITContentProvider; namespace Yavsc.Controllers { diff --git a/web/Formatters/EstimToPdfFormatter.MSAN.cs b/web/Formatters/EstimToPdfFormatter.MSAN.cs new file mode 100644 index 00000000..87339dfc --- /dev/null +++ b/web/Formatters/EstimToPdfFormatter.MSAN.cs @@ -0,0 +1,138 @@ +// +// EstimToPdfFormatter.cs +// +// Author: +// Paul Schneider +// +// Copyright (c) 2014 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 . + +#if MicrosoftAspNetMvc + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Web; +using System.Web.Profile; +using Yavsc.Model.RolesAndMembers; +using Yavsc.Model.WorkFlow; +using System.Net.Http.Formatting; +using System.Net.Http.Headers; + +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)) + { + return true; + } + else + { + Type enumerableType = typeof(IEnumerable); + return enumerableType.IsAssignableFrom(type); + } + } + public override void WriteToStream (Type type, object value, Stream writeStream, System.Net.Http.HttpContent content) + { + + // TODO create a type containing generation parameters, including a template path, and generate from them + + Yavsc.templates.Estim tmpe = new Yavsc.templates.Estim(); + tmpe.Session = new Dictionary(); + Estimate e = value as Estimate; + tmpe.Session.Add ("estim", e); + + Profile prpro = new Profile (ProfileBase.Create (e.Responsible)); + + var pbc = ProfileBase.Create (e.Client); + Profile prcli = new Profile (pbc); + + if (!prpro.HasBankAccount || !prcli.IsBillable) + throw new Exception("account number for provider, or client not billable."); + + tmpe.Session.Add ("from", prpro); + tmpe.Session.Add ("to", prcli); + tmpe.Init (); + + string contentStr = tmpe.TransformText (); + + string name = string.Format ("tmpestimtex-{0}", e.Id); + string fullname = Path.Combine ( + HttpRuntime.CodegenDir, name); + FileInfo fi = new FileInfo(fullname + ".tex"); + FileInfo fo = new FileInfo(fullname + ".pdf"); + using (StreamWriter sw = new StreamWriter (fi.FullName)) + { + sw.Write (contentStr); + } + using (Process p = new Process ()) { + p.StartInfo.WorkingDirectory = HttpRuntime.CodegenDir; + p.StartInfo = new ProcessStartInfo (); + p.StartInfo.UseShellExecute = false; + p.StartInfo.FileName = "/usr/bin/texi2pdf"; + p.StartInfo.Arguments = + string.Format ("--batch --build-dir={2} -o {0} {1}", + fo.FullName, + fi.FullName,HttpRuntime.CodegenDir); + p.Start (); + p.WaitForExit (); + if (p.ExitCode != 0) + throw new Exception ("Pdf generation failed with exit code:" + p.ExitCode); + } + + using (StreamReader sr = new StreamReader (fo.FullName)) { + byte[] buffer = File.ReadAllBytes (fo.FullName); + writeStream.Write(buffer,0,buffer.Length); + } + fi.Delete(); + fo.Delete(); + + } + + + } +} + + + +#endif diff --git a/web/Global.asax.cs b/web/Global.asax.cs index 354ee3dd..a4a20bd1 100644 --- a/web/Global.asax.cs +++ b/web/Global.asax.cs @@ -4,12 +4,14 @@ using System; using System.Collections.Generic; using System.Linq; using System.Web; -using System.Web.Mvc; using System.Web.Routing; using Yavsc.Formatters; using Yavsc.Model.FrontOffice; -using System.Web.Http; using System.Web.SessionState; +using System.Web.Mvc; +using System.Web.Http; +using System.Web.WebPages.Scope; +using System.Reflection; namespace Yavsc { @@ -86,5 +88,14 @@ namespace Yavsc return HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath.StartsWith(WebApiConfig.UrlPrefixRelative); } + protected void Application_BeginRequest() + { + var ob = typeof( + AspNetRequestScopeStorageProvider).Assembly.GetType( + "System.Web.WebPages.WebPageHttpModule").GetProperty + ("AppStartExecuteCompleted", + BindingFlags.NonPublic | BindingFlags.Static); + ob.SetValue(null, true, null); + } } } diff --git a/web/Models/App.master b/web/Models/App.master index c65d3f50..54b3a9ca 100644 --- a/web/Models/App.master +++ b/web/Models/App.master @@ -48,7 +48,7 @@ ViewState["orgtitle"] = T.GetString(Page.Title); S'authentifier avec son compte Google+ <% } else { %> - <%= Html.ActionLink(HttpContext.Current.User.Identity.Name, "Profile", "Account", null, new { @class="actionlink" }) %> + <%= Html.ActionLink(HttpContext.Current.User.Identity.Name, "Profile", "Account", new { user= HttpContext.Current.User.Identity.Name}, new { @class="actionlink" }) %> Édition de votre profile @ <%= Html.ActionLink( YavscHelpers.SiteName, "Index", "Home" ,null, new { @class="actionlink" }) %> Page d'accueil diff --git a/web/ValidateAjaxAttribute.cs b/web/ValidateAjaxAttribute.cs index 759df742..2070c6f4 100644 --- a/web/ValidateAjaxAttribute.cs +++ b/web/ValidateAjaxAttribute.cs @@ -21,8 +21,8 @@ using System; using System.Linq; using System.Net; -using System.Web.Http.Filters; using System.Net.Http; +using System.Web.Http.Filters; using System.Web.Http.ModelBinding; namespace Yavsc @@ -51,18 +51,16 @@ namespace Yavsc return errorModel; } - /// - /// Raises the action executing event. - /// - /// Action context. - public override void OnActionExecuting (System.Web.Http.Controllers.HttpActionContext actionContext) + + public override void OnActionExecuted (HttpActionExecutedContext actionExecutedContext) { - var modelState = actionContext.ModelState; + var modelState = actionExecutedContext.ActionContext.ModelState; + if (!modelState.IsValid) { - actionContext.Response = - actionContext.Request.CreateResponse - (HttpStatusCode.BadRequest,GetErrorModelObject(modelState)); + actionExecutedContext.Response = + actionExecutedContext.Request.CreateResponse (System.Net.HttpStatusCode.BadRequest, + ValidateAjaxAttribute.GetErrorModelObject (modelState)); } } } diff --git a/web/Views/Account/Profile.aspx b/web/Views/Account/Profile.aspx index 54503ee1..1861f860 100644 --- a/web/Views/Account/Profile.aspx +++ b/web/Views/Account/Profile.aspx @@ -12,8 +12,9 @@ table.layout TR TD { max-width:40%; } <%= Html.ValidationSummary() %> <% using(Html.BeginForm("Profile", "Account", FormMethod.Post, new { enctype = "multipart/form-data" })) %> <% { %> + + <%= Html.Hidden("UserName",ViewData["ProfileUserName"]) %> - ">
Informations publiques diff --git a/web/Views/FrontOffice/Estimate.aspx b/web/Views/FrontOffice/Estimate.aspx index bd731670..9ce9f703 100644 --- a/web/Views/FrontOffice/Estimate.aspx +++ b/web/Views/FrontOffice/Estimate.aspx @@ -355,7 +355,7 @@ function addRow(){ }); - <%= LocalizedText.Tex_version %> - <%= LocalizedText.Pdf_version %> + <%= LocalizedText.Tex_version %> + <%= LocalizedText.Pdf_version %> \ No newline at end of file diff --git a/web/Web.config b/web/Web.config index 4d366441..f7a135fb 100644 --- a/web/Web.config +++ b/web/Web.config @@ -29,13 +29,13 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - + + - - + + + + @@ -285,7 +270,7 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx - + diff --git a/web/Web.csproj b/web/Web.csproj index 6addec92..84c4e277 100644 --- a/web/Web.csproj +++ b/web/Web.csproj @@ -53,55 +53,40 @@ - - - - - - - - - - - - - lib\CodeKicker.BBCode.dll - - - - - - - - ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll - - - - ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll - - - ..\packages\PayPalCoreSDK.1.6.0\lib\net451\PayPalCoreSDK.dll - - + + + + + + + + + + + + + - - + + + + @@ -192,6 +177,7 @@ + @@ -680,6 +666,7 @@ + @@ -721,10 +708,6 @@ {59E1DF7B-FFA0-4DEB-B5F3-76EBD98D5356} WebControls - - {9D7D892E-9B77-4713-892D-C26E1E944119} - ITContentProvider - {68F5B80A-616E-4C3C-91A0-828AA40000BD} YavscModel @@ -733,6 +716,14 @@ {821FF72D-9F4B-4A2C-B95C-7B965291F119} NpgsqlContentProvider + + {9D7D892E-9B77-4713-892D-C26E1E944119} + ITContentProvider + + + {B5F49C21-7BB3-4DC0-AE65-F4ED0F6D15BD} + fortune + diff --git a/web/templates/Estim.cs b/web/templates/Estim.cs index ad7a2a4c..a783d6f0 100644 --- a/web/templates/Estim.cs +++ b/web/templates/Estim.cs @@ -115,61 +115,61 @@ namespace Yavsc.templates { #line hidden #line 86 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + if (!string.IsNullOrWhiteSpace(to.Address)) { + + #line default + #line hidden + + #line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" "); + + #line default + #line hidden + + #line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( to.Address )); #line default #line hidden - #line 86 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write("\\\\\n "); - - #line default - #line hidden - #line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( to.ZipCode )); - - #line default - #line hidden - - #line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(" "); - - #line default - #line hidden - - #line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( to.CityAndState )); - - #line default - #line hidden - - #line 87 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write("\\\\\n"); + this.Write("\\\\\n "); #line default #line hidden #line 88 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - if (!string.IsNullOrWhiteSpace(to.Phone)) { + } #line default #line hidden #line 89 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(" Téléphone fixe: "); + this.Write(" "); #line default #line hidden #line 89 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( to.Phone )); + if (!string.IsNullOrWhiteSpace(to.ZipCode)) { #line default #line hidden - #line 89 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write("\\\\\n"); + #line 90 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" "); + + #line default + #line hidden + + #line 90 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture( to.ZipCode )); + + #line default + #line hidden + + #line 90 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" "); #line default #line hidden @@ -181,381 +181,469 @@ namespace Yavsc.templates { #line hidden #line 91 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - if (!string.IsNullOrWhiteSpace(to.Mobile)) { + this.Write(" "); + + #line default + #line hidden + + #line 91 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + if (!string.IsNullOrWhiteSpace(to.ZipCode)) { #line default #line hidden #line 92 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(" Mobile: "); - - #line default - #line hidden - - #line 92 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( to.Mobile )); - - #line default - #line hidden - - #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" - this.Write(" E-mail: "); - - #line default - #line hidden - - #line 94 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( to.Email )); - - #line default - #line hidden - - #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 99 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - foreach (Writting wr in estim.Lines) { - - #line default - #line hidden - - #line 100 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write("\\AjouterService {"); - - #line default - #line hidden - - #line 100 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture(wr.Description)); - - #line default - #line hidden - - #line 100 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(" "); - - #line default - #line hidden - - #line 100 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - if (!string.IsNullOrWhiteSpace(wr.ProductReference)) { - - #line default - #line hidden - - #line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(" ("); - - #line default - #line hidden - - #line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture(wr.ProductReference)); - - #line default - #line hidden - - #line 101 "/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 default - #line hidden - - #line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write("} {"); - - #line default - #line hidden - - #line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture(wr.Count)); - - #line default - #line hidden - - #line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write("} {"); - - #line default - #line hidden - - #line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture(wr.UnitaryCost)); - - #line default - #line hidden - - #line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write("} \n "); - - #line default - #line hidden - - #line 103 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - } - - #line default - #line hidden - - #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 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture(from.Name)); - - #line default - #line hidden - - #line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(" - "); - - #line default - #line hidden - - #line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture(from.Address )); - - #line default - #line hidden - - #line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(" - "); - - #line default - #line hidden - - #line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( from.CityAndState )); - - #line default - #line hidden - - #line 117 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(" \\newline\n \\small{\n E-mail: "); - - #line default - #line hidden - - #line 119 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( from.Email )); - - #line default - #line hidden - - #line 119 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write("\n "); - - #line default - #line hidden - - #line 120 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - if (!string.IsNullOrWhiteSpace(from.Mobile)) { - - #line default - #line hidden - - #line 121 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(" - Téléphone mobile: "); - - #line default - #line hidden - - #line 121 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( from.Mobile )); - - #line default - #line hidden - - #line 121 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - } - - #line default - #line hidden - - #line 122 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" "); #line default #line hidden - #line 122 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - if (!string.IsNullOrWhiteSpace(from.Phone)) { + #line 92 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture( to.CityAndState )); #line default #line hidden - #line 123 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(" - Téléphone fixe: "); + #line 92 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write("\\\\ "); #line default #line hidden - #line 123 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( from.Phone )); - - #line default - #line hidden - - #line 123 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 92 "/home/paul/workspace/yavsc/web/templates/Estim.tt" } #line default #line hidden - #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 93 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" \n"); #line default #line hidden - #line 133 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture( from.Name )); + #line 94 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + if (!string.IsNullOrWhiteSpace(to.Phone)) { #line default #line hidden - #line 133 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 95 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" Téléphone fixe: "); + + #line default + #line hidden + + #line 95 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture( to.Phone )); + + #line default + #line hidden + + #line 95 "/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 96 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + } #line default #line hidden - #line 134 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 97 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + if (!string.IsNullOrWhiteSpace(to.Mobile)) { + + #line default + #line hidden + + #line 98 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" Mobile: "); + + #line default + #line hidden + + #line 98 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture( to.Mobile )); + + #line default + #line hidden + + #line 98 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write("\\\\\n"); #line default #line hidden - #line 135 "/home/paul/workspace/yavsc/web/templates/Estim.tt" - this.Write(this.ToStringHelper.ToStringWithCulture(from.ZipCode )); + #line 99 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + } #line default #line hidden - #line 135 "/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 135 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 100 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + if (!string.IsNullOrWhiteSpace(to.Email)) { + + #line default + #line hidden + + #line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" E-mail: "); + + #line default + #line hidden + + #line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture( to.Email )); + + #line default + #line hidden + + #line 101 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + } + + #line default + #line hidden + + #line 102 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write("}\n\n% Liste des produits facturés : Désignation, prix\n\n "); + + #line default + #line hidden + + #line 106 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + foreach (Writting wr in estim.Lines) { + + #line default + #line hidden + + #line 107 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write("\\AjouterService {"); + + #line default + #line hidden + + #line 107 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(wr.Description)); + + #line default + #line hidden + + #line 107 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" "); + + #line default + #line hidden + + #line 107 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + if (!string.IsNullOrWhiteSpace(wr.ProductReference)) { + + #line default + #line hidden + + #line 108 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" ("); + + #line default + #line hidden + + #line 108 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(wr.ProductReference)); + + #line default + #line hidden + + #line 108 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(")"); + + #line default + #line hidden + + #line 108 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + } + + #line default + #line hidden + + #line 109 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write("} {"); + + #line default + #line hidden + + #line 109 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(wr.Count)); + + #line default + #line hidden + + #line 109 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write("} {"); + + #line default + #line hidden + + #line 109 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(wr.UnitaryCost)); + + #line default + #line hidden + + #line 109 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write("} \n "); + + #line default + #line hidden + + #line 110 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + } + + #line default + #line hidden + + #line 111 "/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 124 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(from.Name)); + + #line default + #line hidden + + #line 124 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" - "); + + #line default + #line hidden + + #line 124 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(from.Address )); + + #line default + #line hidden + + #line 124 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" - "); + + #line default + #line hidden + + #line 124 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture( from.CityAndState )); + + #line default + #line hidden + + #line 124 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" \\newline\n \\small{\n E-mail: "); + + #line default + #line hidden + + #line 126 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture( from.Email )); + + #line default + #line hidden + + #line 126 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write("\n "); + + #line default + #line hidden + + #line 127 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + if (!string.IsNullOrWhiteSpace(from.Mobile)) { + + #line default + #line hidden + + #line 128 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" - Téléphone mobile: "); + + #line default + #line hidden + + #line 128 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture( from.Mobile )); + + #line default + #line hidden + + #line 128 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + } + + #line default + #line hidden + + #line 129 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" "); + + #line default + #line hidden + + #line 129 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + if (!string.IsNullOrWhiteSpace(from.Phone)) { + + #line default + #line hidden + + #line 130 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" - Téléphone fixe: "); + + #line default + #line hidden + + #line 130 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture( from.Phone )); + + #line default + #line hidden + + #line 130 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + } + + #line default + #line hidden + + #line 131 "/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 140 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture( from.Name )); + + #line default + #line hidden + + #line 140 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write("\\\\\n"); + + #line default + #line hidden + + #line 141 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture( from.Address )); + + #line default + #line hidden + + #line 141 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write("\\\\\n"); + + #line default + #line hidden + + #line 142 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(from.ZipCode )); + + #line default + #line hidden + + #line 142 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + this.Write(" "); + + #line default + #line hidden + + #line 142 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture(from.CityAndState)); #line default #line hidden - #line 135 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 142 "/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 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 188 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( from.BankCode )); #line default #line hidden - #line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 188 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" & "); #line default #line hidden - #line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 188 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( from.WicketCode )); #line default #line hidden - #line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 188 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" & "); #line default #line hidden - #line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 188 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture(from.AccountNumber )); #line default #line hidden - #line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 188 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" & "); #line default #line hidden - #line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 188 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture(from.BankedKey)); #line default #line hidden - #line 181 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 188 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" \\\\\n \\hline \\textbf{IBAN N°} & \\multicolumn{3}{|l|}{ "); #line default #line hidden - #line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 189 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( from.IBAN )); #line default #line hidden - #line 182 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 189 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(" } \\\\\n \\hline \\textbf{Code BIC} & \\multicolumn{3}{|l|}{ "); #line default #line hidden - #line 183 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 190 "/home/paul/workspace/yavsc/web/templates/Estim.tt" this.Write(this.ToStringHelper.ToStringWithCulture( from.BIC )); #line default #line hidden - #line 183 "/home/paul/workspace/yavsc/web/templates/Estim.tt" + #line 190 "/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 #line hidden return this.GenerationEnvironment.ToString(); } - /// - /// Initialize this instance. - /// + public virtual void Initialize() { if ((this.Errors.HasErrors == false)) { bool _estimAcquired = false; @@ -749,10 +837,7 @@ 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; @@ -764,11 +849,7 @@ 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 caab404a..2afbe48d 100644 --- a/web/templates/Estim.tt +++ b/web/templates/Estim.tt @@ -83,15 +83,19 @@ % Infos Client \def\ClientNom{<#= to.Name #>} % Nom du client \def\ClientAdresse{% % Adresse du client + <# if (!string.IsNullOrWhiteSpace(to.Address)) { #> <#= to.Address #>\\ - <#= to.ZipCode #> <#= to.CityAndState #>\\ + <# } #> <# if (!string.IsNullOrWhiteSpace(to.ZipCode)) { #> + <#= to.ZipCode #> <# } #> <# if (!string.IsNullOrWhiteSpace(to.ZipCode)) { #> + <#= to.CityAndState #>\\ <# } #> <# if (!string.IsNullOrWhiteSpace(to.Phone)) { #> Téléphone fixe: <#= to.Phone #>\\ <# } #> <# if (!string.IsNullOrWhiteSpace(to.Mobile)) { #> Mobile: <#= to.Mobile #>\\ <# } #> - E-mail: <#= to.Email #> + <# if (!string.IsNullOrWhiteSpace(to.Email)) { #> + E-mail: <#= to.Email #><# } #> } % Liste des produits facturés : Désignation, prix diff --git a/web/web.config b/web/web.config new file mode 100644 index 00000000..67113e62 --- /dev/null +++ b/web/web.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/yavscModel/RolesAndMemebers/Profile.cs b/yavscModel/RolesAndMemebers/Profile.cs index f549ff58..3e0e2d28 100644 --- a/yavscModel/RolesAndMemebers/Profile.cs +++ b/yavscModel/RolesAndMemebers/Profile.cs @@ -4,6 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.Web.Profile; using System.Web.Security; using System.Web; +using System.Configuration; namespace Yavsc.Model.RolesAndMembers { @@ -13,6 +14,7 @@ namespace Yavsc.Model.RolesAndMembers public class Profile { + /// /// Gets or sets the name. /// @@ -210,6 +212,8 @@ namespace Yavsc.Model.RolesAndMembers } } + public string UserName { get ; set; } + public Profile () : base () { } @@ -259,6 +263,8 @@ namespace Yavsc.Model.RolesAndMembers s = profile.GetPropertyValue ("Mobile"); Mobile = (s is DBNull) ? null : (string)s; + UserName = profile.UserName; + MembershipUser u = Membership.GetUser (profile.UserName); Email = u.Email;