public IEnumerable <DanhMucSanPham> GetAllEmployee() { using (FruitShopDbContext db = new FruitShopDbContext()) { return(db.DanhMucSanPhams.ToList <DanhMucSanPham>()); } }
// GET: Search public ActionResult Search(string term) { FruitShopDbContext db = new FruitShopDbContext(); var list = db.SanPhams.Where(x => x.Status == 1 && x.TenSanPham.Contains(term)).ToList().Take(10); return(View(list)); }
public ActionResult Payment(int Ship) { FruitShopDbContext db = new FruitShopDbContext(); var ship = new Ship(); var gia = db.Ships.Where(y => y.ShipID == Ship).ToList(); foreach (var item in gia) { ship.GiaShip = item.GiaShip; } ViewBag.GiaShip = ship.GiaShip; var session = new List <CartItem>(); session = (List <CartItem>)Session[CartSession]; foreach (var item in session) { item.GiaShip = ship.GiaShip; } Session[CartSession] = session; var cart = Session[CartSession]; var list = new List <CartItem>(); if (cart != null) { list = (List <CartItem>)cart; } return(View(list)); }
public IEnumerable <Footer> GetAllEmployee() { using (FruitShopDbContext db = new FruitShopDbContext()) { return(db.Footers.ToList <Footer>()); } }
public IEnumerable <Slide> GetAllEmployee() { using (FruitShopDbContext db = new FruitShopDbContext()) { return(db.Slides.ToList <Slide>()); } }
public IEnumerable <About> GetAllEmployee() { using (FruitShopDbContext db = new FruitShopDbContext()) { return(db.Abouts.ToList <About>()); } }
public IEnumerable <Blog> GetAllEmployee() { using (FruitShopDbContext db = new FruitShopDbContext()) { return(db.Blogs.ToList <Blog>()); } }
public JsonResult List() { using (FruitShopDbContext db = new FruitShopDbContext()) { return(Json(db.SanPhams.ToList <SanPham>(), JsonRequestBehavior.AllowGet)); } //return Json(SanPhamDAO.ListAll(), JsonRequestBehavior.AllowGet); }
public JsonResult LoadMoreProduct(string term, int size) { FruitShopDbContext db = new FruitShopDbContext(); var model = db.SanPhams.Where(x => x.Status == 1 && x.TenSanPham.Contains(term)).ToList().Skip(size).Take(10); int modelCount = db.SanPhams.Where(x => x.Status == 1 && x.TenSanPham.Contains(term)).ToList().Count(); if (model.Any()) { string modelString = RenderRazorViewToString("_SearchLoadMoreProduct", model); return(Json(new { ModelString = modelString, ModelCount = modelCount })); } return(Json(model)); }
// GET: Cart public ActionResult Index() { FruitShopDbContext db = new FruitShopDbContext(); ViewBag.Ship = db.Ships.ToList(); var cart = Session[CartSession]; var list = new List <CartItem>(); if (cart != null) { list = (List <CartItem>)cart; } return(View(list)); }
public JsonResult GetSearchValue(string term) { Response.CacheControl = "no-cache"; FruitShopDbContext DB = new FruitShopDbContext(); var usrScreenNamelst = DB.SanPhams.Where(a => a.TenSanPham.Contains(term)).ToList(); string userProfileImagePath = "~/Content/Client/images/"; var lst = usrScreenNamelst.Select(m => new { SanPhamID = m.SanPhamID, TenSanPham = m.TenSanPham, DonGia = m.DonGia, MetaKeyword = m.MetaKeyword, image = Url.Content(userProfileImagePath + (string.IsNullOrEmpty(m.Image) ? "NoProfileImage.png" : m.Image)) }).ToList().Take(5); return(Json(lst.ToArray(), JsonRequestBehavior.AllowGet)); }
public UserDAO() { db = new FruitShopDbContext(); }
public List <SanPham> LaySoLuongConLai(int top) { FruitShopDbContext db = new FruitShopDbContext(); return(db.SanPhams.Where(x => x.Status == 1).OrderBy(x => x.Quantity).Take(top).ToList()); }
public MenuDAO() { db = new FruitShopDbContext(); }
public CategoryDAO() { db = new FruitShopDbContext(); }
public FooterDAO() { db = new FruitShopDbContext(); }
public int SoLuongDonHang() { FruitShopDbContext db = new FruitShopDbContext(); return(db.Orders.Where(x => x.Status == true).Count()); }
public int DonHangDaGiao() { FruitShopDbContext db = new FruitShopDbContext(); return(db.Orders.Where(x => x.Status == false).Count()); }
public decimal?TongTien() { FruitShopDbContext db = new FruitShopDbContext(); return(db.Orders.Where(x => x.Status == false).Sum(x => x.TongTien)); }
public SlideDAO() { db = new FruitShopDbContext(); }
public AboutDAO() { db = new FruitShopDbContext(); }
public int SoLuongBlog() { FruitShopDbContext db = new FruitShopDbContext(); return(db.Blogs.Where(x => x.Status == 1).Count()); }
public OrderDetailDAO() { db = new FruitShopDbContext(); }
public ProductDAO() { db = new FruitShopDbContext(); }