Exemplo n.º 1
0
        public ActionResult DeleteOrder(int OrderID)
        {
            ActionResult response;

            try
            {
                //running the stored procedure
                _OrdersDAO.DeleteOrder(OrderID);
                //setting response page
                int UserID = (int)Session["UserID"];
                response = RedirectToAction("ViewOrderByUserID", "Orders", new { UserID });
            }
            //logging errors and redirecting
            catch (SqlException sqlEx)
            {
                Logger.SqlErrorLog(sqlEx);
                response = View("Error");
            }
            catch (Exception ex)
            {
                Logger.ErrorLog(ex);
                response = View("Error");
            }
            //returning response page
            return(response);
        }
        public ActionResult DeleteOrder(Int64 orderId)
        {
            ActionResult oResponse = RedirectToAction("Index", "Order");

            try
            {
                dataAccess.DeleteOrder(orderId);
            }
            catch (Exception ex)
            {
            }
            return(oResponse);
        }
Exemplo n.º 3
0
        public ActionResult DeleteOrder(long OrderID)
        {
            ActionResult response;


            if (OrderID > 0)
            {
                OrderDO orderDO = ordersDAO.ViewByOrderID(OrderID);
                Order   order   = orderMapper.MapDoToPO(orderDO);
                ordersDAO.DeleteOrder(OrderID);
                response = RedirectToAction("ViewOrders", "Order");
            }
            else
            {
                response = RedirectToAction("Index", "Home");
            }
            return(response);
        }