public ActionResult DeleteConfirmed(int id) { MovieHouse moviehouse = db.MovieHouses.Find(id); db.MovieHouses.Remove(moviehouse); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(int id = 0) { MovieHouse moviehouse = db.MovieHouses.Find(id); if (moviehouse == null) { return(HttpNotFound()); } return(View(moviehouse)); }
public ActionResult Edit(MovieHouse moviehouse) { if (ModelState.IsValid) { db.Entry(moviehouse).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(moviehouse)); }
public ActionResult Create(MovieHouse moviehouse) { if (ModelState.IsValid) { db.MovieHouses.Add(moviehouse); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(moviehouse)); }
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")); }
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")); }
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())); }