コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            HotelsType hotelsType = hotelTypeRepository.Find(id);

            hotelTypeRepository.Remove(hotelsType);
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "IdHotelsType,HotelType")] HotelsType hotelsType)
 {
     if (ModelState.IsValid)
     {
         hotelTypeRepository.Modified(hotelsType);
         return(RedirectToAction("Index"));
     }
     return(View(hotelsType));
 }
コード例 #3
0
        // GET: HotelsTypes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HotelsType hotelsType = hotelTypeRepository.Find(id);

            if (hotelsType == null)
            {
                return(HttpNotFound());
            }
            return(View(hotelsType));
        }