Google date quey,

refactiring,
docpage

* Yavsc.sln:
* Web.csproj:
* YavscModel.csproj:
* OtherWebException.cs:
* ProjectInfo.cs:
* IValueProvider.cs:
* CalendarApi.cs:
* HomeController.cs:
* TemplateException.cs:
* WorkFlowController.cs:
* NpgsqlWorkflow.csproj:
* GoogleErrorMessage.cs:
* ITCPNpgsqlProvider.cs:
* NpgsqlContentProvider.cs:
* ITContentProvider.csproj:
* FrontOfficeApiController.cs:
* NpgsqlContentProvider.csproj: refactoring

* App.master:
* WebApiConfig.cs: New Web api configuration architecture

* SalesCatalog.csproj:
* XmlCatalogProvider.cs: using MVC to get the catalog xml filename 

* WorkFlowManager.cs:
* FrontOfficeController.cs:
* CatalogManager.cs: No more extra argument to get the catalog

* DateQuery.aspx:
* AskForADate.cs:
* GoogleController.cs: Google Date new query model

* style.css:
* BBCodeHelper.cs: Doc page responsive design

* Service.cs:
* SetPrice.cs: xml doc

* WebApiConfig.cs: refactioring
vnext
Paul Schneider 10 years ago
parent 7b0dd0c1e2
commit 721b11eba3
29 changed files with 124 additions and 104 deletions

@ -1,5 +1,5 @@
using System; using System;
using WorkFlowProvider; using Yavsc;
using Npgsql; using Npgsql;
namespace ITContentProvider namespace ITContentProvider

