public ActionResult RemoveQuantity(int id, int subID) { if (subID > 0) { ProductQuantity.Remove(UserID, Employee.ID, new ProductQuantity[] { new ProductQuantity(subID, id) }); } else { var quantities = SessionValue <List <ProductQuantity> >(SessionKey.Quantity); if (quantities != null) { quantities.Remove(quantities.FirstOrDefault(q => q.ProductID == subID && q.WarehouseID == id)); } Session[SessionKey.Quantity] = quantities; } return(Json(new { result = true, remove = true }, JsonRequestBehavior.AllowGet)); }