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
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using WorkFlowProvider;
|
||||
using Yavsc;
|
||||
using Npgsql;
|
||||
|
||||
namespace ITContentProvider
|
||||
|
@ -49,9 +49,9 @@
|
||||
<Project>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</Project>
|
||||
<Name>YavscModel</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WorkFlowProvider\NpgsqlWorkflow.csproj">
|
||||
<ProjectReference Include="..\WorkFlowProvider\NpgsqlContentProvider.csproj">
|
||||
<Project>{821FF72D-9F4B-4A2C-B95C-7B965291F119}</Project>
|
||||
<Name>NpgsqlWorkflow</Name>
|
||||
<Name>NpgsqlContentProvider</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using WorkFlowProvider;
|
||||
using Yavsc;
|
||||
|
||||
namespace ITContentProvider
|
||||
{
|
||||
|
@ -36,6 +36,7 @@
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Mvc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.cs" />
|
||||
|
@ -15,6 +15,7 @@ namespace SalesCatalog.XmlImplementation
|
||||
/// </summary>
|
||||
public class XmlCatalogProvider: CatalogProvider
|
||||
{
|
||||
|
||||
#region implemented abstract members of SalesCatalog.CatalogProvider
|
||||
/// <summary>
|
||||
/// Gets the catalog, loading it from
|
||||
@ -60,12 +61,8 @@ namespace SalesCatalog.XmlImplementation
|
||||
if (config ["connection"] == null)
|
||||
throw new Exception ("the 'connection' parameter is null " +
|
||||
"(it should be the absolute path to the xml catalog)");
|
||||
// config ["connection"] starts with "~/"
|
||||
fileName = (string) config ["connection"];
|
||||
if (fileName.StartsWith ("~/")) {
|
||||
fileName = HttpContext.Current.Server.MapPath(
|
||||
config ["connection"]);
|
||||
}
|
||||
string cnx = (string) config ["connection"];
|
||||
fileName = HttpContext.Current.Server.MapPath(cnx);
|
||||
LoadCatalog ();
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ using System.IO;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace WorkFlowProvider
|
||||
namespace Yavsc
|
||||
{
|
||||
/// <summary>
|
||||
/// Npgsql content provider.
|
||||
|
@ -11,7 +11,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SalesCatalog", "SalesCatalo
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YavscModel", "yavscModel\YavscModel.csproj", "{68F5B80A-616E-4C3C-91A0-828AA40000BD}"
|
||||
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
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YavscClient", "yavscclient\YavscClient.csproj", "{EEFCECE6-3B7F-4BBE-B7AF-69377AF3CF39}"
|
||||
EndProject
|
||||
|
@ -10,7 +10,7 @@ using System.Web;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using WorkFlowProvider;
|
||||
using Yavsc;
|
||||
using System.Web.Security;
|
||||
using Yavsc.Model.WorkFlow;
|
||||
using System.Reflection;
|
||||
@ -52,7 +52,7 @@ namespace Yavsc.ApiControllers
|
||||
[AcceptVerbs ("GET")]
|
||||
public Catalog Catalog ()
|
||||
{
|
||||
Catalog c = CatalogManager.GetCatalog (Request.RequestUri.AbsolutePath);
|
||||
Catalog c = CatalogManager.GetCatalog ();
|
||||
return c;
|
||||
}
|
||||
|
||||
@ -65,19 +65,19 @@ namespace Yavsc.ApiControllers
|
||||
[AcceptVerbs ("GET")]
|
||||
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>
|
||||
/// Gets the estimate.
|
||||
/// </summary>
|
||||
/// <returns>The estimate.</returns>
|
||||
/// <param name="Id">Estimate Id.</param>
|
||||
/// <param name="id">Estimate Id.</param>
|
||||
[Authorize]
|
||||
[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;
|
||||
}
|
||||
|
||||
@ -87,13 +87,13 @@ namespace Yavsc.ApiControllers
|
||||
/// Gets the estim tex.
|
||||
/// </summary>
|
||||
/// <returns>The estim tex.</returns>
|
||||
/// <param name="estimid">Estimid.</param>
|
||||
/// <param name="id">Estimate id.</param>
|
||||
[AcceptVerbs ("GET")]
|
||||
public HttpResponseMessage EstimateToTex (long estimid)
|
||||
public HttpResponseMessage EstimateToTex (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),
|
||||
@ -110,7 +110,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))
|
||||
};
|
||||
|
@ -8,7 +8,7 @@ using Yavsc.Controllers;
|
||||
using System.Collections.Generic;
|
||||
using Yavsc.Model;
|
||||
using Yavsc.Model.WorkFlow;
|
||||
using WorkFlowProvider;
|
||||
using Yavsc;
|
||||
using System.Web.Security;
|
||||
using System.Threading;
|
||||
using Yavsc.Model.FrontOffice;
|
||||
@ -64,7 +64,8 @@ namespace Yavsc.Controllers
|
||||
[Authorize]
|
||||
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";
|
||||
if (submit == null) {
|
||||
if (model.Id > 0) {
|
||||
@ -112,7 +113,7 @@ namespace Yavsc.Controllers
|
||||
public ActionResult Catalog ()
|
||||
{
|
||||
return View (
|
||||
CatalogManager.GetCatalog (Request.Url.AbsolutePath)
|
||||
CatalogManager.GetCatalog ()
|
||||
);
|
||||
}
|
||||
|
||||
@ -122,7 +123,7 @@ namespace Yavsc.Controllers
|
||||
[AcceptVerbs ("GET")]
|
||||
public ActionResult Brand (string id)
|
||||
{
|
||||
Catalog c = CatalogManager.GetCatalog (Request.Url.AbsolutePath);
|
||||
Catalog c = CatalogManager.GetCatalog ();
|
||||
ViewData ["BrandName"] = id;
|
||||
return View (c.GetBrand (id));
|
||||
}
|
||||
@ -139,7 +140,7 @@ namespace Yavsc.Controllers
|
||||
ViewData ["BrandId"] = brandid;
|
||||
ViewData ["ProductCategoryId"] = pcid;
|
||||
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 ["ProdCatRef"] = pc;
|
||||
ViewData ["ProdRef"] = pref;
|
||||
Catalog cat = CatalogManager.GetCatalog (Request.Url.AbsolutePath);
|
||||
Catalog cat = CatalogManager.GetCatalog ();
|
||||
if (cat == null) {
|
||||
ViewData ["Message"] = "Catalog introuvable";
|
||||
ViewData ["RefType"] = "Catalog";
|
||||
|
@ -288,14 +288,13 @@ namespace Yavsc.Controllers
|
||||
public ActionResult DateQuery (AskForADate model)
|
||||
{
|
||||
if (ModelState.IsValid) {
|
||||
if (model.MinDate < DateTime.Now) {
|
||||
ModelState.AddModelError ("MinTime", "This first date must be in the future.");
|
||||
return View (model);
|
||||
}
|
||||
if (model.MinDate > model.MaxDate) {
|
||||
ModelState.AddModelError ("MinTime", "This first date must be lower than the second one.");
|
||||
return View (model);
|
||||
}
|
||||
|
||||
DateTime mindate = DateTime.Now;
|
||||
if (model.PreferedDate < mindate)
|
||||
model.PreferedDate = mindate;
|
||||
if (model.MaxDate < mindate)
|
||||
model.MaxDate = mindate.AddYears (1);
|
||||
|
||||
var muc = Membership.FindUsersByName (model.UserName);
|
||||
if (muc.Count == 0) {
|
||||
ModelState.AddModelError ("UserName", "Non existent user");
|
||||
@ -309,22 +308,18 @@ namespace Yavsc.Controllers
|
||||
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;
|
||||
maxdate = maxdate.AddHours (int.Parse (model.MaxTime.Substring (0, 2)));
|
||||
maxdate = maxdate.AddMinutes (int.Parse (model.MaxTime.Substring (3, 2)));
|
||||
|
||||
CalendarApi c = new CalendarApi ();
|
||||
CalendarEntryList res;
|
||||
try {
|
||||
res = c.GetCalendar (calid, mindate, maxdate, upr);
|
||||
} catch (GoogleErrorException ex) {
|
||||
} catch (OtherWebException ex) {
|
||||
ViewData ["Title"] = ex.Title;
|
||||
ViewData ["Content"] = ex.Content;
|
||||
return View ("GoogleErrorMessage", ex);
|
||||
}
|
||||
|
||||
return View (res);
|
||||
}
|
||||
return View (model);
|
||||
|
@ -13,7 +13,7 @@ using System.Resources;
|
||||
using Yavsc.Model;
|
||||
using Npgsql.Web;
|
||||
using ITContentProvider;
|
||||
using WorkFlowProvider;
|
||||
using Yavsc;
|
||||
using Npgsql.Web.Blog;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
|
@ -10,7 +10,7 @@ using System.Web;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using WorkFlowProvider;
|
||||
using Yavsc;
|
||||
using System.Web.Security;
|
||||
using Yavsc.Model.WorkFlow;
|
||||
using System.Reflection;
|
||||
|
@ -10,7 +10,7 @@ using System.Web;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using WorkFlowProvider;
|
||||
using Yavsc;
|
||||
using System.Web.Security;
|
||||
using Yavsc.Model.WorkFlow;
|
||||
using System.Reflection;
|
||||
|
@ -57,8 +57,8 @@ namespace Yavsc
|
||||
{
|
||||
config.Routes.MapHttpRoute(
|
||||
name: "DefaultApi",
|
||||
routeTemplate: WebApiConfig.UrlPrefix + "/{controller}/{id}",
|
||||
defaults: new { id = RouteParameter.Optional }
|
||||
routeTemplate: WebApiConfig.UrlPrefix + "/{controller}/{action}/{id}",
|
||||
defaults: new { action="Index", id = RouteParameter.Optional }
|
||||
);
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using WorkFlowProvider;
|
||||
using Yavsc;
|
||||
using Yavsc.Model.WorkFlow;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Controllers;
|
||||
|
@ -55,8 +55,13 @@ namespace Yavsc.Helpers
|
||||
tib.AddCssClass (BBCodeCaseClass);
|
||||
string temp = tagUsage (t);
|
||||
|
||||
tib.InnerHtml = temp;
|
||||
u.Add (string.Format ("{0} <div class=\"{2}\">{1}</div>", tib.ToString (), Parser.ToHtml (temp),BBCodeViewClass));
|
||||
tib.InnerHtml = string.Format("[{0}]",t.Name);
|
||||
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)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
@ -200,6 +206,13 @@ namespace Yavsc.Helpers
|
||||
|
||||
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 ();
|
||||
int m1=0, m2=0, m3=0;
|
||||
foreach (string key in d.Keys) {
|
||||
@ -254,7 +267,10 @@ namespace Yavsc.Helpers
|
||||
}
|
||||
TagBuilder aside = new TagBuilder ("aside");
|
||||
aside.InnerHtml = ttb.ToString ();
|
||||
return aside.ToString();
|
||||
aside.AddCssClass ("bshpanel");
|
||||
bshd.InnerHtml = header.ToString()+aside.ToString();
|
||||
|
||||
return bshd.ToString ();
|
||||
}
|
||||
|
||||
static string DocPageContentTransformer (string instr)
|
||||
|
@ -29,6 +29,7 @@ using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
using System.Web;
|
||||
using System.Runtime.Serialization.Json;
|
||||
using Yavsc.Model;
|
||||
|
||||
namespace Yavsc.Helpers.Google
|
||||
{
|
||||
@ -116,7 +117,7 @@ namespace Yavsc.Helpers.Google
|
||||
}
|
||||
} catch (WebException ex) {
|
||||
webreq.Abort ();
|
||||
throw new GoogleErrorException (ex);
|
||||
throw new OtherWebException (ex);
|
||||
}
|
||||
webreq.Abort ();
|
||||
return res;
|
||||
|
@ -23,6 +23,7 @@
|
||||
<a href="<%=Request.Url.Scheme + "://" + Request.Url.Authority%>"><%= YavscHelpers.SiteName %></a>
|
||||
</h1>
|
||||
</asp:ContentPlaceHolder>
|
||||
|
||||
<asp:ContentPlaceHolder ID="header" runat="server"></asp:ContentPlaceHolder>
|
||||
<% if (ViewData["Error"]!=null) { %>
|
||||
<div class="error">
|
||||
@ -34,6 +35,7 @@
|
||||
<%= Html.Encode(ViewData["Message"]) %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
|
||||
</header>
|
||||
<main>
|
||||
@ -43,9 +45,13 @@
|
||||
|
||||
|
||||
</main>
|
||||
|
||||
|
||||
|
||||
<aside>
|
||||
<asp:ContentPlaceHolder ID="MASContent" runat="server">
|
||||
</asp:ContentPlaceHolder>
|
||||
|
||||
<div id="login">
|
||||
<% if (Membership.GetUser()==null) { %>
|
||||
<%= Html.ActionLink( YavscHelpers.SiteName, "Index", "Home" ,null, new { @class="actionlink" } ) %>
|
||||
@ -74,7 +80,7 @@
|
||||
<% } %>
|
||||
</footer>
|
||||
<script type="text/javascript">
|
||||
var apiBaseUrl = '@Url.Content(ProjectNameSpace.WebApiConfig.UrlPrefixRelative)';
|
||||
var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>';
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -22,24 +22,20 @@ main {
|
||||
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;
|
||||
border-radius:5px; border: solid 1px #000060;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.bsh { float: right; }
|
||||
video,img {
|
||||
max-width:100%;
|
||||
max-height:75%;
|
||||
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 {
|
||||
position:fixed;
|
||||
@ -176,9 +172,21 @@ padding-left: 20px;
|
||||
body {background-color:white;color:black;}
|
||||
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) {
|
||||
|
||||
.bshpanel { display:none; }
|
||||
.bsh { display: inline; }
|
||||
|
||||
.bshd:hover .bshpanel {
|
||||
display: block;
|
||||
}
|
||||
.bshd:hover .bsh {
|
||||
display: none;
|
||||
}
|
||||
footer img {
|
||||
max-height: 1em;
|
||||
}
|
||||
@ -186,4 +194,7 @@ padding-left: 20px;
|
||||
font-size: xx-small;
|
||||
}
|
||||
body { margin-bottom:1em; font-size: smaller; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -52,14 +52,6 @@ return Globalize.format( new Date(value), "t" );
|
||||
<% using ( Html.BeginForm("DateQuery","Google") ) { %>
|
||||
|
||||
<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>
|
||||
<%= Html.LabelFor(model=>model.MaxDate) %>:<br>
|
||||
|
@ -191,7 +191,7 @@
|
||||
<Compile Include="Formatters\RssFeedsFormatter.cs" />
|
||||
<Compile Include="Controllers\PaypalApiController.cs" />
|
||||
<Compile Include="Formatters\TexToPdfFormatter.cs" />
|
||||
<Compile Include="WebApiConfig.cs" />
|
||||
<Compile Include="Controllers\WebApiConfig.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Web.config" />
|
||||
@ -723,9 +723,9 @@
|
||||
<Project>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</Project>
|
||||
<Name>YavscModel</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WorkFlowProvider\NpgsqlWorkflow.csproj">
|
||||
<ProjectReference Include="..\WorkFlowProvider\NpgsqlContentProvider.csproj">
|
||||
<Project>{821FF72D-9F4B-4A2C-B95C-7B965291F119}</Project>
|
||||
<Name>NpgsqlWorkflow</Name>
|
||||
<Name>NpgsqlContentProvider</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -29,7 +29,7 @@ namespace Yavsc.Model.FrontOffice.Billing
|
||||
public class SetPrice: Price
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum count.
|
||||
/// Gets or sets the minimum count for this setprice.
|
||||
/// </summary>
|
||||
/// <value>The minimum count.</value>
|
||||
[Range(0,int.MaxValue)]
|
||||
|
@ -1,4 +1,7 @@
|
||||
using System;
|
||||
using System.Web;
|
||||
|
||||
|
||||
namespace Yavsc.Model.FrontOffice
|
||||
{
|
||||
/// <summary>
|
||||
@ -14,9 +17,9 @@ namespace Yavsc.Model.FrontOffice
|
||||
/// </summary>
|
||||
/// <returns>The catalog.</returns>
|
||||
/// <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 (CatalogHelper.Config == null)
|
||||
CatalogHelper.LoadConfig ();
|
||||
|
@ -26,6 +26,11 @@ namespace Yavsc.Model.FrontOffice
|
||||
/// <value>The set prices.</value>
|
||||
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
|
||||
/// <summary>
|
||||
/// Gets the sales conditions.
|
||||
|
@ -34,18 +34,23 @@ namespace Yavsc.Model.Google
|
||||
/// </summary>
|
||||
public AskForADate ()
|
||||
{
|
||||
MinDate = MaxDate = DateTime.Now.AddMinutes (5);
|
||||
MaxDate = DateTime.Now.AddMinutes (5);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum date.
|
||||
/// Gets or sets the prefered date.
|
||||
/// </summary>
|
||||
/// <value>The minimum date.</value>
|
||||
[Display(Name="MinDate",ResourceType=typeof(LocalizedText))]
|
||||
/// <value>The prefered date.</value>
|
||||
[DataType(DataType.Date)]
|
||||
[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 MinDate { get; set; }
|
||||
public DateTime PreferedDate { 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>
|
||||
/// Gets or sets the max date.
|
||||
@ -56,27 +61,14 @@ namespace Yavsc.Model.Google
|
||||
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
|
||||
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>
|
||||
/// Gets or sets the duration.
|
||||
/// </summary>
|
||||
/// <value>The duration.</value>
|
||||
[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>
|
||||
/// Gets or sets the name of the user.
|
||||
|
@ -23,12 +23,12 @@ using System.Net;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Model.Google
|
||||
namespace Yavsc.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Google error exception.
|
||||
/// </summary>
|
||||
public class GoogleErrorException : Exception
|
||||
public class OtherWebException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
/// <param name="ex">Ex.</param>
|
||||
public GoogleErrorException (WebException ex) {
|
||||
public OtherWebException (WebException ex) {
|
||||
// ASSERT ex != null;
|
||||
Title = ex.Message;
|
||||
|
||||
@ -60,7 +60,7 @@ namespace Yavsc.Model.Google
|
||||
/// <param name="ex">Ex.</param>
|
||||
/// <param name="message">Message.</param>
|
||||
[Obsolete]
|
||||
public GoogleErrorException(Exception ex, string message) {
|
||||
public OtherWebException(Exception ex, string message) {
|
||||
Content = message;
|
||||
Title = ex.Message;
|
||||
}
|
||||
@ -69,7 +69,7 @@ namespace Yavsc.Model.Google
|
||||
/// </summary>
|
||||
/// <param name="ex">Ex.</param>
|
||||
[Obsolete]
|
||||
public GoogleErrorException(Exception ex) {
|
||||
public OtherWebException(Exception ex) {
|
||||
Content = ex.Message;
|
||||
Title = ex.GetType().FullName;
|
||||
}
|
@ -162,7 +162,7 @@ namespace Yavsc.Model.WorkFlow
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(productid)) {
|
||||
if (Catalog == null)
|
||||
Catalog = CatalogManager.GetCatalog ("/WorkFlowApi");
|
||||
Catalog = CatalogManager.GetCatalog ();
|
||||
if (Catalog == null)
|
||||
throw new Exception ("No catalog");
|
||||
Product p = Catalog.FindProduct (productid);
|
||||
|
@ -93,7 +93,6 @@
|
||||
<Compile Include="ITagHandler.cs" />
|
||||
<Compile Include="IViewRenderer.cs" />
|
||||
<Compile Include="ViewRenderer.cs" />
|
||||
<Compile Include="Google\GoogleErrorMessage.cs" />
|
||||
<Compile Include="RssFeeds.cs" />
|
||||
<Compile Include="FrontOffice\Commande.cs" />
|
||||
<Compile Include="FrontOffice\Catalog\Brand.cs" />
|
||||
@ -138,6 +137,7 @@
|
||||
<Compile Include="FrontOffice\CommandSet.cs" />
|
||||
<Compile Include="FrontOffice\Catalog\Billing\SetPrice.cs" />
|
||||
<Compile Include="FrontOffice\Catalog\Billing\Price.cs" />
|
||||
<Compile Include="OtherWebException.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
|
Reference in New Issue
Block a user