@ -49,9 +49,9 @@
<Project>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</Project> <Project>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</Project>
<Name>YavscModel</Name> <Name>YavscModel</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\WorkFlowProvider\NpgsqlWorkflow.csproj"> <ProjectReference Include="..\WorkFlowProvider\NpgsqlContentProvider.csproj">
<Project>{821FF72D-9F4B-4A2C-B95C-7B965291F119}</Project> <Project>{821FF72D-9F4B-4A2C-B95C-7B965291F119}</Project>
<Name>NpgsqlWorkflow</Name> <Name>NpgsqlContentProvider</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -1,5 +1,5 @@
using System; using System;
using WorkFlowProvider; using Yavsc;
namespace ITContentProvider namespace ITContentProvider
{ {

@ -36,6 +36,7 @@
<Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Web.Mvc" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AssemblyInfo.cs" /> <Compile Include="AssemblyInfo.cs" />

@ -15,6 +15,7 @@ namespace SalesCatalog.XmlImplementation
/// </summary> /// </summary>
public class XmlCatalogProvider: CatalogProvider public class XmlCatalogProvider: CatalogProvider
{ {
#region implemented abstract members of SalesCatalog.CatalogProvider #region implemented abstract members of SalesCatalog.CatalogProvider
/// <summary> /// <summary>
/// Gets the catalog, loading it from /// Gets the catalog, loading it from
@ -60,12 +61,8 @@ namespace SalesCatalog.XmlImplementation
if (config ["connection"] == null) if (config ["connection"] == null)
throw new Exception ("the 'connection' parameter is null " + throw new Exception ("the 'connection' parameter is null " +
"(it should be the absolute path to the xml catalog)"); "(it should be the absolute path to the xml catalog)");
// config ["connection"] starts with "~/" string cnx = (string) config ["connection"];
fileName = (string) config ["connection"]; fileName = HttpContext.Current.Server.MapPath(cnx);
if (fileName.StartsWith ("~/")) {
fileName = HttpContext.Current.Server.MapPath(
config ["connection"]);
}
LoadCatalog (); LoadCatalog ();
} }

@ -13,7 +13,7 @@ using System.IO;
using System.Text; using System.Text;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace WorkFlowProvider namespace Yavsc
{ {
/// <summary> /// <summary>
/// Npgsql content provider. /// Npgsql content provider.

@ -11,7 +11,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SalesCatalog", "SalesCatalo
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YavscModel", "yavscModel\YavscModel.csproj", "{68F5B80A-616E-4C3C-91A0-828AA40000BD}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YavscModel", "yavscModel\YavscModel.csproj", "{68F5B80A-616E-4C3C-91A0-828AA40000BD}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NpgsqlWorkflow", "WorkFlowProvider\NpgsqlWorkflow.csproj", "{821FF72D-9F4B-4A2C-B95C-7B965291F119}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NpgsqlContentProvider", "WorkFlowProvider\NpgsqlContentProvider.csproj", "{821FF72D-9F4B-4A2C-B95C-7B965291F119}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YavscClient", "yavscclient\YavscClient.csproj", "{EEFCECE6-3B7F-4BBE-B7AF-69377AF3CF39}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YavscClient", "yavscclient\YavscClient.csproj", "{EEFCECE6-3B7F-4BBE-B7AF-69377AF3CF39}"
EndProject EndProject

@ -10,7 +10,7 @@ using System.Web;
using System.Linq; using System.Linq;
using System.IO; using System.IO;
using System.Net; using System.Net;
using WorkFlowProvider; using Yavsc;
using System.Web.Security; using System.Web.Security;
using Yavsc.Model.WorkFlow; using Yavsc.Model.WorkFlow;
using System.Reflection; using System.Reflection;
@ -52,7 +52,7 @@ namespace Yavsc.ApiControllers
[AcceptVerbs ("GET")] [AcceptVerbs ("GET")]
public Catalog Catalog () public Catalog Catalog ()
{ {
Catalog c = CatalogManager.GetCatalog (Request.RequestUri.AbsolutePath); Catalog c = CatalogManager.GetCatalog ();
return c; return c;
} }
@ -65,19 +65,19 @@ namespace Yavsc.ApiControllers
[AcceptVerbs ("GET")] [AcceptVerbs ("GET")]
public ProductCategory GetProductCategorie (string brandName, string prodCategorie) public ProductCategory GetProductCategorie (string brandName, string prodCategorie)
{ {
return CatalogManager.GetCatalog (Request.RequestUri.AbsolutePath).GetBrand (brandName).GetProductCategory (prodCategorie); return CatalogManager.GetCatalog ().GetBrand (brandName).GetProductCategory (prodCategorie);
} }
/// <summary> /// <summary>
/// Gets the estimate. /// Gets the estimate.
/// </summary> /// </summary>
/// <returns>The estimate.</returns> /// <returns>The estimate.</returns>
/// <param name="Id">Estimate Id.</param> /// <param name="id">Estimate Id.</param>
[Authorize] [Authorize]
[HttpGet] [HttpGet]
public Estimate GetEstimate (long Id) public Estimate GetEstimate (long id)
{ {
Estimate est = wfmgr.ContentProvider.GetEstimate (Id); Estimate est = wfmgr.ContentProvider.GetEstimate (id);
return est; return est;
} }
@ -87,13 +87,13 @@ namespace Yavsc.ApiControllers
/// Gets the estim tex. /// Gets the estim tex.
/// </summary> /// </summary>
/// <returns>The estim tex.</returns> /// <returns>The estim tex.</returns>
/// <param name="estimid">Estimid.</param> /// <param name="id">Estimate id.</param>
[AcceptVerbs ("GET")] [AcceptVerbs ("GET")]
public HttpResponseMessage EstimateToTex (long estimid) public HttpResponseMessage EstimateToTex (long id)
{ {
string texest = null; string texest = null;
try { try {
texest = estimateToTex (estimid); texest = estimateToTex (id);
} catch (TemplateException ex) { } catch (TemplateException ex) {
return new HttpResponseMessage (HttpStatusCode.OK) { Content = return new HttpResponseMessage (HttpStatusCode.OK) { Content =
new ObjectContent (typeof(string), new ObjectContent (typeof(string),
@ -110,7 +110,7 @@ namespace Yavsc.ApiControllers
} }
if (texest == null) if (texest == null)
return new HttpResponseMessage (HttpStatusCode.OK) { Content = 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, new ErrorHtmlFormatter (HttpStatusCode.NotFound,
LocalizedText.Estimate_not_found)) LocalizedText.Estimate_not_found))
}; };

@ -8,7 +8,7 @@ using Yavsc.Controllers;
using System.Collections.Generic; using System.Collections.Generic;
using Yavsc.Model; using Yavsc.Model;
using Yavsc.Model.WorkFlow; using Yavsc.Model.WorkFlow;
using WorkFlowProvider; using Yavsc;
using System.Web.Security; using System.Web.Security;
using System.Threading; using System.Threading;
using Yavsc.Model.FrontOffice; using Yavsc.Model.FrontOffice;
@ -64,7 +64,8 @@ namespace Yavsc.Controllers
[Authorize] [Authorize]
public ActionResult Estimate (Estimate model, string submit) public ActionResult Estimate (Estimate model, string submit)
{ {
ViewData ["WebApiBase"] = "http://" + Request.Url.Authority + "/api"; // Obsolete, set in master page
ViewData ["WebApiBase"] = "http://" + Request.Url.Authority + "/api";
ViewData ["WABASEWF"] = ViewData ["WebApiBase"] + "/WorkFlow"; ViewData ["WABASEWF"] = ViewData ["WebApiBase"] + "/WorkFlow";
if (submit == null) { if (submit == null) {
if (model.Id > 0) { if (model.Id > 0) {
@ -112,7 +113,7 @@ namespace Yavsc.Controllers
public ActionResult Catalog () public ActionResult Catalog ()
{ {
return View ( return View (
CatalogManager.GetCatalog (Request.Url.AbsolutePath) CatalogManager.GetCatalog ()
); );
} }
@ -122,7 +123,7 @@ namespace Yavsc.Controllers
[AcceptVerbs ("GET")] [AcceptVerbs ("GET")]
public ActionResult Brand (string id) public ActionResult Brand (string id)
{ {
Catalog c = CatalogManager.GetCatalog (Request.Url.AbsolutePath); Catalog c = CatalogManager.GetCatalog ();
ViewData ["BrandName"] = id; ViewData ["BrandName"] = id;
return View (c.GetBrand (id)); return View (c.GetBrand (id));
} }
@ -139,7 +140,7 @@ namespace Yavsc.Controllers
ViewData ["BrandId"] = brandid; ViewData ["BrandId"] = brandid;
ViewData ["ProductCategoryId"] = pcid; ViewData ["ProductCategoryId"] = pcid;
return View ( return View (
CatalogManager.GetCatalog (Request.Url.AbsolutePath).GetBrand (brandid).GetProductCategory (pcid) CatalogManager.GetCatalog ().GetBrand (brandid).GetProductCategory (pcid)
); );
} }
@ -156,7 +157,7 @@ namespace Yavsc.Controllers
ViewData ["BrandName"] = id; ViewData ["BrandName"] = id;
ViewData ["ProdCatRef"] = pc; ViewData ["ProdCatRef"] = pc;
ViewData ["ProdRef"] = pref; ViewData ["ProdRef"] = pref;
Catalog cat = CatalogManager.GetCatalog (Request.Url.AbsolutePath); Catalog cat = CatalogManager.GetCatalog ();
if (cat == null) { if (cat == null) {
ViewData ["Message"] = "Catalog introuvable"; ViewData ["Message"] = "Catalog introuvable";
ViewData ["RefType"] = "Catalog"; ViewData ["RefType"] = "Catalog";

@ -288,14 +288,13 @@ namespace Yavsc.Controllers
public ActionResult DateQuery (AskForADate model) public ActionResult DateQuery (AskForADate model)
{ {
if (ModelState.IsValid) { if (ModelState.IsValid) {
if (model.MinDate < DateTime.Now) {
ModelState.AddModelError ("MinTime", "This first date must be in the future."); DateTime mindate = DateTime.Now;
return View (model); if (model.PreferedDate < mindate)
} model.PreferedDate = mindate;
if (model.MinDate > model.MaxDate) { if (model.MaxDate < mindate)
ModelState.AddModelError ("MinTime", "This first date must be lower than the second one."); model.MaxDate = mindate.AddYears (1);
return View (model);
}
var muc = Membership.FindUsersByName (model.UserName); var muc = Membership.FindUsersByName (model.UserName);
if (muc.Count == 0) { if (muc.Count == 0) {
ModelState.AddModelError ("UserName", "Non existent user"); ModelState.AddModelError ("UserName", "Non existent user");
@ -309,22 +308,18 @@ namespace Yavsc.Controllers
return View (model); return View (model);
} }
DateTime mindate = model.MinDate;
mindate = mindate.AddHours (int.Parse (model.MinTime.Substring (0, 2)));
mindate = mindate.AddMinutes (int.Parse (model.MinTime.Substring (3, 2)));
DateTime maxdate = model.MaxDate; DateTime maxdate = model.MaxDate;
maxdate = maxdate.AddHours (int.Parse (model.MaxTime.Substring (0, 2)));
maxdate = maxdate.AddMinutes (int.Parse (model.MaxTime.Substring (3, 2)));
CalendarApi c = new CalendarApi (); CalendarApi c = new CalendarApi ();
CalendarEntryList res; CalendarEntryList res;
try { try {
res = c.GetCalendar (calid, mindate, maxdate, upr); res = c.GetCalendar (calid, mindate, maxdate, upr);
} catch (GoogleErrorException ex) { } catch (OtherWebException ex) {
ViewData ["Title"] = ex.Title; ViewData ["Title"] = ex.Title;
ViewData ["Content"] = ex.Content; ViewData ["Content"] = ex.Content;
return View ("GoogleErrorMessage", ex); return View ("GoogleErrorMessage", ex);
} }
return View (res); return View (res);
} }
return View (model); return View (model);

@ -13,7 +13,7 @@ using System.Resources;
using Yavsc.Model; using Yavsc.Model;
using Npgsql.Web; using Npgsql.Web;
using ITContentProvider; using ITContentProvider;
using WorkFlowProvider; using Yavsc;
using Npgsql.Web.Blog; using Npgsql.Web.Blog;
namespace Yavsc.Controllers namespace Yavsc.Controllers

@ -10,7 +10,7 @@ using System.Web;
using System.Linq; using System.Linq;
using System.IO; using System.IO;
using System.Net; using System.Net;
using WorkFlowProvider; using Yavsc;
using System.Web.Security; using System.Web.Security;
using Yavsc.Model.WorkFlow; using Yavsc.Model.WorkFlow;
using System.Reflection; using System.Reflection;

@ -10,7 +10,7 @@ using System.Web;
using System.Linq; using System.Linq;
using System.IO; using System.IO;
using System.Net; using System.Net;
using WorkFlowProvider; using Yavsc;
using System.Web.Security; using System.Web.Security;
using Yavsc.Model.WorkFlow; using Yavsc.Model.WorkFlow;
using System.Reflection; using System.Reflection;

@ -57,8 +57,8 @@ namespace Yavsc
{ {
config.Routes.MapHttpRoute( config.Routes.MapHttpRoute(
name: "DefaultApi", name: "DefaultApi",
routeTemplate: WebApiConfig.UrlPrefix + "/{controller}/{id}", routeTemplate: WebApiConfig.UrlPrefix + "/{controller}/{action}/{id}",
defaults: new { id = RouteParameter.Optional } defaults: new { action="Index", id = RouteParameter.Optional }
); );
} }
} }

@ -4,7 +4,7 @@ using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Web; using System.Web;
using System.Web.Security; using System.Web.Security;
using WorkFlowProvider; using Yavsc;
using Yavsc.Model.WorkFlow; using Yavsc.Model.WorkFlow;
using System.Web.Http; using System.Web.Http;
using System.Web.Http.Controllers; using System.Web.Http.Controllers;

@ -55,8 +55,13 @@ namespace Yavsc.Helpers
tib.AddCssClass (BBCodeCaseClass); tib.AddCssClass (BBCodeCaseClass);
string temp = tagUsage (t); string temp = tagUsage (t);
tib.InnerHtml = temp; tib.InnerHtml = string.Format("[{0}]",t.Name);
u.Add (string.Format ("{0} <div class=\"{2}\">{1}</div>", tib.ToString (), Parser.ToHtml (temp),BBCodeViewClass)); u.Add (string.Format (
"{0} <div class=\"{2}\"><code>{3}</code>{1}</div>",
tib.ToString (),
Parser.ToHtml (temp),
BBCodeViewClass,
temp));
} }
@ -65,6 +70,7 @@ namespace Yavsc.Helpers
} }
static string tagUsage(BBTag t,string content=null) static string tagUsage(BBTag t,string content=null)
{ {
StringBuilder sb = new StringBuilder (); StringBuilder sb = new StringBuilder ();
@ -200,6 +206,13 @@ namespace Yavsc.Helpers
static string TocContentTransformer (string instr) static string TocContentTransformer (string instr)
{ {
StringBuilder header = new StringBuilder ();
TagBuilder bshd = new TagBuilder("div");
bshd.AddCssClass ("bshd");
header.AppendFormat ("<img src=\"{0}\" alt=\"[Show/Hide TOC]\" class=\"bsh\">\n",
"/Theme/dark/rect.png");
StringBuilder ttb = new StringBuilder (); StringBuilder ttb = new StringBuilder ();
int m1=0, m2=0, m3=0; int m1=0, m2=0, m3=0;
foreach (string key in d.Keys) { foreach (string key in d.Keys) {
@ -254,7 +267,10 @@ namespace Yavsc.Helpers
} }
TagBuilder aside = new TagBuilder ("aside"); TagBuilder aside = new TagBuilder ("aside");
aside.InnerHtml = ttb.ToString (); aside.InnerHtml = ttb.ToString ();
return aside.ToString(); aside.AddCssClass ("bshpanel");
bshd.InnerHtml = header.ToString()+aside.ToString();
return bshd.ToString ();
} }
static string DocPageContentTransformer (string instr) static string DocPageContentTransformer (string instr)

@ -29,6 +29,7 @@ using System.Text;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Web; using System.Web;
using System.Runtime.Serialization.Json; using System.Runtime.Serialization.Json;
using Yavsc.Model;
namespace Yavsc.Helpers.Google namespace Yavsc.Helpers.Google
{ {
@ -116,7 +117,7 @@ namespace Yavsc.Helpers.Google
} }
} catch (WebException ex) { } catch (WebException ex) {
webreq.Abort (); webreq.Abort ();
throw new GoogleErrorException (ex); throw new OtherWebException (ex);
} }
webreq.Abort (); webreq.Abort ();
return res; return res;

@ -23,6 +23,7 @@
<a href="<%=Request.Url.Scheme + "://" + Request.Url.Authority%>"><%= YavscHelpers.SiteName %></a> <a href="<%=Request.Url.Scheme + "://" + Request.Url.Authority%>"><%= YavscHelpers.SiteName %></a>
</h1> </h1>
</asp:ContentPlaceHolder> </asp:ContentPlaceHolder>
<asp:ContentPlaceHolder ID="header" runat="server"></asp:ContentPlaceHolder> <asp:ContentPlaceHolder ID="header" runat="server"></asp:ContentPlaceHolder>
<% if (ViewData["Error"]!=null) { %> <% if (ViewData["Error"]!=null) { %>
<div class="error"> <div class="error">
@ -34,6 +35,7 @@
<%= Html.Encode(ViewData["Message"]) %> <%= Html.Encode(ViewData["Message"]) %>
</div> </div>
<% } %> <% } %>
</header> </header>
<main> <main>
@ -43,9 +45,13 @@
</main> </main>
<aside> <aside>
<asp:ContentPlaceHolder ID="MASContent" runat="server"> <asp:ContentPlaceHolder ID="MASContent" runat="server">
</asp:ContentPlaceHolder> </asp:ContentPlaceHolder>
<div id="login"> <div id="login">
<% if (Membership.GetUser()==null) { %> <% if (Membership.GetUser()==null) { %>
<%= Html.ActionLink( YavscHelpers.SiteName, "Index", "Home" ,null, new { @class="actionlink" } ) %> <%= Html.ActionLink( YavscHelpers.SiteName, "Index", "Home" ,null, new { @class="actionlink" } ) %>
@ -74,7 +80,7 @@
<% } %> <% } %>
</footer> </footer>
<script type="text/javascript"> <script type="text/javascript">
var apiBaseUrl = '@Url.Content(ProjectNameSpace.WebApiConfig.UrlPrefixRelative)'; var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>';
</script> </script>
</body> </body>
</html> </html>

@ -22,24 +22,20 @@ main {
margin:.5em; margin:.5em;
} }
aside {background-color: rgba(32,16,16,0.8); .panel,.bshpanel,aside {
background-color: rgba(32,16,16,0.8);
padding: 0.5em; margin: 0.5em; padding: 0.5em; margin: 0.5em;
border-radius:5px; border: solid 1px #000060; border-radius:5px; border: solid 1px #000060;
float: right; float: right;
} }
.bsh { float: right; }
video,img { video,img {
max-width:100%; max-width:100%;
max-height:75%; max-height:75%;
position:relative; position:relative;
} }
.panel {
background-color: rgba(16,32,32,0.8);
padding: 1em; margin: 0.5em;
border-radius:25px; border: solid 1px #000060;
max-width: 17em;
max-height:30em; border:solid green 1px;}
footer { footer {
position:fixed; position:fixed;
@ -176,9 +172,21 @@ padding-left: 20px;
body {background-color:white;color:black;} body {background-color:white;color:black;}
header,footer,.postcomment,.actionlink,.metablog{ display:none;} header,footer,.postcomment,.actionlink,.metablog{ display:none;}
} }
@media all and (min-width: 641px) {
.bshpanel { display:block; }
.bsh { display: none; }
}
@media all and (max-width: 640px) { @media all and (max-width: 640px) {
.bshpanel { display:none; }
.bsh { display: inline; }
.bshd:hover .bshpanel {
display: block;
}
.bshd:hover .bsh {
display: none;
}
footer img { footer img {
max-height: 1em; max-height: 1em;
} }
@ -186,4 +194,7 @@ padding-left: 20px;
font-size: xx-small; font-size: xx-small;
} }
body { margin-bottom:1em; font-size: smaller; } body { margin-bottom:1em; font-size: smaller; }
}
} }

@ -52,14 +52,6 @@ return Globalize.format( new Date(value), "t" );
<% using ( Html.BeginForm("DateQuery","Google") ) { %> <% using ( Html.BeginForm("DateQuery","Google") ) { %>
<p>Période de recherche:</p> <p>Période de recherche:</p>
<p>
<%= Html.LabelFor(model=>model.MinDate) %>:<br>
Le <%= Html.TextBoxFor(model=>model.MinDate) %>
<%= Html.ValidationMessageFor(model=>model.MinDate) %>
à
<%= Html.TextBoxFor(model=>model.MinTime) %>
<%= Html.ValidationMessageFor(model=>model.MinTime) %>
</p>
<p> <p>
<%= Html.LabelFor(model=>model.MaxDate) %>:<br> <%= Html.LabelFor(model=>model.MaxDate) %>:<br>

@ -191,7 +191,7 @@
<Compile Include="Formatters\RssFeedsFormatter.cs" /> <Compile Include="Formatters\RssFeedsFormatter.cs" />
<Compile Include="Controllers\PaypalApiController.cs" /> <Compile Include="Controllers\PaypalApiController.cs" />
<Compile Include="Formatters\TexToPdfFormatter.cs" /> <Compile Include="Formatters\TexToPdfFormatter.cs" />
<Compile Include="WebApiConfig.cs" /> <Compile Include="Controllers\WebApiConfig.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Views\Web.config" /> <Content Include="Views\Web.config" />
@ -723,9 +723,9 @@
<Project>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</Project> <Project>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</Project>
<Name>YavscModel</Name> <Name>YavscModel</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\WorkFlowProvider\NpgsqlWorkflow.csproj"> <ProjectReference Include="..\WorkFlowProvider\NpgsqlContentProvider.csproj">
<Project>{821FF72D-9F4B-4A2C-B95C-7B965291F119}</Project> <Project>{821FF72D-9F4B-4A2C-B95C-7B965291F119}</Project>
<Name>NpgsqlWorkflow</Name> <Name>NpgsqlContentProvider</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -29,7 +29,7 @@ namespace Yavsc.Model.FrontOffice.Billing
public class SetPrice: Price public class SetPrice: Price
{ {
/// <summary> /// <summary>
/// Gets or sets the minimum count. /// Gets or sets the minimum count for this setprice.
/// </summary> /// </summary>
/// <value>The minimum count.</value> /// <value>The minimum count.</value>
[Range(0,int.MaxValue)] [Range(0,int.MaxValue)]

@ -1,4 +1,7 @@
using System; using System;
using System.Web;
namespace Yavsc.Model.FrontOffice namespace Yavsc.Model.FrontOffice
{ {
/// <summary> /// <summary>
@ -14,9 +17,9 @@ namespace Yavsc.Model.FrontOffice
/// </summary> /// </summary>
/// <returns>The catalog.</returns> /// <returns>The catalog.</returns>
/// <param name="catalogUri">Catalog URI.</param> /// <param name="catalogUri">Catalog URI.</param>
public static Catalog GetCatalog (string catalogUri) public static Catalog GetCatalog ()
{ {
string catalogUri = HttpContext.Current.Request.Url.AbsolutePath;
if (defaultProvider == null) { if (defaultProvider == null) {
if (CatalogHelper.Config == null) if (CatalogHelper.Config == null)
CatalogHelper.LoadConfig (); CatalogHelper.LoadConfig ();

@ -26,6 +26,11 @@ namespace Yavsc.Model.FrontOffice
/// <value>The set prices.</value> /// <value>The set prices.</value>
public SetPrice[] SetPrices { get; set; } public SetPrice[] SetPrices { get; set; }
/// <summary>
/// Role names involved in this kind of service
/// </summary>
/// <value>The providers.</value>
public string[] Providers { get; set; }
#region implemented abstract members of Product #region implemented abstract members of Product
/// <summary> /// <summary>
/// Gets the sales conditions. /// Gets the sales conditions.

@ -34,18 +34,23 @@ namespace Yavsc.Model.Google
/// </summary> /// </summary>
public AskForADate () public AskForADate ()
{ {
MinDate = MaxDate = DateTime.Now.AddMinutes (5); MaxDate = DateTime.Now.AddMinutes (5);
} }
/// <summary> /// <summary>
/// Gets or sets the minimum date. /// Gets or sets the prefered date.
/// </summary> /// </summary>
/// <value>The minimum date.</value> /// <value>The prefered date.</value>
[Display(Name="MinDate",ResourceType=typeof(LocalizedText))]
[DataType(DataType.Date)] [DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)] [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
[Required(ErrorMessage = "S'il vous plait, saisissez une date minimale au format jj/mm/aaaa")] public DateTime PreferedDate { get; set; }
public DateTime MinDate { get; set; }
/// <summary>
/// Gets or sets the minimum time.
/// </summary>
/// <value>The minimum time.</value>
[RegularExpression("\\d\\d:\\d\\d")]
public string PreferedHour { get; set; }
/// <summary> /// <summary>
/// Gets or sets the max date. /// Gets or sets the max date.
@ -56,27 +61,14 @@ namespace Yavsc.Model.Google
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)] [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
public DateTime MaxDate { get; set; } public DateTime MaxDate { get; set; }
/// <summary>
/// Gets or sets the minimum time.
/// </summary>
/// <value>The minimum time.</value>
[Required(ErrorMessage = "S'il vous plait, saisissez une heure minimale au format hh:mm sur 24 heures")]
[RegularExpression("\\d\\d:\\d\\d")]
public string MinTime { get; set; }
/// <summary>
/// Gets or sets the max time.
/// </summary>
/// <value>The max time.</value>
[RegularExpression("\\d\\d:\\d\\d")]
public string MaxTime { get; set; }
/// <summary> /// <summary>
/// Gets or sets the duration. /// Gets or sets the duration.
/// </summary> /// </summary>
/// <value>The duration.</value> /// <value>The duration.</value>
[RegularExpression("\\d\\d:\\d\\d")] [RegularExpression("\\d\\d:\\d\\d")]
public string Duration { get; set; } [Required(ErrorMessage= "S'il vous plait, saisissez une durée minimale d'intervention")]
public string MinDuration { get; set; }
/// <summary> /// <summary>
/// Gets or sets the name of the user. /// Gets or sets the name of the user.

@ -23,12 +23,12 @@ using System.Net;
using System.IO; using System.IO;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Yavsc.Model.Google namespace Yavsc.Model
{ {
/// <summary> /// <summary>
/// Google error exception. /// Google error exception.
/// </summary> /// </summary>
public class GoogleErrorException : Exception public class OtherWebException : Exception
{ {
/// <summary> /// <summary>
/// Gets or sets the title. /// Gets or sets the title.
@ -44,7 +44,7 @@ namespace Yavsc.Model.Google
/// Initializes a new instance of the <see cref="Yavsc.Model.Google.GoogleErrorException"/> class. /// Initializes a new instance of the <see cref="Yavsc.Model.Google.GoogleErrorException"/> class.
/// </summary> /// </summary>
/// <param name="ex">Ex.</param> /// <param name="ex">Ex.</param>
public GoogleErrorException (WebException ex) { public OtherWebException (WebException ex) {
// ASSERT ex != null; // ASSERT ex != null;
Title = ex.Message; Title = ex.Message;
@ -60,7 +60,7 @@ namespace Yavsc.Model.Google
/// <param name="ex">Ex.</param> /// <param name="ex">Ex.</param>
/// <param name="message">Message.</param> /// <param name="message">Message.</param>
[Obsolete] [Obsolete]
public GoogleErrorException(Exception ex, string message) { public OtherWebException(Exception ex, string message) {
Content = message; Content = message;
Title = ex.Message; Title = ex.Message;
} }
@ -69,7 +69,7 @@ namespace Yavsc.Model.Google
/// </summary> /// </summary>
/// <param name="ex">Ex.</param> /// <param name="ex">Ex.</param>
[Obsolete] [Obsolete]
public GoogleErrorException(Exception ex) { public OtherWebException(Exception ex) {
Content = ex.Message; Content = ex.Message;
Title = ex.GetType().FullName; Title = ex.GetType().FullName;
} }

@ -162,7 +162,7 @@ namespace Yavsc.Model.WorkFlow
{ {
if (!string.IsNullOrWhiteSpace(productid)) { if (!string.IsNullOrWhiteSpace(productid)) {
if (Catalog == null) if (Catalog == null)
Catalog = CatalogManager.GetCatalog ("/WorkFlowApi"); Catalog = CatalogManager.GetCatalog ();
if (Catalog == null) if (Catalog == null)
throw new Exception ("No catalog"); throw new Exception ("No catalog");
Product p = Catalog.FindProduct (productid); Product p = Catalog.FindProduct (productid);

@ -93,7 +93,6 @@
<Compile Include="ITagHandler.cs" /> <Compile Include="ITagHandler.cs" />
<Compile Include="IViewRenderer.cs" /> <Compile Include="IViewRenderer.cs" />
<Compile Include="ViewRenderer.cs" /> <Compile Include="ViewRenderer.cs" />
<Compile Include="Google\GoogleErrorMessage.cs" />
<Compile Include="RssFeeds.cs" /> <Compile Include="RssFeeds.cs" />
<Compile Include="FrontOffice\Commande.cs" /> <Compile Include="FrontOffice\Commande.cs" />
<Compile Include="FrontOffice\Catalog\Brand.cs" /> <Compile Include="FrontOffice\Catalog\Brand.cs" />
@ -138,6 +137,7 @@
<Compile Include="FrontOffice\CommandSet.cs" /> <Compile Include="FrontOffice\CommandSet.cs" />
<Compile Include="FrontOffice\Catalog\Billing\SetPrice.cs" /> <Compile Include="FrontOffice\Catalog\Billing\SetPrice.cs" />
<Compile Include="FrontOffice\Catalog\Billing\Price.cs" /> <Compile Include="FrontOffice\Catalog\Billing\Price.cs" />
<Compile Include="OtherWebException.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup> <ItemGroup>

Loading…