コード例 #1
0
        private void bindingItems_AddingNew(object sender, AddingNewEventArgs e)
        {
            //Create a new book
            InvoiceItem    parent     = (InvoiceItem)bindingInvoice.Current;
            CommandAddItem createItem = new CommandAddItem(parent.InvoiceID);
            rotiItem       newItem    = (rotiItem)m_AppController.ExecuteCommand(createItem);

            //Add it to the booklist
            e.NewObject = newItem;
        }
コード例 #2
0
        public IActionResult AddProduct([FromBody] CommandAddItem command, [FromServices] HandlerCatalogItem handler)
        {
            var request = handler.handle(command);

            if (request.HasError())
            {
                return(BadRequest(request.Error()));
            }

            return(Ok(request.ResponseObj()));
        }