示例#1
0
        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)
     });
 }
示例#3
0
        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);
        }
示例#4
0
        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());
        }
示例#6
0
 private void WhenGettingTabDetails()
 {
     _tabDetails = _tabController.Get(_id);
 }