コード例 #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);
        }
コード例 #2
0
        public ActionResult DeleteOrder(Int64 orderId)
        {
            ActionResult oResponse = RedirectToAction("Index", "Order");

            try
            {
                dataAccess.DeleteOrder(orderId);
            }
            catch (Exception ex)
            {
            }
            return(oResponse);
        }
コード例 #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);
        }