* style.css:

* UserPost.aspx:
* Estimate.cs:
* Writting.cs:
* WorkFlowController.cs:
* NpgsqlContentProvider.cs: 
* FrontOfficeApiController.cs: Fixed the GetEstimate function,
  refactoring
This commit is contained in:
Paul Schneider 2014-09-23 12:25:41 +02:00
commit 8fee293665
7 changed files with 48 additions and 35 deletions

View file

@ -22,7 +22,8 @@ namespace Yavsc.ApiControllers
[AcceptVerbs("GET")]
public Catalog Catalog ()
{
return CatalogManager.GetCatalog ();
Catalog c = CatalogManager.GetCatalog ();
return c;
}
[AcceptVerbs("GET")]
@ -65,29 +66,7 @@ namespace Yavsc.ApiControllers
return result;
}
[HttpPost]
public string ProfileImagePost(HttpPostedFile profileImage)
{
string[] extensions = { ".jpg", ".jpeg", ".gif", ".bmp", ".png" };
if (!extensions.Any(x => x.Equals(Path.GetExtension(profileImage.FileName.ToLower()), StringComparison.OrdinalIgnoreCase)))
{
throw new HttpResponseException(
new HttpResponseMessage(HttpStatusCode.BadRequest));
}
// string root = System.Web.HttpContext.Current.Server.MapPath("~/App_Data/uploads");
// Other code goes here
// profileImage.SaveAs ();
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)

View file

@ -7,12 +7,21 @@ using System.Web.Http;
using WorkFlowProvider;
using yavscModel.WorkFlow;
using System.Web.Http.Controllers;
using System.Web.Security;
namespace Yavsc.ApiControllers
{
[HttpControllerConfiguration(ActionValueBinder=typeof(Basic.MvcActionValueBinder))]
public class WorkFlowController : ApiController
{
[HttpGet]
[Authorize]
public long CreateEstimate (string title)
{
return WFManager.CreateEstimate (
Membership.GetUser().UserName,title);
}
[HttpGet]
[Authorize]
public object Index()
@ -44,7 +53,8 @@ namespace Yavsc.ApiControllers
/// <param name="estid">Estid.</param>
public Estimate GetEstimate (long estid)
{
return WFManager.ContentProvider.GetEstimate (estid);
Estimate est = WFManager.ContentProvider.GetEstimate (estid);
return est;
}
/*
public object Details(int id)