예제 #1
0
 //Retrieve List
 public List<Category> GetList()
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return ctx.Category.ToList<Category>();
     }
 }
예제 #2
0
 //Retrieve By ID
 public Category GetByID(long Id)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return(ctx.Category.First(x => x.CategoryID == Id));
     }
 }
예제 #3
0
 //Retrieve By ID
 public CartItem GetByID(long Id)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return ctx.CartItem.First(x => x.CartItemID == Id);
     }
 }
예제 #4
0
 //Retrieve List
 public List <CartItem> GetList()
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return(ctx.CartItem.ToList <CartItem>());
     }
 }
예제 #5
0
 //Retrieve By ID
 public AppUser GetByID(long Id)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return(ctx.AppUser.First(x => x.AppUserID == Id));
     }
 }
예제 #6
0
 //Retrieve By AppUserID
 public List <Order> GetByAppUserID(long AppUserId)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return(ctx.Order.Where(x => x.AppUserID == AppUserId).ToList());
     }
 }
예제 #7
0
 //Retrieve List
 public List <AppUser> GetList()
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return(ctx.AppUser.ToList <AppUser>());
     }
 }
예제 #8
0
 //Retrieve By OrderID
 public List<CartItem> GetByOrderID(long orderId)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return ctx.CartItem.Include("Item").Where(x => x.OrderID == orderId).ToList();
     }
 }
예제 #9
0
 //Retrieve By AppUserID
 public List<Order> GetByAppUserID(long AppUserId)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return ctx.Order.Where(x => x.AppUserID == AppUserId).ToList();
     }
 }
예제 #10
0
 //Retrieve List
 public List<CartItem> GetList()
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return ctx.CartItem.ToList<CartItem>();
     }
 }
예제 #11
0
 //Retreive by categoryId
 public List<Item> GetByCategoryId(long categoryId)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return ctx.Item.Where(x => x.CategoryID == categoryId).ToList();
     }
 }
예제 #12
0
 //Retreive by categoryId
 public List <Item> GetByCategoryId(long categoryId)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return(ctx.Item.Where(x => x.CategoryID == categoryId).ToList());
     }
 }
예제 #13
0
 //Retrieve By ID
 public Order GetByID(long Id)
 {
     using(OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return ctx.Order.First(x=>x.OrderID == Id);
     }
 }
예제 #14
0
 //Retrieve List
 public List<CPAStage> GetList()
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return ctx.CPAStage.ToList<CPAStage>();
     }
 }
예제 #15
0
 //public AppUser Login(AppUser appuser)
 //Login
 public AppUser Login(string Username, string Password)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return ctx.AppUser.FirstOrDefault(x => x.Username == Username && x.Password == Password);
     }
 }
예제 #16
0
 //Retrieve List
 public List <Category> GetList()
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return(ctx.Category.ToList <Category>());
     }
 }
예제 #17
0
 //Retrieve By ID
 public Category GetByID(long Id)
 {
     using(OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return ctx.Category.First(x=>x.CategoryID == Id);
     }
 }
예제 #18
0
 //Retrieve By OrderID
 public List <CartItem> GetByOrderID(long orderId)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return(ctx.CartItem.Include("Item").Where(x => x.OrderID == orderId).ToList());
     }
 }
예제 #19
0
 //Retrieve List
 public List<Order> GetList()
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return ctx.Order.ToList<Order>();
     }
 }
예제 #20
0
 //Retrieve By ID
 public CartItem GetByID(long Id)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return(ctx.CartItem.First(x => x.CartItemID == Id));
     }
 }
예제 #21
0
 //Retrieve By ID
 public CPAStage GetByID(long Id)
 {
     using(OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return ctx.CPAStage.First(x=>x.CPAStageID == Id);
     }
 }
예제 #22
0
 //Retrieve By ID
 public CPAStage GetByID(long Id)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return(ctx.CPAStage.First(x => x.CPAStageID == Id));
     }
 }
예제 #23
0
 //Retrieve List
 public List <CPAStage> GetList()
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return(ctx.CPAStage.ToList <CPAStage>());
     }
 }
예제 #24
0
 //Login
 public AppUser Login(string Username, string Password)
 //public AppUser Login(AppUser appuser)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         return(ctx.AppUser.FirstOrDefault(x => x.Username == Username && x.Password == Password));
     }
 }
예제 #25
0
 //Create
 public Order Insert(Order order)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.Order.Add(order);
         ctx.SaveChanges();
         return(this);
     }
 }
