Exemplo n.º 1
0
 public void DeleteOrderTest()
 {
     _model.SetFocusProduct(6, 0);
     _model.OrderProduct();
     _model.SetFocusProduct(5, 0);
     _model.OrderProduct();
     _model.DeleteOrder();
     Assert.AreEqual(_model.OrderCount, 0);
     Assert.AreEqual(_modelChangedFlag, true);
 }
Exemplo n.º 2
0
        public async Task <IActionResult> Delete(int id)
        {
            if (!HttpContext.Session.GetInt32("authenticated").HasValue)
            {
                return(new RedirectToActionResult("index", "login", null));
            }

            await orderModel.DeleteOrder(id);

            return(new RedirectToActionResult("index", "order", null));
        }
Exemplo n.º 3
0
    protected void lnkDeleteOrder_Click(object sender, EventArgs e)
    {
        YWC_StorageEntities db         = new YWC_StorageEntities();
        OrderModel          orderModel = new OrderModel();
        int         id    = Convert.ToInt32(Request.QueryString["id"]);
        OrderDetail order = orderModel.GetOrder(id);

        if (order.Status == "SENT")
        {
            orderModel.DeleteOrder(order.Id);
            Response.Redirect("~/webpages/Store/Admin/OrdersManagement.aspx");
        }
    }
Exemplo n.º 4
0
    private void Delete_Item(object sender, EventArgs e)
    {
        LinkButton selectedLink = (LinkButton)sender;
        string     link         = selectedLink.ID.Replace("del", "");
        int        cartId       = Convert.ToInt32(link);

        OrderModel model = new OrderModel();

        model.DeleteOrder(cartId);
        Response.Redirect("~/Pages/ShoppingCart.aspx");

        if (model.GetAmountOfOrders((String)Session["id"]) > 0)
        {
            Response.Redirect("~/Pages/ShoppingCart.aspx");
        }
        else
        {
            Response.Redirect("~/Pages/Index.aspx");
        }
    }
Exemplo n.º 5
0
 public OrderModel Delete(int id)
 {
     return(_model.DeleteOrder(id));
 }
Exemplo n.º 6
0
        public bool DeleteOrder()
        {
            string ID = View.OrderID;

            return(OrderModel.DeleteOrder(ID));
        }