public ActionResult UpdateOrder(long OrderId)
        {
            //set response
            ActionResult responce;

            try
            {
                //grabbing the order do order id
                OrderDO updateOrder = _OrderDataAccess.ViewOrderById(OrderId);
                //maping order do to orderpo
                Order Order = OrderMapper.MapDoToPo(updateOrder);
                //set orderid = to order.orderid
                OrderId = Order.OrderId;
                //check
                if (OrderId > 0)
                {
                    responce = View(Order);
                }
                else
                {
                    responce = RedirectToAction("ViewAllGames", "Game");
                }
            }
            catch (SqlException sqlex)
            {
                _Logger.ErrorLog(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, sqlex);
                responce = RedirectToAction("Index", "Home");
            }
            catch (Exception ex)
            {
                _Logger.ErrorLog(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ex);
                responce = RedirectToAction("Index", "Home");
            }
            return(responce);
        }
        public ActionResult RemoveOrder(long OrderId)
        {
            ActionResult response = RedirectToAction("RemoveOrder", "Order");



            try
            {
                if (Session ["RoleId"] != null && (long)Session["RoleId"] == 5)
                {
                    OrderDO order       = _OrderDataAccess.ViewOrderById(OrderId);
                    Order   RemoveOrder = _Mapper.MapDoToPo(order);
                    long    orderId     = RemoveOrder.OrderId;

                    if (OrderId > 0)
                    {
                        _OrderDataAccess.RemoveOrder(OrderId);
                        response = RedirectToAction("ViewOrder", "Order");
                    }
                    else
                    {
                        response = RedirectToAction("ViewOrder", "Order");
                    }
                }
                else
                {
                    response = RedirectToAction("ViewAllGames", "Game");
                }
            }
            catch (SqlException sqlex)
            {
                _Logger.ErrorLog(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, sqlex);
                response = RedirectToAction("Login", "Account");
            }
            catch (Exception ex)
            {
                _Logger.ErrorLog(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ex);
                response = RedirectToAction("Login", "Account");
            }



            return(response);
        }
        public ActionResult UpdateOrder(Int64 orderID)
        {
            OrderPO displayObject = new OrderPO();

            try
            {
                OrdersDO item = dataAccess.ViewOrdersByID(orderID);
                displayObject = OrderMapper.MapDoToPo(item);
            }
            catch (Exception ex)
            {
            }
            return(View(displayObject));
        }
        public ActionResult Index()
        {
            List <OrderPO> mappedItems = new List <OrderPO>();

            try
            {
                List <OrdersDO> dataObjects = dataAccess.ViewAllOrders();
                mappedItems = OrderMapper.MapDoToPo(dataObjects);
            }
            catch (Exception ex)
            {
                if (ex.Data.Contains("Message"))
                {
                    TempData["Message"] = "No Orders";
                }
            }

            return(View(mappedItems));
        }