예제 #26
0
 //Create
 public CPA Insert(CPA cpa)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.CPA.Add(cpa);
         ctx.SaveChanges();
         return(this);
     }
 }
예제 #27
0
 //Create
 public CPA Insert(CPA cpa)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.CPA.Add(cpa);
         ctx.SaveChanges();
         return this;
     }
 }
예제 #28
0
 //Create
 public Item Insert(Item item)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.Item.Add(item);
         ctx.SaveChanges();
         return this;
     }
 }
예제 #29
0
 //Create
 public AppUser Insert(AppUser appuser)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.AppUser.Add(appuser);
         ctx.SaveChanges();
         return(this);
     }
 }
예제 #30
0
 //Create
 public Order Insert(Order order)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.Order.Add(order);
         ctx.SaveChanges();
         return this;
     }
 }
예제 #31
0
 //Create
 public Item Insert(Item item)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.Item.Add(item);
         ctx.SaveChanges();
         return(this);
     }
 }
예제 #32
0
 //Create
 public CartItem Insert(CartItem cartitem)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.CartItem.Add(cartitem);
         ctx.SaveChanges();
         return(this);
     }
 }
예제 #33
0
 //Create
 public Category Insert(Category category)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.Category.Add(category);
         ctx.SaveChanges();
         return this;
     }
 }
예제 #34
0
 //Create
 public CPAStage Insert(CPAStage cpastage)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.CPAStage.Add(cpastage);
         ctx.SaveChanges();
         return(this);
     }
 }
예제 #35
0
 //Create
 public Category Insert(Category category)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.Category.Add(category);
         ctx.SaveChanges();
         return(this);
     }
 }
예제 #36
0
 //Create
 public CPAStage Insert(CPAStage cpastage)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.CPAStage.Add(cpastage);
         ctx.SaveChanges();
         return this;
     }
 }
예제 #37
0
 //Create
 public AppUser Insert(AppUser appuser)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.AppUser.Add(appuser);
         ctx.SaveChanges();
         return this;
     }
 }
예제 #38
0
 //Update
 public Category Update(Category category)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         Category Category = ctx.Category.First(x => x.CategoryID == this.CategoryID);
         Category = category;
         ctx.SaveChanges();
         return(Category);
     }
 }
예제 #39
0
 //Update
 public Order Update(Order order)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         Order Order = ctx.Order.First(x => x.OrderID == this.OrderID);
         Order = order;
         ctx.SaveChanges();
         return(Order);
     }
 }
예제 #40
0
 //Update
 public AppUser Update(AppUser appuser)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         AppUser AppUser = ctx.AppUser.First(x => x.AppUserID == this.AppUserID);
         AppUser = appuser;
         ctx.SaveChanges();
         return AppUser;
     }
 }
예제 #41
0
 //Update
 public CPA Update(CPA cpa)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         CPA CPA = ctx.CPA.First(x => x.CPAID == this.CPAID);
         CPA = cpa;
         ctx.SaveChanges();
         return CPA;
     }
 }
예제 #42
0
 //Update
 public CPAStage Update(CPAStage cpastage)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         CPAStage CPAStage = ctx.CPAStage.First(x => x.CPAStageID == this.CPAStageID);
         CPAStage = cpastage;
         ctx.SaveChanges();
         return CPAStage;
     }
 }
예제 #43
0
 //Update
 public CPA Update(CPA cpa)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         CPA CPA = ctx.CPA.First(x => x.CPAID == this.CPAID);
         CPA = cpa;
         ctx.SaveChanges();
         return(CPA);
     }
 }
예제 #44
0
 //Update
 public Item Update(Item item)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         Item Item = ctx.Item.First(x => x.ItemID == this.ItemID);
         Item = item;
         ctx.SaveChanges();
         return Item;
     }
 }
예제 #45
0
 //Update
 public AppUser Update(AppUser appuser)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         AppUser AppUser = ctx.AppUser.First(x => x.AppUserID == this.AppUserID);
         AppUser = appuser;
         ctx.SaveChanges();
         return(AppUser);
     }
 }
예제 #46
0
 //Update
 public Item Update(Item item)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         Item Item = ctx.Item.First(x => x.ItemID == this.ItemID);
         Item = item;
         ctx.SaveChanges();
         return(Item);
     }
 }
