Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MovieHouse moviehouse = db.MovieHouses.Find(id);

            db.MovieHouses.Remove(moviehouse);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        public ActionResult Edit(int id = 0)
        {
            MovieHouse moviehouse = db.MovieHouses.Find(id);

            if (moviehouse == null)
            {
                return(HttpNotFound());
            }
            return(View(moviehouse));
        }
Ejemplo n.º 3
0
 public ActionResult Edit(MovieHouse moviehouse)
 {
     if (ModelState.IsValid)
     {
         db.Entry(moviehouse).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(moviehouse));
 }
Ejemplo n.º 4
0
        public ActionResult Create(MovieHouse moviehouse)
        {
            if (ModelState.IsValid)
            {
                db.MovieHouses.Add(moviehouse);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(moviehouse));
        }
Ejemplo n.º 5
0
        public JsonResult Delete(int id)
        {
            rqInfo.RequestInformationType = Request.HttpMethod;
            rqInfo.RequestInformationUrl  = Request.Url.ToString();
            rqInfo.RequestInformationIp   = Request.UserHostAddress;

            rq.RequestInformation.Add(rqInfo);
            rq.SaveChanges();

            Write(rqInfo);

            MovieHouse moviehouse = rq.MovieHouses.Find(id);

            rq.MovieHouses.Remove(moviehouse);
            rq.SaveChanges();
            return(Json("Data droped using DELETE REQUEST"));
        }
Ejemplo n.º 6
0
        public JsonResult Edit(int id)
        {
            rqInfo.RequestInformationType = Request.HttpMethod;
            rqInfo.RequestInformationUrl  = Request.Url.ToString();
            rqInfo.RequestInformationIp   = Request.UserHostAddress;

            rq.RequestInformation.Add(rqInfo);
            rq.SaveChanges();

            Write(rqInfo);


            MovieHouse mhouse = rq.MovieHouses.Find(id);

            mhouse.MovieHouseName  = "Update";
            rq.Entry(mhouse).State = EntityState.Modified;
            rq.SaveChanges();



            return(Json("Data updated using PUT REQUEST"));
        }
Ejemplo n.º 7
0
        public ActionResult Index(string action, string name1)
        {
            var        NAME    = TempData.Peek("cinemainfo") as string;
            MovieHouse reiting = db.MovieHouses.Find(1);

            switch (action)
            {
            case "add": { reiting.MovieHouseRating++; } break;

            case "minus": { reiting.MovieHouseRating--; } break;

            default: ViewBag.Result = "ERRor"; break;
            }

            db.Entry(reiting).State = EntityState.Modified;
            db.SaveChanges();

            MovieHouse reiting1 = db.MovieHouses.Find(1);

            var stations = NAME != null?db.MovieHouses.Where(x => x.MovieHouseName.Contains(NAME)).OrderByDescending(x => x.MovieHouseRating) : db.MovieHouses.OrderByDescending(x => x.MovieHouseRating);


            return(View(stations.ToList()));
        }