Beispiel #1
0
        public async Task <ActionResult> CreateTrade(CreateTradeModel model)
        {
            var result = await TradeWriter.CreateTrade(User.Id(), model);

            if (result.HasErrors)
            {
                return(JsonError());
            }

            return(JsonSuccess());
        }
        public async Task <ActionResult> CreateTrade(CreateTradeModel model)
        {
            if (!ModelState.IsValid)
            {
                return(PartialView("_CreateTradePartial", model));
            }

            var result = await TradeWriter.CreateTrade(User.Id(), model);

            if (!ModelState.IsWriterResultValid(result))
            {
                return(PartialView("_CreateTradePartial", model));
            }

            return(PartialView("_CreateTradePartial", model));
        }