Example #1
0
 /// <summary>
 /// Chọn hàng (bỏ hàng vào giỏ)
 /// </summary>
 /// <param name="Id">Mã mặt hàng được chọn</param>
 public void Add(int Id, int quantity = 1)
 {
     try
     {
         var p = Items.Single(i => i.MaCaThe == Id);
     }
     catch // Chưa có trong giỏ -> Lấy từ DB
     {
         using (var db = new GShopEntities())
         {
             var p = db.CaThes.Find(Id);
             Items.Add(p);
         }
     }
 }
Example #2
0
 public AllRepo(GShopEntities dbContext)
 {
     _dbContext = dbContext;
     _dbset     = _dbContext.Set <TEntity>();
 }
Example #3
0
 public AllRepo()
 {
     _dbContext = new GShopEntities();
     _dbset     = _dbContext.Set <TEntity>();
 }
Example #4
0
 public UserDAO()
 {
     db = new GShopEntities();
 }
Example #5
0
 public AdminDAO()
 {
     db = new GShopEntities();
 }