public IActionResult Add(Order order)
        {
            var result = (_orderServices.Add(order));

            if (result.Success)
            {
                return(Ok(result.Success));
            }

            return(BadRequest(result.Message));
        }
Пример #2
0
        public async Task <IActionResult> Add([FromBody] OrderAddDTO addOrder)
        {
            try
            {
                var result = await _service.Add(addOrder);

                return(Ok(result));
            }
            catch (Exception ex)
            {
                return(Ok(ResponseResult.Failure <OrderDTO>(ex.Message)));
            }
        }
Пример #3
0
 public void Post([FromBody] OrderViewModel u)
 {
     orderService.Add(UserMapper.Map <OrderViewModel, OrderDTO>(u));
 }
Пример #4
0
 public async Task <MessageModel> Add(Order model)
 {
     model.Id = 0;
     return(new MessageModel(await _OrderServices.Add(model) > 0));
 }
Пример #5
0
 public void Post([FromBody] OrderViewModel u)
 {
     orderService.Add(u.User, u.OrderedItems, u.Address, u.Status);
 }
Пример #6
0
        public ActionResult <bool> Put([FromBody] OrderViewModel model)
        {
            var result = _orderServices.Add(model);

            return(Ok(result));
        }