Exemplo n.º 1
0
        public async Task <int> AddAsync(RetailerOrderTemp retailerOrder)
        {
            var cmd = QueriesCreatingHelper.CreateQueryInsert(retailerOrder);

            cmd += ";SELECT LAST_INSERT_ID();";
            return((await DALHelper.ExecuteQuery <int>(cmd, dbTransaction: DbTransaction, connection: DbConnection)).First());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Checkout([Bind] RetailerOrderTemp order)
        {
            if (order != null && !string.IsNullOrEmpty(order.Name))
            {
                var rs = await _orderHomepageRepository.AddAsync(order);

                if (rs > 0)
                {
                    ViewData["alert_msg"]  = "Thành công!";
                    ViewData["alert_type"] = "success";
                }

                else
                {
                    ViewData["alert_msg"]  = "Thất bại!";
                    ViewData["alert_type"] = "error";
                }
            }
            return(View());
        }