public IActionResult Index() { model.RoomList = getRooms(); model.TotalPrice = _context.TotalPriceSet.Find(1).Value; _context.TotalPriceSet.Find(1).Value = 0; _context.SaveChanges(); return(View(model)); }
public ActionResult UpdateParent(Food food) { food.ParentId = 0; food.Consist = ""; _context.Entry(food).State = EntityState.Modified; _context.SaveChanges(); return(RedirectToAction("Index")); }
public IActionResult Create(string _authorName, string _authorEmail, string _text) { _context.CommentsSet.Add(new Comment { AuthorName = _authorName, AuthorEmail = _authorEmail, Text = _text, Date = DateTime.Now }); _context.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Delete(Comment comment) { _context.CommentsSet.Remove(_context.CommentsSet.Find(comment.Id)); _context.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Delete(Booking booking) { _context.BookingSet.Remove(_context.BookingSet.Find(booking.Id)); _context.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Update(Comfort comfort) { _context.Entry(comfort).State = EntityState.Modified; _context.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Update(News news) { _context.Entry(news).State = EntityState.Modified; _context.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Delete(GalleryPhoto photo) { _context.GallerySet.Remove(_context.GallerySet.Find(photo.Id)); _context.SaveChanges(); return(RedirectToAction("Index")); }