From 2ac233893936b716f077ac72fa64f19768340161 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 20 Oct 2014 07:23:44 +0200 Subject: [PATCH] Edition du devis fonctionnelle --- WorkFlowProvider/NpgsqlContentProvider.cs | 29 +++- WorkFlowProvider/WorkFlowProvider.csproj | 1 + web/Controllers/FrontOfficeController.cs | 4 +- web/Controllers/WorkFlowController.cs | 17 +- web/Global.asax.cs | 4 + web/Models/App.master | 4 +- web/Theme/blue/asc.gif | Bin 0 -> 54 bytes web/Theme/blue/bg.gif | Bin 0 -> 64 bytes web/Theme/blue/desc.gif | Bin 0 -> 54 bytes web/Theme/blue/style.css | 39 +++++ web/Theme/dark/asc.gif | Bin 0 -> 54 bytes web/Theme/dark/bg.gif | Bin 0 -> 64 bytes web/Theme/dark/desc.gif | Bin 0 -> 54 bytes web/Theme/dark/style.css | 41 +++++ web/Theme/green/asc.png | Bin 0 -> 2665 bytes web/Theme/green/bg.png | Bin 0 -> 2655 bytes web/Theme/green/desc.png | Bin 0 -> 2662 bytes web/Theme/green/style.css | 39 +++++ web/{ => Theme}/style.css | 0 web/Views/FrontOffice/Estimate.aspx | 194 +++++++++++++++------- web/Web.csproj | 23 ++- yavscModel/WorkFlow/Writting.cs | 30 ++++ 22 files changed, 349 insertions(+), 76 deletions(-) create mode 100644 web/Theme/blue/asc.gif create mode 100644 web/Theme/blue/bg.gif create mode 100644 web/Theme/blue/desc.gif create mode 100644 web/Theme/blue/style.css create mode 100644 web/Theme/dark/asc.gif create mode 100644 web/Theme/dark/bg.gif create mode 100644 web/Theme/dark/desc.gif create mode 100644 web/Theme/dark/style.css create mode 100644 web/Theme/green/asc.png create mode 100644 web/Theme/green/bg.png create mode 100644 web/Theme/green/desc.png create mode 100644 web/Theme/green/style.css rename web/{ => Theme}/style.css (100%) diff --git a/WorkFlowProvider/NpgsqlContentProvider.cs b/WorkFlowProvider/NpgsqlContentProvider.cs index 94dccea7..333535ab 100644 --- a/WorkFlowProvider/NpgsqlContentProvider.cs +++ b/WorkFlowProvider/NpgsqlContentProvider.cs @@ -66,11 +66,6 @@ namespace WorkFlowProvider throw new NotImplementedException (); } - public void UpdateWritting (Writting wr) - { - throw new NotImplementedException (); - } - public void SetWrittingStatus (long wrtid, int status, string username) { throw new NotImplementedException (); @@ -197,6 +192,30 @@ namespace WorkFlowProvider } } } + + + public void UpdateWritting (Writting wr) + { + using (NpgsqlConnection cnx = CreateConnection ()) { + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { + cmd.CommandText = + "update writtings set " + + "description = @desc, " + + "ucost = @ucost, " + + "count = @count, " + + "productid = @prdid " + + "where _id = @wrid"; + cmd.Parameters.Add ("@wrid", wr.Id); + cmd.Parameters.Add ("@desc", wr.Description); + cmd.Parameters.Add ("@ucost", wr.UnitaryCost); + cmd.Parameters.Add ("@prdid", wr.ProductReference); + cmd.Parameters.Add ("@count", wr.Count); + cnx.Open (); + cmd.ExecuteNonQuery (); + cnx.Close (); + } + } + } public void SetTitle (long estid, string newTitle) { diff --git a/WorkFlowProvider/WorkFlowProvider.csproj b/WorkFlowProvider/WorkFlowProvider.csproj index c8f6968e..7393fe8c 100644 --- a/WorkFlowProvider/WorkFlowProvider.csproj +++ b/WorkFlowProvider/WorkFlowProvider.csproj @@ -9,6 +9,7 @@ Library WorkFlowProvider WorkFlowProvider + v4.5 true diff --git a/web/Controllers/FrontOfficeController.cs b/web/Controllers/FrontOfficeController.cs index f88eaf3c..2fa73ae1 100644 --- a/web/Controllers/FrontOfficeController.cs +++ b/web/Controllers/FrontOfficeController.cs @@ -21,9 +21,10 @@ namespace Yavsc.Controllers public class FrontOfficeController : Controller { [Authorize] - public ActionResult Estimate(Estimate model,string submit) + public ActionResult Estimate(Estimate model,string submit) { if (ModelState.IsValid) { + ViewData ["WebApiUrl"] = "http://"+ Request.Url.Authority + "/api/WorkFlow"; string username = HttpContext.User.Identity.Name; if (model.Id > 0) { Estimate f = WorkFlowManager.GetEstimate (model.Id); @@ -31,7 +32,6 @@ namespace Yavsc.Controllers ModelState.AddModelError ("Id", "Wrong Id"); return View (model); } - if (username != f.Owner) if (!Roles.IsUserInRole ("FrontOffice")) throw new UnauthorizedAccessException ("You're not allowed to view/modify this estimate"); diff --git a/web/Controllers/WorkFlowController.cs b/web/Controllers/WorkFlowController.cs index 57a9f0a4..fe2a306a 100644 --- a/web/Controllers/WorkFlowController.cs +++ b/web/Controllers/WorkFlowController.cs @@ -11,7 +11,6 @@ using System.Web.Security; namespace Yavsc.ApiControllers { - //[HttpControllerConfiguration(ActionValueBinder=typeof(Basic.MvcActionValueBinder))] public class WorkFlowController : ApiController { string adminRoleName="Admin"; @@ -39,10 +38,13 @@ namespace Yavsc.ApiControllers { WorkFlowManager.DropWritting (wrid); } - [HttpGet] + [Authorize] - public void UpdateWritting(Writting wr) + [AcceptVerbs("POST")] + public void UpdateWritting([FromBody] Writting wr) { + if (!ModelState.IsValid) + throw new Exception ("Modèle invalide"); WorkFlowManager.UpdateWritting (wr); } @@ -62,12 +64,13 @@ namespace Yavsc.ApiControllers return new { test=string.Format("Hello {0}!",username) }; } - [HttpGet] - [HttpPost] + + [AcceptVerbs("POST")] [Authorize] - public long Write (long estid, string desc, decimal ucost, int count, string productid) { + public long Write ([FromUri] long estid, [FromBody] Writting wr) { // TODO ensure estid owner matches the current one - return WorkFlowManager.Write(estid, desc, ucost, count, productid); + return WorkFlowManager.Write(estid, wr.Description, + wr.UnitaryCost, wr.Count, wr.ProductReference); } } } diff --git a/web/Global.asax.cs b/web/Global.asax.cs index 73321a12..f3f0e9eb 100644 --- a/web/Global.asax.cs +++ b/web/Global.asax.cs @@ -16,6 +16,10 @@ namespace Yavsc { routes.IgnoreRoute ("{resource}.axd/{*pathInfo}"); + routes.IgnoreRoute ("js/{*pathInfo}"); + routes.IgnoreRoute ("Theme/{*pathInfo}"); + routes.IgnoreRoute ("css/{*pathInfo}"); + routes.IgnoreRoute ("images/{*pathInfo}"); routes.MapRoute ( "Blog", diff --git a/web/Models/App.master b/web/Models/App.master index d76e89db..f15053c5 100644 --- a/web/Models/App.master +++ b/web/Models/App.master @@ -5,9 +5,11 @@ <% Page.Title += " - "+YavscHelpers.SiteName; %> + + - + diff --git a/web/Theme/blue/asc.gif b/web/Theme/blue/asc.gif new file mode 100644 index 0000000000000000000000000000000000000000..74157867f25acbc146704d43399d6c3605ba7724 GIT binary patch literal 54 zcmZ?wbhEHb6lGvxXkcJa);0M5|G(l-7DfgJMg|=QAOOiQF!A=tFW`Q0{?_dDi`go= G4AuZ#-wosd literal 0 HcmV?d00001 diff --git a/web/Theme/blue/bg.gif b/web/Theme/blue/bg.gif new file mode 100644 index 0000000000000000000000000000000000000000..fac668fcf42af844a3af0a239fa638ddbc08443c GIT binary patch literal 64 zcmZ?wbhEHb6lLIKXkcJa);0M5|G(l-7DfgJMg|=QAOOiQFp2l{H=O3Yl~fU8)V1~= QTew|n!uOuePzDBT00piR0RR91 literal 0 HcmV?d00001 diff --git a/web/Theme/blue/desc.gif b/web/Theme/blue/desc.gif new file mode 100644 index 0000000000000000000000000000000000000000..3b30b3c58eabdb47a1c420ad03c8e30b966cc858 GIT binary patch literal 54 zcmZ?wbhEHb6lGvxXkcJa);0M5|G(l-7DfgJMg|=QAOOiQF!A>EGoD<#VNP?1QCB1* GgEatI(+xQQ literal 0 HcmV?d00001 diff --git a/web/Theme/blue/style.css b/web/Theme/blue/style.css new file mode 100644 index 00000000..071b3cc0 --- /dev/null +++ b/web/Theme/blue/style.css @@ -0,0 +1,39 @@ +/* tables */ +table.tablesorter { + font-family:arial; + background-color: #CDCDCD; + margin:10px 0pt 15px; + font-size: 8pt; + width: 100%; + text-align: left; +} +table.tablesorter thead tr th, table.tablesorter tfoot tr th { + background-color: #e6EEEE; + border: 1px solid #FFF; + font-size: 8pt; + padding: 4px; +} +table.tablesorter thead tr .header { + background-image: url(bg.gif); + background-repeat: no-repeat; + background-position: center right; + cursor: pointer; +} +table.tablesorter tbody td { + color: #3D3D3D; + padding: 4px; + background-color: #FFF; + vertical-align: top; +} +table.tablesorter tbody tr.odd td { + background-color:#F0F0F6; +} +table.tablesorter thead tr .headerSortUp { + background-image: url(/Theme/blue/asc.gif); +} +table.tablesorter thead tr .headerSortDown { + background-image: url(/Theme/blue/desc.gif); +} +table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp { +background-color: #8dbdd8; +} diff --git a/web/Theme/dark/asc.gif b/web/Theme/dark/asc.gif new file mode 100644 index 0000000000000000000000000000000000000000..74157867f25acbc146704d43399d6c3605ba7724 GIT binary patch literal 54 zcmZ?wbhEHb6lGvxXkcJa);0M5|G(l-7DfgJMg|=QAOOiQF!A=tFW`Q0{?_dDi`go= G4AuZ#-wosd literal 0 HcmV?d00001 diff --git a/web/Theme/dark/bg.gif b/web/Theme/dark/bg.gif new file mode 100644 index 0000000000000000000000000000000000000000..fac668fcf42af844a3af0a239fa638ddbc08443c GIT binary patch literal 64 zcmZ?wbhEHb6lLIKXkcJa);0M5|G(l-7DfgJMg|=QAOOiQFp2l{H=O3Yl~fU8)V1~= QTew|n!uOuePzDBT00piR0RR91 literal 0 HcmV?d00001 diff --git a/web/Theme/dark/desc.gif b/web/Theme/dark/desc.gif new file mode 100644 index 0000000000000000000000000000000000000000..3b30b3c58eabdb47a1c420ad03c8e30b966cc858 GIT binary patch literal 54 zcmZ?wbhEHb6lGvxXkcJa);0M5|G(l-7DfgJMg|=QAOOiQF!A>EGoD<#VNP?1QCB1* GgEatI(+xQQ literal 0 HcmV?d00001 diff --git a/web/Theme/dark/style.css b/web/Theme/dark/style.css new file mode 100644 index 00000000..5fd7a115 --- /dev/null +++ b/web/Theme/dark/style.css @@ -0,0 +1,41 @@ +/* tables */ +table.tablesorter { + font-family:arial; + background-color: #333; + margin:10px 0pt 15px; + font-size: 8pt; + width: 100%; + text-align: left; +} +table.tablesorter thead tr th, table.tablesorter tfoot tr th { + background-color: rgba(0,0,0,0.5); + border: 1px solid #206; + font-size: 8pt; + padding: 4px; +} +table.tablesorter thead tr .header { + background-image: url(bg.gif); + background-repeat: no-repeat; + background-position: center right; + cursor: pointer; +} +table.tablesorter tbody td { + color: #ffa; + padding: 4px; + vertical-align: top; + background-color: #002; +} + +table.tablesorter .odd td { + background-color: #004; +} + +table.tablesorter thead tr .headerSortUp { + background-image: url(/Theme/dark/asc.gif); +} +table.tablesorter thead tr .headerSortDown { + background-image: url(/Theme/dark/desc.gif); +} +table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp { +background-color: #123; +} diff --git a/web/Theme/green/asc.png b/web/Theme/green/asc.png new file mode 100644 index 0000000000000000000000000000000000000000..66e39cad0118035e24e5ccb2cc9795ac936746d3 GIT binary patch literal 2665 zcmZ8j4LFl)A7A=XQQ{Ppuku}@P9dR=HEPr3D@Ej+N{HjD93mm2P9r27M;zq%EF6`j zu@&3c)@HNWW}C6u?9--BFYnWN&--52d4KnHJ@@lG*M0x5|Nr;9@85kFdU>AK+`M}; z2n5oEo`Lv)Kx?dl_r2(oxjXQ!hd0_c z^Q~XtApF<9(tOnAM~!zAI^7}~oLrDUK)bY+O6Ahhl0u=7%jJANe`siEd3iZLK7L_g zK_n9KcswSPNvG4XSS**zRVr0dnUu+5PEAeWa5yfP!{-Z>Dy38^WieSe9F|NbvpH-M znJf{11B=C!%j6t3hf1MhuviL}%4D%bi$D_z_>fEpjc9HIUJ!#M8FgH0s%0ILZwI~5@0f& zPMhWN#1e^2CKri>Du5Z~5{JXa6Yu~*1OkE0;Q)g~LLr$%7Ks+w-|C{MR7w&F_(7sg z(SXV*6bgw%QYeEdEDvQOE z$z(#INFWf%WKs+UWAo11{R5m%qXA(8#;-V!oD>2O39(q*?Cfm7c!&e?pv^mD$6+VT z%pjjXKR7s;&L%TaOdXc$Hp+xxb$dZI=pLZG~veF{Ja;&H((@W9Ebb#i8v2{ zKM(JNGroa|8N)D`49}OQ4oJsYE;j-d9ZgJ&_z>Za1iOC#2lm2;hTg+kcf#6tx(|XU z0PXP;fv=!MBC+we-yDYzMG}6D#^3Np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oC1s^0I$!XA z+HVebx)0`_^8MgRoe?4Ln}7N=w0W0rggEmdbDucpCd``f>Oe>FWbtdMBuzk6Pjoiy zYp&?BNC^v5OV1lF@%@X?k(j5nz7aHXpPTt7y$<4Nd z1AYUwcbrUJj}6;LJ2;F`LmysAq{loUwk8G39wK9hT-KjVp3fU^-kJZZQ?u;aE|YJ2 zzdWwTA51PT3^Q>hbS!nS8!}2;m_oSPjoA@4^-64V${+83>!Z#U){Ie&z^1Yb#( zM!yd!)c^FG4^PcDOxzmQJLs6x+=>!L)VOcJb)>?Ll3koE#Mc}m@?}<8sm9)ab>EWN zj8hjm&f29JO*5}?{UxPNqIBrexrnZ;lzJ{Ofcb>3?^>}s_C55Y2!s2gd}_TS)Bg=` Cpy)LK literal 0 HcmV?d00001 diff --git a/web/Theme/green/style.css b/web/Theme/green/style.css new file mode 100644 index 00000000..8ea42b4b --- /dev/null +++ b/web/Theme/green/style.css @@ -0,0 +1,39 @@ +table.tablesorter { + font-size: 12px; + background-color: #4D4D4D; + width: 1024px; + border: 1px solid #000; +} +table.tablesorter th { + text-align: left; + padding: 5px; + background-color: #6E6E6E; +} +table.tablesorter td { + color: #FFF; + padding: 5px; +} +table.tablesorter .even { + background-color: #3D3D3D; +} +table.tablesorter .odd { + background-color: #6E6E6E; +} +table.tablesorter .header { + background-image: url(bg.png); + background-repeat: no-repeat; + border-left: 1px solid #FFF; + border-right: 1px solid #000; + border-top: 1px solid #FFF; + padding-left: 30px; + padding-top: 8px; + height: auto; +} +table.tablesorter .headerSortUp { + background-image: url(/Theme/green/asc.png); + background-repeat: no-repeat; +} +table.tablesorter .headerSortDown { + background-image: url(/Theme/green/desc.png); + background-repeat: no-repeat; +} \ No newline at end of file diff --git a/web/style.css b/web/Theme/style.css similarity index 100% rename from web/style.css rename to web/Theme/style.css diff --git a/web/Views/FrontOffice/Estimate.aspx b/web/Views/FrontOffice/Estimate.aspx index e1021939..c7ae75bd 100644 --- a/web/Views/FrontOffice/Estimate.aspx +++ b/web/Views/FrontOffice/Estimate.aspx @@ -1,8 +1,14 @@ <%@ Page Title="Devis" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %> - + + + + + + + <%= Html.ValidationSummary("Devis") %> <% using (Html.BeginForm("Estimate","FrontOffice")) { %> <%= Html.LabelFor(model => model.Title) %>:<%= Html.TextBox( "Title" ) %> @@ -22,25 +28,14 @@ <% } else { %> - - <% } %> -<% if (Model.Lines ==null || Model.Lines.Length == 0) { %> -Pas de ligne. -<% -} else { %> + + + - @@ -48,9 +43,10 @@ -<% foreach (Writting wr in Model.Lines) { %> - - +<% int lc=0; + if (Model.Lines!=null) + foreach (Writting wr in Model.Lines) { lc++; %> +row" id="wr<%=wr.Id%>"> @@ -60,13 +56,14 @@
Id Description Product Reference Count
<%=wr.Id%>
<%=wr.Description%> <%=wr.ProductReference%> <%=wr.Count%>
- -<% } %> - <% } %> <% } %> +
+ + +
- + -
+
diff --git a/web/Web.csproj b/web/Web.csproj index 6de340db..e263cb21 100644 --- a/web/Web.csproj +++ b/web/Web.csproj @@ -25,6 +25,11 @@ Yavsc true + + + + +
none @@ -107,6 +112,10 @@ + + + + @@ -145,7 +154,6 @@ - @@ -204,6 +212,19 @@ + + + + + + + + + + + + + diff --git a/yavscModel/WorkFlow/Writting.cs b/yavscModel/WorkFlow/Writting.cs index 10c38073..2d18c21d 100644 --- a/yavscModel/WorkFlow/Writting.cs +++ b/yavscModel/WorkFlow/Writting.cs @@ -1,13 +1,43 @@ using System; +using System.ComponentModel.DataAnnotations; namespace Yavsc.Model.WorkFlow { + /// + /// A Writting. + /// Une ligne d'écriture dans un devis ou une facture + /// public class Writting { + /// + /// Gets or sets the identifier. + /// + /// The identifier. public long Id { get; set; } + /// + /// Gets or sets the unitary cost, per unit, or per hour ... + /// Who knows? + /// + /// The unitary cost. + [Required()] public decimal UnitaryCost { get; set; } + /// + /// Gets or sets the count. + /// + /// The count. + [Required()] public int Count { get; set; } + /// + /// Gets or sets the product reference. + /// + /// The product reference. + [Required()] public string ProductReference { get; set; } + /// + /// Gets or sets the description. + /// + /// The description. + [Required()] public string Description { get; set; } } }