using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.Http;
using Yavsc.Model.WorkFlow;
namespace Yavsc.ApiControllers
{
///
/// Basket controller.
///
public class BasketController : ApiController
{
///
/// The wfmgr.
///
protected WorkFlowManager wfmgr = null;
///
/// Initialize the specified controllerContext.
///
/// Controller context.
protected override void Initialize (System.Web.Http.Controllers.HttpControllerContext controllerContext)
{
base.Initialize (controllerContext);
wfmgr = new WorkFlowManager ();
}
///
/// Validates the order.
///
///
/// true, if order was validated, false otherwise.
/// Orderid.
bool ValidateOrder(long orderid) {
throw new NotImplementedException ();
}
long CreateOrder(string title,string mesg)
{
throw new NotImplementedException ();
}
///
/// Adds to basket, a product from the catalog, in the user's session.
///
/// The to basket.
[HttpGet]
public long AddToOrder (long orderid, string prodref,int count, object prodparams=null)
{
//TODO find the basket for Membership.GetUser().UserName
//return WFManager.Write(estid << from the basket, desc, ucost, count, productid);
throw new NotImplementedException ();
}
///
/// Yours the estimates.
///
/// The estimates.
[HttpGet]
[Authorize]
public Estimate[] YourEstimates()
{
return wfmgr.GetEstimates (
Membership.GetUser().UserName);
}
}
}