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>());
     }
 }
示例#6
0
 public IEnumerable <About> GetAllEmployee()
 {
     using (FruitShopDbContext db = new FruitShopDbContext())
     {
         return(db.Abouts.ToList <About>());
     }
 }
示例#7
0
 public IEnumerable <Blog> GetAllEmployee()
 {
     using (FruitShopDbContext db = new FruitShopDbContext())
     {
         return(db.Blogs.ToList <Blog>());
     }
 }
示例#8
0
 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));
        }
示例#12
0
 public UserDAO()
 {
     db = new FruitShopDbContext();
 }
示例#13
0
        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());
        }
示例#14
0
 public MenuDAO()
 {
     db = new FruitShopDbContext();
 }
示例#15
0
 public CategoryDAO()
 {
     db = new FruitShopDbContext();
 }
示例#16
0
 public FooterDAO()
 {
     db = new FruitShopDbContext();
 }
示例#17
0
        public int SoLuongDonHang()
        {
            FruitShopDbContext db = new FruitShopDbContext();

            return(db.Orders.Where(x => x.Status == true).Count());
        }
示例#18
0
        public int DonHangDaGiao()
        {
            FruitShopDbContext db = new FruitShopDbContext();

            return(db.Orders.Where(x => x.Status == false).Count());
        }
示例#19
0
        public decimal?TongTien()
        {
            FruitShopDbContext db = new FruitShopDbContext();

            return(db.Orders.Where(x => x.Status == false).Sum(x => x.TongTien));
        }
示例#20
0
 public SlideDAO()
 {
     db = new FruitShopDbContext();
 }
示例#21
0
 public AboutDAO()
 {
     db = new FruitShopDbContext();
 }
示例#22
0
        public int SoLuongBlog()
        {
            FruitShopDbContext db = new FruitShopDbContext();

            return(db.Blogs.Where(x => x.Status == 1).Count());
        }
 public OrderDetailDAO()
 {
     db = new FruitShopDbContext();
 }
示例#24
0
 public ProductDAO()
 {
     db = new FruitShopDbContext();
 }