Beispiel #1
0
        protected void BtnDelete_Click(object sender, EventArgs e)
        {
            ImageButton  btn  = (ImageButton)sender;
            ListViewItem item = (ListViewItem)btn.NamingContainer;
            Label        id   = (Label)item.FindControl("CartIdLabel");
            int          cid  = int.Parse(id.Text);

            CartHelper.DeleteCart(cid);
            Response.Redirect("MyCart");
        }
Beispiel #2
0
 public static void Delete(int[] ids, int userId)
 {
     if (userId > 0)
     {
         dal.Delete(ids, userId);
     }
     else
     {
         CartHelper.DeleteCart(string.Join(",", ids));
     }
 }
Beispiel #3
0
 public static void DeleteCart(string strID, int userID)
 {
     if (userID > 0)
     {
         strID = dal.ReadCartIDList(strID, userID);
         dal.DeleteCart(strID, userID);
     }
     else
     {
         CartHelper.DeleteCart(strID);
     }
 }
Beispiel #4
0
 // DELETE api/<controller>/5
 public CartModel Delete(Guid CartID, Guid ProductID)
 {
     try
     {
         _cartHelper = new CartHelper();
         if (ProductID != Guid.Parse("559B9891-FE58-49DD-A357-B7ADC2CC339A"))
         {
             return(_cartHelper.DeleteCart(CartID, ProductID));
         }
         else
         {
             if (_cartHelper.DeleteCart(CartID) != null)
             {
                 return(null);
             }
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
     return(null);
 }
 public void DeleteCart(int productID)
 {
     CartHelper.DeleteCart(productID);
 }