public ActionResult Create(RoomServicePrice model)
 {
     if (ModelState.IsValid)
     {
         var price = db.RoomServicePrices.SingleOrDefault(p => p.RoomServiceType == model.RoomServiceType && p.Minutes == model.Minutes);
         if (price == null)
         {
             db.RoomServicePrices.Add(model);
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
     }
     ViewBag.Message = "Dữ liệu đã tồn tại";
     return(View(model));
 }
        public ActionResult Edit(RoomServicePrice model)
        {
            if (ModelState.IsValid)
            {
                var editPrice = db.RoomServicePrices.SingleOrDefault(p => p.RoomServicePriceId == model.RoomServicePriceId);
                if (editPrice != null)
                {
                    editPrice.RoomServiceType = model.RoomServiceType;
                    editPrice.Minutes         = model.Minutes;
                    editPrice.Price           = model.Price;
                    db.SaveChanges();
                    return(RedirectToAction("Index"));
                }
                ViewBag.Message = "Không tồn tại dữ liệu";
            }

            return(View(model));
        }