Beispiel #1
0
        //=============================================================== DELETE LINK ORDER
        public IActionResult DeleteLinkOrder(int id)
        {
            var order = dbContext.Orders.FirstOrDefault(x => x.id == id);

            dbContext.Remove(order);
            var result = dbContext.SaveChanges();

            var balance = dbContext.Balances.FirstOrDefault(x => x.DbPassportUserModelId == order.DbPassportUserModelId);

            balance.TLBalance += order.ProductPrice;
            dbContext.SaveChanges();

            return(RedirectToAction("Index"));
        }