Esempio n. 1
0
        public IQueryable <Category> GetCategories()
        {
            var _db = new AppBackToReality.Models.ScreenContext();
            IQueryable <Category> query = _db.Categories;

            return(query);
        }
Esempio n. 2
0
        public IQueryable <Screen> GetScreens()
        {
            var _db = new AppBackToReality.Models.ScreenContext();
            IQueryable <Screen> query = _db.Screens;

            return(query);
        }
Esempio n. 3
0
 public void RemoveItem(string removeCartID, int removeScreenID)
 {
     using (var _db = new AppBackToReality.Models.ScreenContext())
     {
         try
         {
             var myItem = (from c in _db.ShoppingCartItems
                           where c.CartId == removeCartID && c.Screen.ScreenID == removeScreenID
                           select c).FirstOrDefault();
             if (myItem != null)
             {
                 // Remove Item.
                 _db.ShoppingCartItems.Remove(myItem);
                 _db.SaveChanges();
             }
         }
         catch (Exception exp)
         {
             throw new Exception("ERROR: Unable to Remove Cart Item - " +
                                 exp.Message.ToString(), exp);
         }
     }
 }