* Web.csproj: * Web.config: * Blog.cs: * Index.aspx: * BBCodeHelper.cs: * Comment.cs: * yavscModel.csproj: * BlogEntry.cs: * UserPost.aspx: * UserPosts.aspx: * Estimate.cs: * RemovePost.aspx: * TitleNotFound.aspx: * BlogProvider.cs: * AccountController.cs: * BlogsApiController.cs: * WorkFlowController.cs: * BlogEditEntryModel.cs: * FindBlogEntryFlags.cs: * BlogEntryCollection.cs: * Comment.cs: * BlogEditCommentModel.cs: * NpgsqlBlogProvider.cs: * NpgsqlContentProvider.cs: * BlogEntry.cs: * NpgsqlBlogProvider.csproj: * NpgsqlMembershipProvider.cs: * FindBlogEntryFlags.cs: * BlogEntryCollection.cs: * BlogHelper.cs: refactoring: moving code from NpgsqlBlogProvider to yavscModel.Blogs * BlogManager.cs: NpgsqlBlogProvider/BlogHelper.cs * BlogsController.cs: a successfull confirmed removal * Blog.cs: refactoring
81 lines
1.7 KiB
C#
81 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
|
|
using System.Web.Http;
|
|
using WorkFlowProvider;
|
|
using yavscModel.WorkFlow;
|
|
using System.Web.Http.Controllers;
|
|
|
|
namespace Yavsc.ApiControllers
|
|
{
|
|
[HttpControllerConfiguration(ActionValueBinder=typeof(Basic.MvcActionValueBinder))]
|
|
public class WorkFlowController : ApiController
|
|
{
|
|
[HttpGet]
|
|
[Authorize]
|
|
public object Index()
|
|
{
|
|
|
|
return new { test="Hello World" };
|
|
}
|
|
|
|
[HttpGet]
|
|
public object Order (BasketImpact bi)
|
|
{
|
|
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);
|
|
}
|
|
|
|
[Authorize]
|
|
[HttpGet]
|
|
/// <summary>
|
|
/// Gets the estimate.
|
|
/// </summary>
|
|
/// <returns>The estimate.</returns>
|
|
/// <param name="estid">Estid.</param>
|
|
public Estimate GetEstimate (long estid)
|
|
{
|
|
return WFManager.ContentProvider.GetEstimate (estid);
|
|
}
|
|
/*
|
|
public object Details(int id)
|
|
{
|
|
throw new NotImplementedException ();
|
|
}
|
|
|
|
public object Create()
|
|
{
|
|
throw new NotImplementedException ();
|
|
}
|
|
|
|
public object Edit(int id)
|
|
{
|
|
throw new NotImplementedException ();
|
|
}
|
|
|
|
public object Delete(int id)
|
|
{
|
|
throw new NotImplementedException ();
|
|
}
|
|
|
|
IContentProvider contentProvider = null;
|
|
IContentProvider ContentProvider {
|
|
get {
|
|
if (contentProvider == null )
|
|
contentProvider = WFManager.GetContentProviderFWC ();
|
|
return contentProvider;
|
|
}
|
|
}
|
|
|
|
*/
|
|
}
|
|
}
|