public async Task <IActionResult> TestInterfaceAction([FromServices] IBookingEngine bookingEngine, [FromBody] string action)
 {
     try
     {
         return((await bookingEngine.TriggerTestAction(action)).GetContentResult());
     }
     catch (OpenBookingException obe)
     {
         return(obe.ErrorResponseContent.GetContentResult());
     }
 }
 public async Task <IActionResult> TestInterfaceDatasetInsert([FromServices] IBookingEngine bookingEngine, string testDatasetIdentifier, [FromBody] string @event)
 {
     try
     {
         return((await bookingEngine.InsertTestOpportunity(testDatasetIdentifier, @event)).GetContentResult());
     }
     catch (OpenBookingException obe)
     {
         return(obe.ErrorResponseContent.GetContentResult());
     }
 }
 public async Task <IActionResult> TestInterfaceDatasetDelete([FromServices] IBookingEngine bookingEngine, string testDatasetIdentifier)
 {
     try
     {
         return((await bookingEngine.DeleteTestDataset(testDatasetIdentifier)).GetContentResult());
     }
     catch (OpenBookingException obe)
     {
         return(obe.ErrorResponseContent.GetContentResult());
     }
 }
 public IActionResult TestInterfaceDelete([FromServices] IBookingEngine bookingEngine, string type, string name)
 {
     try
     {
         return(bookingEngine.DeleteTestData(type, name).GetContentResult());
     }
     catch (OpenBookingException obe)
     {
         return(obe.ErrorResponseContent.GetContentResult());
     }
 }
 public IActionResult TestInterfaceCreate([FromServices] IBookingEngine bookingEngine, string type, [FromBody] string @event)
 {
     try
     {
         return(bookingEngine.CreateTestData(type, @event).GetContentResult());
     }
     catch (OpenBookingException obe)
     {
         return(obe.ErrorResponseContent.GetContentResult());
     }
 }
 public async Task <IActionResult> OrderQuoteDeletion([FromServices] IBookingEngine bookingEngine, string uuid)
 {
     try
     {
         (string clientId, Uri sellerId) = User.GetAccessTokenOpenBookingClaims();
         return((await bookingEngine.DeleteOrderQuote(clientId, sellerId, uuid)).GetContentResult());
     }
     catch (OpenBookingException obe)
     {
         return(obe.ErrorResponseContent.GetContentResult());
     }
 }
 public async Task <ContentResult> OrderProposalCreationP([FromServices] IBookingEngine bookingEngine, string uuid, [FromBody] string orderProposal)
 {
     try
     {
         (string clientId, Uri sellerId) = User.GetAccessTokenOpenBookingClaims();
         return((await bookingEngine.ProcessOrderProposalCreationP(clientId, sellerId, uuid, orderProposal)).GetContentResult());
     }
     catch (OpenBookingException obe)
     {
         return(obe.ErrorResponseContent.GetContentResult());
     }
 }
 public ContentResult OrderCreationB([FromServices] IBookingEngine bookingEngine, string uuid, [FromBody] string order)
 {
     try
     {
         (string clientId, Uri sellerId) = AuthenticationHelper.GetIdsFromAuth(Request, User);
         return(bookingEngine.ProcessOrderCreationB(clientId, sellerId, uuid, order).GetContentResult());
     }
     catch (OpenBookingException obe)
     {
         return(obe.ErrorResponseContent.GetContentResult());
     }
 }
 public IActionResult OrderQuoteDeletion([FromServices] IBookingEngine bookingEngine, string uuid)
 {
     try
     {
         (string clientId, Uri sellerId) = AuthenticationHelper.GetIdsFromAuth(Request, User);
         return(bookingEngine.DeleteOrderQuote(clientId, sellerId, uuid).GetContentResult());
     }
     catch (OpenBookingException obe)
     {
         return(obe.ErrorResponseContent.GetContentResult());
     }
 }
 public async Task <IActionResult> GetOpenDataFeed([FromServices] IBookingEngine bookingEngine, string feedName, long?afterTimestamp, string afterId, long?afterChangeNumber)
 {
     try
     {
         // Note only a subset of these parameters will be supplied when this endpoints is called
         // They are all provided here for the bookingEngine to choose the correct endpoint
         return((await bookingEngine.GetOpenDataRPDEPageForFeed(feedName, afterTimestamp, afterId, afterChangeNumber)).GetContentResult());
     }
     catch (OpenBookingException obe)
     {
         return(obe.ErrorResponseContent.GetContentResult());
     }
 }
 public async Task <IActionResult> GetOrderProposalsFeed([FromServices] IBookingEngine bookingEngine, long?afterTimestamp, string afterId, long?afterChangeNumber)
 {
     try
     {
         // Note only a subset of these parameters will be supplied when this endpoints is called
         // They are all provided here for the bookingEngine to choose the correct endpoint
         // The auth token must also be provided from the associated authentication method
         string clientId = User.GetAccessTokenOrdersFeedClaim();
         return((await bookingEngine.GetOrderProposalsRPDEPageForFeed(clientId, afterTimestamp, afterId, afterChangeNumber)).GetContentResult());
     }
     catch (OpenBookingException obe)
     {
         return(obe.ErrorResponseContent.GetContentResult());
     }
 }
Пример #12
0
 public BookingLogic()
 {
     bookingEngine = new BookingEngine();
 }
Пример #13
0
 // GET: /openactive/
 public async Task <IActionResult> Index([FromServices] IBookingEngine bookingEngine)
 {
     return((await bookingEngine.RenderDatasetSite()).GetContentResult());
 }
 // GET: /openactive/
 public IActionResult Index([FromServices] IBookingEngine bookingEngine)
 {
     return(bookingEngine.RenderDatasetSite().GetContentResult());
 }
Пример #15
0
 public DatasetSiteController(IBookingEngine bookingEngine)
 {
     _bookingEngine = bookingEngine;
 }
Пример #16
0
 public OpenDataController(IBookingEngine bookingEngine)
 {
     _bookingEngine = bookingEngine;
 }
Пример #17
0
 public OrderManager()
 {
     _bookingEngine = new BookingEngine();
     _shoppingCart  = new PizzaShoppingCart();
 }