Esempio n. 1
0
        public ActionResult Detail(string title, int id)
        {
            var db     = new DanceDb();
            var lesson = db.DanceLessons.Where(x => x.ID == id).FirstOrDefault();

            return(View(lesson));
        }
Esempio n. 2
0
        public ActionResult Index(string isim, int id)
        {
            var db      = new DanceDb();
            var lessons = db.DanceLessons.Where(x => x.IsActive == true && x.DanceTypeID == id).ToList();

            ViewBag.category = db.DanceTypes.Where(x => x.ID == id).FirstOrDefault();
            return(View(lessons));
        }
        public JsonResult AddProduct(int lessonID, int quantity)
        {
            var db = new DanceDb();

            db.Baskets.Add(new Model.Entity.Basket
            {
                CreateDate    = DateTime.Now,
                CreateUserID  = LoginUserID,
                DanceLessonID = lessonID,
                Quantity      = quantity,
                UserId        = LoginUserID
            });
            var rt = db.SaveChanges();

            return(Json(rt, JsonRequestBehavior.AllowGet));
        }