예제 #47
0
 //Update
 public Category Update(Category category)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         Category Category = ctx.Category.First(x => x.CategoryID == this.CategoryID);
         Category = category;
         ctx.SaveChanges();
         return Category;
     }
 }
예제 #48
0
 //Update
 public CartItem Update(CartItem cartitem)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         CartItem CartItem = ctx.CartItem.First(x => x.CartItemID == this.CartItemID);
         CartItem = cartitem;
         ctx.SaveChanges();
         return(CartItem);
     }
 }
예제 #49
0
 //Update
 public Order Update(Order order)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         Order Order = ctx.Order.First(x => x.OrderID == this.OrderID);
         Order = order;
         ctx.SaveChanges();
         return Order;
     }
 }
예제 #50
0
 //Update
 public CPAStage Update(CPAStage cpastage)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         CPAStage CPAStage = ctx.CPAStage.First(x => x.CPAStageID == this.CPAStageID);
         CPAStage = cpastage;
         ctx.SaveChanges();
         return(CPAStage);
     }
 }
예제 #51
0
 //Delete By ID
 public Boolean Delete(long id)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         try
         {
             AppUser AppUser = ctx.AppUser.First(x => x.AppUserID == id);
             ctx.AppUser.Remove(AppUser);
             ctx.SaveChanges();
             return(true);
         }
         catch (Exception ex)
         {
             return(false);
         }
     }
 }
예제 #52
0
 //Delete By ID
 public Boolean Delete(long id)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         try
         {
             CartItem CartItem = ctx.CartItem.First(x => x.CartItemID == id);
             ctx.CartItem.Remove(CartItem);
             ctx.SaveChanges();
             return(true);
         }
         catch (Exception ex)
         {
             return(false);
         }
     }
 }
예제 #53
0
 //Delete By ID
 public Boolean Delete(long id)
 {
     using(OrderTrackEntities ctx= new OrderTrackEntities())
     {
         try
         {
             Order Order = ctx.Order.First(x => x.OrderID == id);
             ctx.Order.Remove(Order);
             ctx.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
         }
     }
 }
예제 #54
0
 //Delete By ID
 public Boolean Delete(long id)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         try
         {
             CPAStage CPAStage = ctx.CPAStage.First(x => x.CPAStageID == id);
             ctx.CPAStage.Remove(CPAStage);
             ctx.SaveChanges();
             return(true);
         }
         catch (Exception ex)
         {
             return(false);
         }
     }
 }
예제 #55
0
 //Delete By ID
 public Boolean Delete(long id)
 {
     using(OrderTrackEntities ctx= new OrderTrackEntities())
     {
         try
         {
             CPAStage CPAStage = ctx.CPAStage.First(x => x.CPAStageID == id);
             ctx.CPAStage.Remove(CPAStage);
             ctx.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
         }
     }
 }
예제 #56
0
 //Delete By ID
 public Boolean Delete(long id)
 {
     using(OrderTrackEntities ctx= new OrderTrackEntities())
     {
         try
         {
             Category Category = ctx.Category.First(x => x.CategoryID == id);
             ctx.Category.Remove(Category);
             ctx.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
         }
     }
 }
예제 #57
0
        //checkout
        public Boolean Checkout(long OrderID)
        {
            try
            {
                using (OrderTrackEntities ctx = new OrderTrackEntities())
                {
                    var items = GetByOrderID(OrderID);
                    foreach (var item in items)
                    {
                        item.IsOrdered = true;
                        item.DateOrdered = DateTime.Now;
                        CartItem cartItem = new CartItem().Update(item);
                    }
                }

                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }
예제 #58
0
        //checkout
        public Boolean Checkout(long OrderID)
        {
            try
            {
                using (OrderTrackEntities ctx = new OrderTrackEntities())
                {
                    var items = GetByOrderID(OrderID);
                    foreach (var item in items)
                    {
                        item.IsOrdered   = true;
                        item.DateOrdered = DateTime.Now;
                        CartItem cartItem = new CartItem().Update(item);
                    }
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
예제 #59
0
 //Create
 public CartItem Insert(CartItem cartitem)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.CartItem.Add(cartitem);
         ctx.SaveChanges();
         return this;
     }
 }
예제 #60
0
 //Update
 public CartItem Update(CartItem cartitem)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         CartItem CartItem = ctx.CartItem.First(x => x.CartItemID == this.CartItemID);
         CartItem = cartitem;
         ctx.SaveChanges();
         return CartItem;
     }
 }