コード例 #1
0
 public IActionResult Index()
 {
     model.RoomList   = getRooms();
     model.TotalPrice = _context.TotalPriceSet.Find(1).Value;
     _context.TotalPriceSet.Find(1).Value = 0;
     _context.SaveChanges();
     return(View(model));
 }
コード例 #2
0
        public ActionResult UpdateParent(Food food)
        {
            food.ParentId = 0;
            food.Consist  = "";

            _context.Entry(food).State = EntityState.Modified;
            _context.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #3
0
 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"));
 }
コード例 #4
0
 public ActionResult Delete(Comment comment)
 {
     _context.CommentsSet.Remove(_context.CommentsSet.Find(comment.Id));
     _context.SaveChanges();
     return(RedirectToAction("Index"));
 }
コード例 #5
0
 public ActionResult Delete(Booking booking)
 {
     _context.BookingSet.Remove(_context.BookingSet.Find(booking.Id));
     _context.SaveChanges();
     return(RedirectToAction("Index"));
 }
コード例 #6
0
 public ActionResult Update(Comfort comfort)
 {
     _context.Entry(comfort).State = EntityState.Modified;
     _context.SaveChanges();
     return(RedirectToAction("Index"));
 }
コード例 #7
0
 public ActionResult Update(News news)
 {
     _context.Entry(news).State = EntityState.Modified;
     _context.SaveChanges();
     return(RedirectToAction("Index"));
 }
コード例 #8
0
 public ActionResult Delete(GalleryPhoto photo)
 {
     _context.GallerySet.Remove(_context.GallerySet.Find(photo.Id));
     _context.SaveChanges();
     return(RedirectToAction("Index"));
 }