Un bouton "Demander un devis"
* INominative.cs: Interface d'un objet destiné à un préstataire spécifié, par une propriété `PerformerName` * NominativeSimpleBookingQuery.cs: implémente l'interface INominative * packages.config: * packages.config: * packages.config: * ITContentProvider.csproj: * NpgsqlBlogProvider.csproj: * NpgsqlContentProvider.csproj: mise à niveau Npgsql * NpgsqlContentProvider.cs: stocke la classe de commande * AccountController.cs: implémente la methode de login de l'API * BasketController.cs: implémente la methode de recupération du panier * AccountController.cs: enléve un commaentaire obsolète * YavscHelpers.cs: * FrontOfficeController.cs: refabrication de l'ajout au panier * yavsc.user.js: enlève un message de debuggage js * Performer.ascx: formattage * Performers.aspx: implémente le bouton de demande de reservation * Yavsc.csproj: validate unobtrusive * packages.config: référence M$ Owin * UserFileSystemManager.cs: Fixe: Ne pas créer un dossier de destination si on a aucun fichier à recevoir. * Commande.cs: * Ajoute le nom du client dans l'objet commande * Factorise le positionnement des paramêtres * La commande est une instance du type spécifié à la commande, dans son paramêtre `type` * SimpleBookingQuery.cs: refabrication * LocalizedText.resx: * LocalizedText.fr.resx: traducations * UserNameBase.cs: implemente l'interface `IUserName` * IContentProvider.cs: doc xml * YavscModel.csproj: reference le nouveau code source * Web.config: retour à une version d'équère * IUserName.cs: Définit l'interface d'un objet associé à un utilisateur.
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
2015-12-23 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* packages.config:
|
||||
* ITContentProvider.csproj: mise à niveau Npgsql
|
||||
|
||||
2015-11-30 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* ITContentProvider.csproj: ...
|
||||
|
@ -65,7 +65,7 @@
|
||||
<Reference Include="System.Web.Http.WebHost" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="Npgsql">
|
||||
<HintPath>..\packages\Npgsql.3.0.3\lib\net45\Npgsql.dll</HintPath>
|
||||
<HintPath>..\packages\Npgsql.3.0.4\lib\net45\Npgsql.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Npgsql" version="3.0.3" targetFramework="net45" />
|
||||
<package id="Npgsql" version="3.0.4" targetFramework="net45" />
|
||||
</packages>
|
@ -1,3 +1,8 @@
|
||||
2015-12-23 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* packages.config:
|
||||
* NpgsqlBlogProvider.csproj: mise à niveau Npgsql
|
||||
|
||||
2015-12-09 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* NpgsqlBlogProvider.cs: Corrige la méthode pour enlever un
|
||||
|
@ -69,7 +69,7 @@
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="Npgsql">
|
||||
<HintPath>..\packages\Npgsql.3.0.3\lib\net45\Npgsql.dll</HintPath>
|
||||
<HintPath>..\packages\Npgsql.3.0.4\lib\net45\Npgsql.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ProjectExtensions>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Npgsql" version="3.0.3" targetFramework="net45" />
|
||||
<package id="Npgsql" version="3.0.4" targetFramework="net451" />
|
||||
</packages>
|
@ -1,3 +1,10 @@
|
||||
2015-12-23 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* NpgsqlContentProvider.cs: stocke la classe de commande
|
||||
|
||||
* packages.config:
|
||||
* NpgsqlContentProvider.csproj: mise à niveau Npgsql
|
||||
|
||||
2015-12-15 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* NpgsqlContentProvider.cs: bug fix
|
||||
|
@ -178,12 +178,15 @@ namespace Yavsc
|
||||
using (NpgsqlConnection cnx = CreateConnection ()) {
|
||||
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
|
||||
cmd.CommandText =
|
||||
"insert into commandes (prdref,creation,params,clientname,applicationname) values (@pref,@creat,@prms,@cli,@app) returning id";
|
||||
cmd.Parameters.AddWithValue ("@pref", com.ProductRef);
|
||||
cmd.Parameters.AddWithValue ("@creat", com.CreationDate);
|
||||
cmd.Parameters.AddWithValue ("@prms", JsonConvert.SerializeObject (com.Parameters));
|
||||
cmd.Parameters.AddWithValue ("@cli", Membership.GetUser ().UserName);
|
||||
cmd.Parameters.AddWithValue ("@app", ApplicationName);
|
||||
"insert into commandes (prdref,creation,params,class,clientname,applicationname) values (:pref,:creat,:prms,:cls,:cli,:app) returning id";
|
||||
cmd.Parameters.AddWithValue ("pref", com.ProductRef);
|
||||
cmd.Parameters.AddWithValue ("creat", com.CreationDate);
|
||||
cmd.Parameters.AddWithValue ("prms", NpgsqlTypes.NpgsqlDbType.Jsonb,
|
||||
JsonConvert.SerializeObject(
|
||||
com.Parameters));
|
||||
cmd.Parameters.AddWithValue ("cls", com.GetType().FullName);
|
||||
cmd.Parameters.AddWithValue ("cli", com.ClientName);
|
||||
cmd.Parameters.AddWithValue ("app", ApplicationName);
|
||||
cnx.Open ();
|
||||
com.Id = id = (long)cmd.ExecuteScalar ();
|
||||
}
|
||||
@ -209,7 +212,7 @@ namespace Yavsc
|
||||
using (NpgsqlConnection cnx = CreateConnection ()) {
|
||||
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
|
||||
cmd.CommandText =
|
||||
"select id,creation,prdref,params,class from commandes where @user = clientname and applicationname = @app";
|
||||
"select id,creation,prdref,params::TEXT,class from commandes where @user = clientname and applicationname = @app";
|
||||
cmd.Parameters.AddWithValue ("@user", username);
|
||||
cmd.Parameters.AddWithValue ("@app", this.ApplicationName);
|
||||
cnx.Open ();
|
||||
@ -220,10 +223,10 @@ namespace Yavsc
|
||||
ycmd.Id = rdr.GetInt64 (0);
|
||||
ycmd.CreationDate = rdr.GetDateTime (1);
|
||||
ycmd.ProductRef = rdr.GetString (2);
|
||||
|
||||
object prms = JsonConvert.DeserializeObject<Dictionary<string,string>> (rdr.GetString (3));
|
||||
ycmd.Parameters = prms as Dictionary<string,string>;
|
||||
|
||||
ycmd.ClientName = username;
|
||||
var prms = rdr.GetString (3);
|
||||
var obj = JsonConvert.DeserializeObject<Dictionary<string,string>> (prms);
|
||||
ycmd.SetParameters(obj as Dictionary<string,string>);
|
||||
cmds.Add (ycmd);
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,7 @@
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Npgsql">
|
||||
<HintPath>..\packages\Npgsql.3.0.3\lib\net45\Npgsql.dll</HintPath>
|
||||
<HintPath>..\packages\Npgsql.3.0.4\lib\net45\Npgsql.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Npgsql" version="3.0.3" targetFramework="net45" />
|
||||
<package id="Npgsql" version="3.0.4" targetFramework="net45" />
|
||||
</packages>
|
@ -107,6 +107,16 @@ namespace Yavsc.ApiControllers
|
||||
}
|
||||
}
|
||||
|
||||
[ValidateAjax]
|
||||
public void Login(LoginModel model)
|
||||
{
|
||||
if (ModelState.IsValid) {
|
||||
if (Membership.ValidateUser (model.UserName, model.Password)) {
|
||||
FormsAuthentication.SetAuthCookie (model.UserName, model.RememberMe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the user to role.
|
||||
/// </summary>
|
||||
|
@ -7,6 +7,7 @@ using System.Web.Http;
|
||||
using Yavsc.Model.WorkFlow;
|
||||
using System.Collections.Specialized;
|
||||
using Yavsc.Model.FrontOffice;
|
||||
using Yavsc.Helpers;
|
||||
|
||||
namespace Yavsc.ApiControllers
|
||||
{
|
||||
@ -15,6 +16,7 @@ namespace Yavsc.ApiControllers
|
||||
/// Maintains a collection of articles
|
||||
/// qualified with name value pairs
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class BasketController : ApiController
|
||||
{
|
||||
|
||||
@ -30,25 +32,25 @@ namespace Yavsc.ApiControllers
|
||||
return b;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Get the basket.
|
||||
/// </summary>
|
||||
public CommandSet Get() {
|
||||
return CurrentBasket;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create the specified basket item using specified command parameters.
|
||||
/// </summary>
|
||||
/// <param name="cmdParams">Command parameters.</param>
|
||||
[Authorize]
|
||||
public long Create(NameValueCollection cmdParams)
|
||||
public long Create()
|
||||
{
|
||||
// HttpContext.Current.Request.Files
|
||||
Command cmd = Command.CreateCommand(cmdParams, HttpContext.Current.Request.Files);
|
||||
CurrentBasket.Add (cmd);
|
||||
return cmd.Id;
|
||||
return YavscHelpers.CreateCommandFromRequest ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read the specified basket item.
|
||||
/// </summary>
|
||||
/// <param name="itemid">Itemid.</param>
|
||||
[Authorize]
|
||||
Command Read(long itemid){
|
||||
return CurrentBasket[itemid];
|
||||
}
|
||||
@ -59,7 +61,6 @@ namespace Yavsc.ApiControllers
|
||||
/// <param name="itemid">Item identifier.</param>
|
||||
/// <param name="param">Parameter name.</param>
|
||||
/// <param name="value">Value.</param>
|
||||
[Authorize]
|
||||
public void UpdateParam(long itemid, string param, string value)
|
||||
{
|
||||
CurrentBasket [itemid].Parameters [param] = value;
|
||||
@ -69,7 +70,6 @@ namespace Yavsc.ApiControllers
|
||||
/// Delete the specified item.
|
||||
/// </summary>
|
||||
/// <param name="itemid">Item identifier.</param>
|
||||
[Authorize]
|
||||
public void Delete(long itemid)
|
||||
{
|
||||
CurrentBasket.Remove (itemid);
|
||||
|
@ -1,3 +1,29 @@
|
||||
2015-12-23 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* AccountController.cs: implémente la methode de login de
|
||||
l'API
|
||||
|
||||
* BasketController.cs: implémente la methode de recupération
|
||||
du panier
|
||||
|
||||
* AccountController.cs: enléve un commaentaire obsolète
|
||||
|
||||
* YavscHelpers.cs:
|
||||
* FrontOfficeController.cs: refabrication de l'ajout au panier
|
||||
|
||||
* yavsc.user.js: enlève un message de debuggage js
|
||||
|
||||
* Performer.ascx: formattage
|
||||
|
||||
* Performers.aspx: implémente le bouton de demande de
|
||||
reservation
|
||||
|
||||
* Yavsc.csproj: validate unobtrusive
|
||||
|
||||
* packages.config: référence M$ Owin
|
||||
|
||||
* Web.config: retour à une version d'équère
|
||||
|
||||
2015-12-16 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* input.css:
|
||||
|
@ -56,7 +56,6 @@ namespace Yavsc.Controllers
|
||||
return View ();
|
||||
}
|
||||
|
||||
// TODO [ValidateAntiForgeryToken]
|
||||
/// <summary>
|
||||
/// Does login.
|
||||
/// </summary>
|
||||
|
@ -40,6 +40,11 @@ namespace Yavsc.Controllers
|
||||
return View ();
|
||||
}
|
||||
|
||||
public ActionResult AskForAnEstimate()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pub the Event
|
||||
/// </summary>
|
||||
@ -251,11 +256,13 @@ namespace Yavsc.Controllers
|
||||
// * instanciate the given command type, passing it the form data
|
||||
// * Make the workflow register this command
|
||||
// * Render the resulting basket
|
||||
var cmd = Command.CreateCommand (collection, HttpContext.Request.Files);
|
||||
ViewData["Commanded"] = cmd;
|
||||
|
||||
long cmdid = YavscHelpers.CreateCommandFromRequest ();
|
||||
var basket = WorkFlowManager.GetCommands (User.Identity.Name);
|
||||
ViewData["Commanded"] = basket[cmdid];
|
||||
YavscHelpers.Notify (ViewData,
|
||||
LocalizedText.Item_added_to_basket);
|
||||
return View ("Basket",WorkFlowManager.GetCommands (User.Identity.Name));
|
||||
return View ("Basket",basket);
|
||||
} catch (Exception e) {
|
||||
YavscHelpers.Notify (ViewData, "Exception:" + e.Message);
|
||||
return View (collection);
|
||||
@ -263,7 +270,7 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Booking the specified model.
|
||||
/// Book the specified model.
|
||||
/// </summary>
|
||||
/// <param name="model">Model.</param>
|
||||
public ActionResult EavyBooking (BookingQuery model)
|
||||
@ -295,7 +302,7 @@ namespace Yavsc.Controllers
|
||||
|
||||
/// <summary>
|
||||
/// Performers on this MEA.
|
||||
/// fr
|
||||
/// [fr]
|
||||
/// Liste des prestataires dont
|
||||
/// l'activité principale est celle spécifiée
|
||||
/// </summary>
|
||||
@ -450,6 +457,10 @@ namespace Yavsc.Controllers
|
||||
} else
|
||||
result.Add (profile.CreateAvailability (model.PreferedDate, false));
|
||||
ViewData["Circles"] = CircleManager.ListAvailableCircles();
|
||||
ViewBag.SimpleBookingQuery = model;
|
||||
ViewBag.ClientName = User.Identity.IsAuthenticated ?
|
||||
User.Identity.Name : User.Identity.Name;
|
||||
|
||||
return View ("Performers", result.ToArray ());
|
||||
}
|
||||
if (model.Need==null) {
|
||||
|
@ -19,6 +19,7 @@ using Yavsc.Model.Messaging;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web.Routing;
|
||||
using Yavsc.Model.FrontOffice;
|
||||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
@ -28,7 +29,44 @@ namespace Yavsc.Helpers
|
||||
/// </summary>
|
||||
public static class YavscHelpers
|
||||
{
|
||||
|
||||
/* {"Need": "11 21,10 14", "MEACode": "6829C", "AUTH_USER": "Paul Schneider", "REMOTE_ADDR": "127.0.0.1",
|
||||
* "REMOTE_PORT": "43376", "REMOTE_USER": "", "PreferedDate": "22/12/2015 00:00:00",
|
||||
* "PerformerName": "Paul Schneider"} */
|
||||
public static string[] FilteredKeys = {
|
||||
"URL", "HTTPS", "ALL_RAW", "ALL_HTTP", "ALL_RAW", "HTTP_DNT", "PATH_INFO",
|
||||
".ASPXFORM$", "CERT_FLAGS", "LOCAL_ADDR",
|
||||
"LOGON_USER", "CERT_COOKIE", "CERT_ISSUER", "HTTP_ACCEPT", "HTTP_COOKIE", "INSTANCE_ID",
|
||||
// "REMOTE_ADDR",
|
||||
"REMOTE_HOST",
|
||||
"REMOTE_PORT",
|
||||
"REMOTE_USER",
|
||||
"SCRIPT_NAME", "SERVER_NAME", "SERVER_PORT", "APPL_MD_PATH", "CERT_KEYSIZE",
|
||||
"CERT_SUBJECT", "CONTENT_TYPE", "HTTP_REFERER",
|
||||
"AUTH_PASSWORD", "HTTPS_KEYSIZE", ".ASPXANONYMOUS", "CONTENT_LENGTH",
|
||||
"REQUEST_METHOD", "HTTP_CONNECTION", "HTTP_USER_AGENT", "PATH_TRANSLATED",
|
||||
"SERVER_PROTOCOL", "HTTP_ACCEPT_LANGUAGE", "AUTH_TYPE",
|
||||
// "AUTH_USER",
|
||||
"HTTP_HOST", "QUERY_STRING", "SERVER_SOFTWARE", "ASP.NET_SessionId",
|
||||
"CERT_SERIALNUMBER", "GATEWAY_INTERFACE", "HTTP_CONTENT_TYPE",
|
||||
"APPL_PHYSICAL_PATH", "CERT_SECRETKEYSIZE", "CERT_SERVER_ISSUER",
|
||||
"INSTANCE_META_PATH", "SERVER_PORT_SECURE",
|
||||
"CERT_SERVER_SUBJECT", "HTTPS_SECRETKEYSIZE", "HTTPS_SERVER_ISSUER",
|
||||
"HTTP_CONTENT_LENGTH", "HTTPS_SERVER_SUBJECT", "HTTP_ACCEPT_ENCODING", "HTTP_ACCEPT_LANGUAGE"
|
||||
};
|
||||
public static long CreateCommandFromRequest()
|
||||
{
|
||||
var keys = HttpContext.Current.Request.Params.AllKeys.Where (
|
||||
x => !YavscHelpers.FilteredKeys.Contains (x)).ToArray();
|
||||
var prms = new Dictionary<string,string> ();
|
||||
|
||||
foreach (var key in keys) {
|
||||
prms.Add (key, HttpContext.Current.Request.Params [key]);
|
||||
}
|
||||
Command cmd = Command.CreateCommand(
|
||||
prms,
|
||||
HttpContext.Current.Request.Files);
|
||||
return cmd.Id;
|
||||
}
|
||||
|
||||
private static string siteName = null;
|
||||
/// <summary>
|
||||
|
@ -19,7 +19,6 @@
|
||||
var roles = $this.data('roles');
|
||||
var bcounter = $this.data('blog-counter');
|
||||
var circlesspec = $this.data('circles');
|
||||
console.log('here');
|
||||
if (bcounter)
|
||||
if (bcounter>0) {
|
||||
_this.buttonBlog = $('<a><i class="fa fa-folder"></i></a>');
|
||||
|
@ -1,4 +1,6 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<PerformerProfile>" %>
|
||||
|
||||
|
||||
<div class="performer">
|
||||
<h2>
|
||||
<img src="<%= Model.Avatar %>" alt="" class="bigavatar">
|
||||
|
@ -1,7 +1,9 @@
|
||||
<%@ Page Language="C#" Title="Performers" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<PerformerAvailability>>" %>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
|
||||
<script type="text/javascript" src="/Scripts/yavsc.user.js"></script>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
@ -18,6 +20,19 @@
|
||||
<% } else {%>
|
||||
<%= Html.Translate("ThisPerformerDoesntGiveAccessToHisCalendar") %>
|
||||
<% } %>
|
||||
|
||||
<form action="/api/Basket/Create" method="POST">
|
||||
<div id="AskForAnEstimateResult"></div>
|
||||
<input type="hidden" name="productref" value="main">
|
||||
<input type="hidden" name="clientname" value="<%= ViewBag.ClientName %>">
|
||||
<input type="hidden" name="type" value="Yavsc.Model.FrontOffice.NominativeSimpleBookingQuery">
|
||||
<input type="hidden" name="MEACode" value="<%=ViewBag.SimpleBookingQuery.MEACode%>" >
|
||||
<input type="hidden" name="Need" value="<%=ViewBag.SimpleBookingQuery.Need%>" >
|
||||
<input type="hidden" name="PreferedDate" value="<%=ViewBag.SimpleBookingQuery.PreferedDate%>" >
|
||||
<input type="hidden" name="PerformerName" value="<%=available.Profile.UserName%>" >
|
||||
<input type="submit" class="actionlink" value="<%= Html.Translate("AskForAnEstimate") %>">
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
|
@ -221,7 +221,7 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
|
||||
</settings>
|
||||
<mailSettings>
|
||||
<smtp deliveryMethod="network" from="paulschneider@free.fr">
|
||||
<network host="smtp.free.fr" port="25" defaultCredentials="false" />
|
||||
<network host="[YOUR_SMTP_HOST]" port="25" defaultCredentials="false" />
|
||||
</smtp>
|
||||
</mailSettings>
|
||||
</system.net>
|
||||
@ -244,9 +244,9 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
|
||||
<!-- (miliseconds) = 30s -->
|
||||
<add name="requestRetries" value="1" />
|
||||
<!-- -->
|
||||
<add name="clientId" value="A9S6jrem3H0gdj8tQ2q1ahSCU38tAJRyiro7eED13h3Syn6C9ZSKSRkl" />
|
||||
<add name="clientId" value="[YOUR_PAYPAL_ID]" />
|
||||
<!-- -->
|
||||
<add name="clientSecret" value="PLF77VGTZGGSSZAY" />
|
||||
<add name="clientSecret" value="[YOUR_PAYPAL_SECRET]" />
|
||||
<!-- -->
|
||||
</settings>
|
||||
</paypal>
|
||||
@ -265,22 +265,21 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
|
||||
</root>
|
||||
</log4net>
|
||||
<connectionStrings>
|
||||
<add name="yavsc" connectionString="Server=127.0.0.1;Port=5432;Database=YavscDev;User Id=yavscdev;Password=admin;" providerName="Npgsql" />
|
||||
<add name="yavsc" connectionString="[YOUR_CONNECTION_STRING]" providerName="Npgsql" />
|
||||
</connectionStrings>
|
||||
<appSettings>
|
||||
<!-- <add key="MonoServerDefaultIndexFiles" value="Index,index.html,Index.aspx" /> -->
|
||||
<add key="WorkflowContentProviderClass" value="yavsc.NpgsqlContentProvider" />
|
||||
<add key="AdminEMail" value="contact@pschneider.fr" />
|
||||
<add key="OwnerEMail" value="paul@pschneider.fr" />
|
||||
<add key="Name" value="Yasvc dev" />
|
||||
<add key="Themes" value="clear,dark,itdark,itclear,blue,green,base" />
|
||||
<add key="AdminEMail" value="[YOUR_ADMIN_EMAIL]" />
|
||||
<add key="OwnerEMail" value="[YOUR_OWNER_EMAIL]" />
|
||||
<add key="Name" value="[YOUR_SITE_NAME]" />
|
||||
<add key="DefaultAvatar" value="/App_Themes/images/noavatar.png;image/png" />
|
||||
<add key="RegistrationMessage" value="/RegistrationMail.txt" />
|
||||
<!-- <add key="ClientValidationEnabled" value="true" />
|
||||
<add key="UnobtrusiveJavaScriptEnabled" value="true" /> -->
|
||||
<add key="PayPalLogger" value="PayPal.Log.Log4netLogger" />
|
||||
<add key="GOOGLE_API_KEY" value="AIzaSyCF7Bgz-W_p26bbMzxp1ukdgg3LMDHzAo0" />
|
||||
<add key="GOOGLE_CLIENT_ID" value="325408689282-6bekh7p3guj4k0f3301a6frf025cnrk1.apps.googleusercontent.com" />
|
||||
<add key="GOOGLE_CLIENT_SECRET" value="MaxYcvJJCs2gDGvaELZbzwfL" />
|
||||
<add key="GOOGLE_API_KEY" value="[YOUR_GOOGLE_API_KEY]" />
|
||||
<add key="GOOGLE_CLIENT_ID" value="[YOUR_GOOGLE_CLIENT_ID.apps.googleusercontent.com]" />
|
||||
<add key="GOOGLE_CLIENT_SECRET" value="[YOUR_GOOGLE_CLIENT_SECRET]" />
|
||||
</appSettings>
|
||||
</configuration>
|
||||
|
@ -95,9 +95,6 @@
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PayPalButtonManagerSDK">
|
||||
<HintPath>..\packages\PayPalButtonManagerSDK.2.9.109\lib\net20\PayPalButtonManagerSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="xunit.abstractions">
|
||||
<HintPath>..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
@ -113,12 +110,6 @@
|
||||
<Reference Include="xunit.assert">
|
||||
<HintPath>..\packages\xunit.assert.2.1.0\lib\portable-net45+win8+wp8+wpa81\xunit.assert.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PayPalCoreSDK">
|
||||
<HintPath>..\packages\PayPalCoreSDK.1.6.3\lib\net451\PayPalCoreSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.4\lib\net45-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.XmlTransform">
|
||||
<HintPath>..\packages\Mono.Web.Xdt.1.0.0\lib\Net40\Microsoft.Web.XmlTransform.dll</HintPath>
|
||||
</Reference>
|
||||
@ -138,6 +129,15 @@
|
||||
<Reference Include="Npgsql">
|
||||
<HintPath>..\packages\Npgsql.3.0.4\lib\net45\Npgsql.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PayPalCoreSDK">
|
||||
<HintPath>..\packages\PayPalCoreSDK.1.7.0\lib\net451\PayPalCoreSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PayPalButtonManagerSDK">
|
||||
<HintPath>..\packages\PayPalButtonManagerSDK.2.10.109\lib\net20\PayPalButtonManagerSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.5\lib\net45-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Admin\" />
|
||||
@ -772,6 +772,10 @@
|
||||
<Content Include="App_Themes\itclear\style.css" />
|
||||
<Content Include="App_Themes\itdark\style.css" />
|
||||
<Content Include="App_Themes\dark\input.css" />
|
||||
<Content Include="Scripts\jquery.unobtrusive-ajax.min.js" />
|
||||
<Content Include="Scripts\jquery.unobtrusive-ajax.js" />
|
||||
<Content Include="Scripts\jquery.validate.unobtrusive.min.js" />
|
||||
<Content Include="Scripts\jquery.validate.unobtrusive.js" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
|
@ -7,15 +7,15 @@
|
||||
<package id="jQuery.UI.Combined" version="1.11.4" targetFramework="net451" />
|
||||
<package id="jQuery.Validation" version="1.14.0" targetFramework="net451" />
|
||||
<package id="jquery-globalize" version="1.0.0" targetFramework="net45" />
|
||||
<package id="log4net" version="2.0.4" targetFramework="net451" />
|
||||
<package id="log4net" version="2.0.5" targetFramework="net451" />
|
||||
<package id="Microsoft.jQuery.Unobtrusive.Ajax" version="3.2.3" targetFramework="net451" />
|
||||
<package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.3" targetFramework="net451" />
|
||||
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net451" />
|
||||
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net451" />
|
||||
<package id="Mono.Web.Xdt" version="1.0.0" targetFramework="net451" />
|
||||
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
|
||||
<package id="Npgsql" version="3.0.4" targetFramework="net451" />
|
||||
<package id="PayPalButtonManagerSDK" version="2.9.109" targetFramework="net45" />
|
||||
<package id="PayPalCoreSDK" version="1.6.3" targetFramework="net451" />
|
||||
<package id="PayPalButtonManagerSDK" version="2.10.109" targetFramework="net451" />
|
||||
<package id="PayPalCoreSDK" version="1.7.0" targetFramework="net451" />
|
||||
<package id="Prettify" version="3.3.04.2013" targetFramework="net451" />
|
||||
<package id="xunit" version="2.1.0" targetFramework="net451" />
|
||||
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
|
||||
@ -23,4 +23,4 @@
|
||||
<package id="xunit.core" version="2.1.0" targetFramework="net451" />
|
||||
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net451" />
|
||||
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net451" />
|
||||
</packages>
|
||||
</packages>
|
@ -1,3 +1,36 @@
|
||||
2015-12-23 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* INominative.cs: Interface d'un objet destiné à un
|
||||
préstataire spécifié,
|
||||
par une propriété `PerformerName`
|
||||
|
||||
|
||||
* NominativeSimpleBookingQuery.cs: implémente l'interface
|
||||
INominative
|
||||
|
||||
* UserFileSystemManager.cs: Fixe: Ne pas créer un dossier de
|
||||
destination si on a aucun fichier à recevoir.
|
||||
|
||||
* Commande.cs: * Ajoute le nom du client dans l'objet commande
|
||||
* Factorise le positionnement des paramêtres
|
||||
* La commande est une instance du type spécifié à la commande,
|
||||
dans son paramêtre `type`
|
||||
|
||||
* SimpleBookingQuery.cs: refabrication
|
||||
|
||||
* LocalizedText.resx:
|
||||
* LocalizedText.fr.resx: traducations
|
||||
|
||||
* UserNameBase.cs: implemente l'interface `IUserName`
|
||||
|
||||
|
||||
* IContentProvider.cs: doc xml
|
||||
|
||||
* YavscModel.csproj: reference le nouveau code source
|
||||
|
||||
* IUserName.cs: Définit l'interface d'un objet associé à un
|
||||
utilisateur.
|
||||
|
||||
2015-12-15 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* CircleMember.cs: un membre de cercle est un nom
|
||||
|
@ -111,6 +111,8 @@ namespace Yavsc.Model.FileSystem
|
||||
/// <param name="files">Files.</param>
|
||||
public static void Put(string destDir, NameObjectCollectionBase files)
|
||||
{
|
||||
if (files.Count == 0)
|
||||
return;
|
||||
FileManager.ValidateSubDir (destDir);
|
||||
FileManager.Put(
|
||||
Path.Combine(CurrentUserFileRoot(),destDir),
|
||||
|
@ -8,7 +8,6 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
namespace Yavsc.Model.FrontOffice
|
||||
{
|
||||
/// <summary>
|
||||
@ -28,6 +27,12 @@ namespace Yavsc.Model.FrontOffice
|
||||
/// <value>The identifier.</value>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the client.
|
||||
/// </summary>
|
||||
/// <value>The name of the client.</value>
|
||||
public string ClientName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the product reference.
|
||||
/// </summary>
|
||||
@ -50,30 +55,55 @@ namespace Yavsc.Model.FrontOffice
|
||||
return UserFileSystemManager.GetFiles (Id.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Yavsc.Model.FrontOffice.Command"/> class.
|
||||
/// </summary>
|
||||
public Command()
|
||||
{
|
||||
}
|
||||
public void SetParameters(Dictionary<string,string> collection)
|
||||
{
|
||||
Parameters.Clear ();
|
||||
foreach (string key in collection.Keys) {
|
||||
if (key != "productref" && key != "type" && key != "clientname" ) {
|
||||
|
||||
Parameters.Add (key, collection [key]);
|
||||
foreach (var prop in this.GetType().GetRuntimeProperties())
|
||||
{
|
||||
if (prop.Name == key && prop.CanWrite) {
|
||||
System.ComponentModel.TypeConverter tc = System.ComponentModel.TypeDescriptor.GetConverter(prop.PropertyType);
|
||||
prop.SetValue(this,tc.ConvertFromString(collection [key]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Froms the post.
|
||||
/// Creates a command from the http post request.
|
||||
/// This methods applies to one product reference,
|
||||
/// given in a required value "ref" in the given
|
||||
/// collection of name value couples.
|
||||
/// </summary>
|
||||
/// <param name="collection">Collection.</param>
|
||||
/// <param name="files">Files.</param>
|
||||
private void FromPost(NameValueCollection collection, NameObjectCollectionBase files)
|
||||
private void FromPost(Dictionary<string,string> collection, NameObjectCollectionBase files)
|
||||
{
|
||||
// string catref=collection["catref"]; // Catalog Url from which formdata has been built
|
||||
ProductRef=collection["ref"]; // Required product reference
|
||||
ProductRef = collection ["productref"];
|
||||
if (ProductRef == null)
|
||||
throw new InvalidOperationException (
|
||||
"A product reference cannot be blank at command time");
|
||||
ClientName = collection ["clientname"];
|
||||
if (ClientName == null)
|
||||
throw new InvalidOperationException (
|
||||
"A client name cannot be blank at command time");
|
||||
|
||||
CreationDate = DateTime.Now;
|
||||
Status = CommandStatus.Inserted;
|
||||
// stores the parameters:
|
||||
Parameters.Clear ();
|
||||
foreach (string key in collection.AllKeys) {
|
||||
if (key!="ref")
|
||||
Parameters.Add (key, collection [key]);
|
||||
}
|
||||
SetParameters(collection);
|
||||
WorkFlowManager.RegisterCommand (this); // gives a value to this.Id
|
||||
string strcmdid = Id.ToString ();
|
||||
UserFileSystemManager.Put(Path.Combine("commandes",strcmdid),files);
|
||||
@ -82,12 +112,22 @@ namespace Yavsc.Model.FrontOffice
|
||||
/// <summary>
|
||||
/// Creates a command using the specified collection
|
||||
/// as command parameters, handles the files upload.
|
||||
///
|
||||
/// Required values in the command parameters :
|
||||
///
|
||||
/// * ref: the product reference,
|
||||
/// * type: the command concrete class name.
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="collection">Collection.</param>
|
||||
/// <param name="files">Files.</param>
|
||||
public static Command CreateCommand (NameValueCollection collection, NameObjectCollectionBase files)
|
||||
public static Command CreateCommand (Dictionary<string,string> collection, NameObjectCollectionBase files)
|
||||
{
|
||||
var cmd = CreateCommand (collection ["type"]);
|
||||
string type = collection ["type"];
|
||||
if (type == null)
|
||||
throw new InvalidOperationException (
|
||||
"A command type cannot be blank");
|
||||
var cmd = CreateCommand (type);
|
||||
cmd.FromPost (collection, files);
|
||||
return cmd;
|
||||
}
|
||||
@ -100,9 +140,18 @@ namespace Yavsc.Model.FrontOffice
|
||||
public static Command CreateCommand (string className)
|
||||
{
|
||||
var type = Type.GetType (className);
|
||||
|
||||
if (type == null)
|
||||
throw new InvalidOperationException (
|
||||
"Cannot find the command class " + className);
|
||||
|
||||
if (!typeof(Command).IsAssignableFrom(type))
|
||||
throw new InvalidOperationException (
|
||||
"No command is assignable from a " + className);
|
||||
|
||||
ConstructorInfo ci = type.GetConstructor(new Type[]{});
|
||||
var cmd = ci.Invoke (new object[]{}) as Command;
|
||||
return cmd;
|
||||
var cmd = ci.Invoke (new object[]{ });
|
||||
return cmd as Command;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
35
yavscModel/FrontOffice/INominative.cs
Normal file
35
yavscModel/FrontOffice/INominative.cs
Normal file
@ -0,0 +1,35 @@
|
||||
//
|
||||
// INominative.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015 GNU GPL
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Model.Skill;
|
||||
using Yavsc.Model.WorkFlow;
|
||||
using System.Linq;
|
||||
using Yavsc.Model.RolesAndMembers;
|
||||
|
||||
namespace Yavsc.Model.FrontOffice
|
||||
{
|
||||
public interface INominative {
|
||||
string PerformerName { get; set; }
|
||||
}
|
||||
|
||||
}
|
49
yavscModel/FrontOffice/NominativeSimpleBookingQuery.cs
Normal file
49
yavscModel/FrontOffice/NominativeSimpleBookingQuery.cs
Normal file
@ -0,0 +1,49 @@
|
||||
//
|
||||
// NominativeSimpleBookingQuery.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015 GNU GPL
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Model.Skill;
|
||||
using Yavsc.Model.WorkFlow;
|
||||
using System.Linq;
|
||||
using Yavsc.Model.RolesAndMembers;
|
||||
|
||||
namespace Yavsc.Model.FrontOffice
|
||||
{
|
||||
/// <summary>
|
||||
/// Nominative simple booking query.
|
||||
/// </summary>
|
||||
public class NominativeSimpleBookingQuery : SimpleBookingQuery, INominative {
|
||||
#region IUserName implementation
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the performer.
|
||||
/// </summary>
|
||||
/// <value>The name of the user.</value>
|
||||
public string PerformerName {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -23,9 +23,11 @@ using System.ComponentModel.DataAnnotations;
|
||||
using Yavsc.Model.Skill;
|
||||
using Yavsc.Model.WorkFlow;
|
||||
using System.Linq;
|
||||
using Yavsc.Model.RolesAndMembers;
|
||||
|
||||
namespace Yavsc.Model.FrontOffice
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Simple booking query.
|
||||
/// </summary>
|
||||
|
@ -14,14 +14,12 @@
|
||||
</resheader>
|
||||
|
||||
<data name="About"><value>À propos</value></data>
|
||||
<data name="AboutContent"><value>Je suis développeur indépendant à Suresnes depuis quelque mois.
|
||||
Je démarre une activité dans le domaine de l'edition logicielle,
|
||||
et je délivre principalement des applications pour mobiles.</value></data>
|
||||
<data name="additionally"><value>de plus</value></data>
|
||||
<data name="access_denied"><value>Accès refusé</value></data>
|
||||
<data name="Activities"><value>Activités</value></data>
|
||||
<data name="AnIMessageHasbeenSent"><value>Un message instantané a été envoyé à {0},
|
||||
lui présentant votre demande. Vous devriez être contacté très rapidement.</value></data>
|
||||
<data name="AskForAnEstimate"><value>Demander un devis</value></data>
|
||||
<data name="available"><value>disponible</value></data>
|
||||
<data name="AuthenticatedOnly"><value>Seuls les utilisateurs authentifiés peuvent accèder à cette information.</value></data>
|
||||
<data name="Basket"><value>Panier</value></data>
|
||||
|
@ -21,6 +21,7 @@
|
||||
<data name="Activities"><value>Activities</value></data>
|
||||
<data name="AnIMessageHasbeenSent"><value>An instant message has been sent to {0},
|
||||
showing to him your query. You should be contacted very soon.</value></data>
|
||||
<data name="AskForAnEstimate"><value>Ask for an estimate</value></data>
|
||||
<data name="available"><value>available</value></data>
|
||||
<data name="AuthenticatedOnly"><value>You must be authenticated in order to access this information</value></data>
|
||||
<data name="Bill_edition"><value>Bill edition</value></data>
|
||||
|
32
yavscModel/RolesAndMembers/IUserName.cs
Normal file
32
yavscModel/RolesAndMembers/IUserName.cs
Normal file
@ -0,0 +1,32 @@
|
||||
//
|
||||
// IUserName.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015 GNU GPL
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Model.RolesAndMembers
|
||||
{
|
||||
public interface IUserName {
|
||||
string UserName { get; set; }
|
||||
}
|
||||
|
||||
}
|
@ -28,7 +28,7 @@ namespace Yavsc.Model.RolesAndMembers
|
||||
/// <summary>
|
||||
/// User name base.
|
||||
/// </summary>
|
||||
public class UserNameBase : IIdentified<string> {
|
||||
public class UserNameBase : IUserName, IIdentified<string> {
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the user.
|
||||
/// </summary>
|
||||
|
@ -25,6 +25,10 @@ namespace Yavsc.Model.WorkFlow
|
||||
/// <value>The final statuses.</value>
|
||||
bool [] FinalStatuses { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
string Name { get; }
|
||||
/// <summary>
|
||||
/// Creates the estimate.
|
||||
@ -133,6 +137,7 @@ namespace Yavsc.Model.WorkFlow
|
||||
/// <returns>The command id in db.</returns>
|
||||
/// <param name="com">COM.</param>
|
||||
long RegisterCommand (Command com);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the writting status.
|
||||
/// </summary>
|
||||
|
@ -243,6 +243,9 @@
|
||||
<Compile Include="Skill\SkillRating.cs" />
|
||||
<Compile Include="Circles\CircleMember.cs" />
|
||||
<Compile Include="Circles\ICircle.cs" />
|
||||
<Compile Include="FrontOffice\NominativeSimpleBookingQuery.cs" />
|
||||
<Compile Include="FrontOffice\INominative.cs" />
|
||||
<Compile Include="RolesAndMembers\IUserName.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
|
Reference in New Issue
Block a user