public JsonResult SaveChanges(PaymentInputValues inputs) { Ctx ctx = Session["ctx"] as Ctx; PaymentModel model = new PaymentModel(ctx, inputs); TabDetails details = model.SaveChanges(inputs); return(Json(JsonConvert.SerializeObject(details), JsonRequestBehavior.AllowGet));; }
public PlaceOrderCommand Create(TabDetails tabDetails) { return(new PlaceOrderCommand { Id = Guid.NewGuid(), AggregateId = tabDetails.Id, Items = GetOrderedItems(tabDetails) }); }
public void SetUp() { _tabDetails = GetTabDetails(); var tabDetailsJson = JsonConvert.SerializeObject(_tabDetails); _sqlExecutor.ExecuteNonQuery($@"DELETE FROM dbo.TabDetails WHERE Id = '{_id}'"); _sqlExecutor.ExecuteNonQuery($@"INSERT INTO dbo.TabDetails(Id,Data) VALUES ('{_id}','{tabDetailsJson}')"); _tabDetailsRepository = new TabDetailsRepository(ConnectionStringProvider.ConnectionString); }
public void PlaceOrder(TabDetails tabDetails) { var placeOrderCommand = _placeOrderCommandFactory.Create(tabDetails); _commandSender.Send(placeOrderCommand); }
private List <OrderedItem> GetOrderedItems(TabDetails tabDetails) { var menu = _menuRepository.GetMenu(); return(tabDetails.Items.Select(item => Map(item, menu)).ToList()); }
private void WhenGettingTabDetails() { _tabDetails = _tabController.Get(_id); }