* style.css:

* Web.csproj:
* Web.config:
* Catalog.xml:
* Global.asax.cs:
* TestBinding.cs:
* IProvider.cs:
* yavscModel.csproj:
* WFManager.cs:
* BasketController.cs:
* WorkFlowController.cs:
* ITCPNpgsqlProvider.cs:
* IContentProvider.cs:
* WorkFlowProvider.csproj:
* NpgsqlContentProvider.cs:
* Provider.cs:
* ITContentProvider.csproj:
* FrontOfficeApiController.cs:
* ProviderCollection.cs:
* WorkflowConfiguration.cs:
* BlogProvidersConfigurationSection.cs: 

* IITContent.cs: Estimate creation
This commit is contained in:
Paul Schneider 2014-09-18 13:58:43 +02:00
commit bba917dcc0
21 changed files with 375 additions and 85 deletions

View file

@ -38,17 +38,17 @@
<Id>comment</Id>
<Value xsi:type="xsd:string">Commentaire</Value>
</FormElement>
<FormElement xsi:type="Text">
<!-- <FormElement xsi:type="Text">
<Val>Choisissez le type d'intervention souhaité: </Val>
</FormElement>
<FormElement xsi:type="SelectInput">
- <FormElement xsi:type="SelectInput">
<Id>ad</Id>
<Items>
<string>à distance</string>
<string>sur site</string>
</Items>
<SelectedIndex>0</SelectedIndex>
</FormElement>
</FormElement> -->
</Items>
</DefaultForm>
</Brand>

View file

@ -7,6 +7,7 @@ using System.Web.Security;
namespace Yavsc.Controllers
{
// TODO should mostly be an API Controller
public class BasketController : Controller
{
public ActionResult Index()
@ -21,11 +22,12 @@ namespace Yavsc.Controllers
public ActionResult Create()
{
var user = Membership.GetUser ();
var username = (user != null)?user.UserName:Request.AnonymousID;
throw new NotImplementedException();
// var user = Membership.GetUser ();
// var username = (user != null)?user.UserName:Request.AnonymousID;
// get an existing basket
return View ();
//return View ();
}
[HttpPost]

View file

@ -11,6 +11,8 @@ using System.Web;
using System.Linq;
using System.IO;
using System.Net;
using WorkFlowProvider;
using System.Web.Security;
namespace Yavsc.ApiControllers
{
@ -30,13 +32,12 @@ namespace Yavsc.ApiControllers
;
}
[AcceptVerbs("POST")]
[AcceptVerbs("GET","POST")]
public string Command()
{
return null;
throw new NotImplementedException();
}
public HttpResponseMessage Post()
{
HttpResponseMessage result = null;
@ -80,6 +81,21 @@ namespace Yavsc.ApiControllers
return "/path/to/image.png";
}
[HttpGet]
[Authorize]
public long CreateEstimate (string title)
{
return WFManager.CreateEstimate (
Membership.GetUser().UserName,title);
}
[HttpGet]
[Authorize]
public long AddToBasket (string title)
{
//TODO find the basket for Membership.GetUser().UserName
//return WFManager.Write(estid << from the basket, desc, ucost, count, productid);
throw new NotImplementedException ();
}
}
}

View file

@ -14,8 +14,10 @@ namespace Yavsc.ApiControllers
public class WorkFlowController : ApiController
{
[HttpGet]
[Authorize]
public object Index()
{
return new { test="Hello World" };
}
@ -25,6 +27,14 @@ namespace Yavsc.ApiControllers
return new { c="lmk,", message="Panier impacté", impactRef=bi.ProductRef, count=bi.count};
}
[HttpGet]
[Authorize]
public long Write (long estid, string desc, decimal ucost, int count, long productid=0) {
// TODO ensure estid owner matches the current one
return WFManager.Write(estid, desc, ucost, count, productid);
}
/*
public object Details(int id)
{

View file

@ -42,8 +42,8 @@ namespace Yavsc
GlobalConfiguration.Configuration.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{action}/{*path}",
defaults: new { controller = "WorkFlow", action="Index", path = "" }
routeTemplate: "api/{controller}/{action}/{*id}",
defaults: new { controller = "WorkFlow", action="Index", id=0 }
);
RegisterRoutes (RouteTable.Routes);

View file

@ -23,6 +23,7 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<section name="blog" type="Npgsql.Web.Blog.Configuration.BlogProvidersConfigurationSection, NpgsqlBlogProvider" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="thanks" type="Yavsc.ThanksConfigurationSection, Yavsc" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="catalog" type="SalesCatalog.Configuration.CatalogProvidersConfigurationSection, SalesCatalog" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="workflow" type="WorkFlowProvider.Configuration.WorkflowConfiguration, WorkFlowProvider" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
</sectionGroup>
</configSections>
<!-- <runtime>
@ -88,7 +89,6 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<add namespace="Yavsc.Helpers" />
</namespaces>
</pages>
<authorization>
<allow users="*" />
</authorization>
@ -118,6 +118,12 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<add name="NpgsqlRoleProvider" connectionStringName="yavsc" applicationName="/" type="Npgsql.Web.NpgsqlRoleProvider, NpgsqlMRPProviders" autogenerateschema="false" />
</providers>
</roleManager>
<workflow defaultProvider="ITProvider">
<providers>
<clear/>
<add name="ITProvider" type="ITContentProvider.ITCPNpgsqlProvider, ITContentProvider" applicationName="/" connectionStringName="yavsc"/>
</providers>
</workflow>
<profile defaultProvider="NpgsqlProfileProvider">
<providers>
<clear />

View file

@ -251,5 +251,13 @@
<Project>{59E1DF7B-FFA0-4DEB-B5F3-76EBD98D5356}</Project>
<Name>WebControls</Name>
</ProjectReference>
<ProjectReference Include="..\ITContentProvider\ITContentProvider.csproj">
<Project>{9D7D892E-9B77-4713-892D-C26E1E944119}</Project>
<Name>ITContentProvider</Name>
</ProjectReference>
<ProjectReference Include="..\ITContent\ITContent.csproj">
<Project>{88D83FC9-4158-4435-98A6-1F8F7F448B8F}</Project>
<Name>ITContent</Name>
</ProjectReference>
</ItemGroup>
</Project>

View file

@ -6,7 +6,7 @@ body {
color: #D0FFD0;
margin:1em;
padding:1em;
font-family: 'Dancing Script', cursive;
font-family: 'Arial', cursive;
line-height:135%;
}
@ -138,7 +138,7 @@ padding-left: 20px;
@media print {
body {background-color:white;color:black;}
.postcomment,#login,.actionlink{ display:none;}
.postcomment,#login,.actionlink,.metablog,.thanks{ display:none;}
}
@media all and (max-width: 15em) {