Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Seattle thisSeattle = _db.Seattle.FirstOrDefault(seattle => seattle.SeattleId == id);

            _db.Seattle.Remove(thisSeattle);
            _db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public ActionResult Search(int id)
        {
            List <Restaurant> thisRestaurants = _db.Restaurants.Where(Restaurant => Restaurant.SeattleId == id).ToList();
            Seattle           thisSeattle     = _db.Seattle.FirstOrDefault(seattle => seattle.SeattleId == id);

            ViewBag.AreaName = thisSeattle.AreaName;
            return(View(thisRestaurants));
        }
Beispiel #3
0
        public ActionResult Details(int id)
        {
            Restaurant thisRestaurant = _db.Restaurants.FirstOrDefault(restaurant => restaurant.RestaurantId == id);
            Seattle    thisSeattle    = _db.Seattle.FirstOrDefault(seattle => seattle.SeattleId == thisRestaurant.SeattleId);

            ViewBag.AreaName = thisSeattle.AreaName;
            return(View(thisRestaurant));
        }
Beispiel #4
0
    public static void Main(string[] args)
    {
        Console.WriteLine("Hello World");

        Donator guy1 = new  Seattle();
        Donator guy2 = new Toronto();

        guy2.listDescrition();
    }
Beispiel #5
0
 public ActionResult Create(Seattle seattle)
 {
     try {
         _db.Seattle.Add(seattle);
         _db.SaveChanges();
     } catch (DbUpdateException e) {
         TempData["ErrorMessage"] = "Duplicate Area";
     }
     return(RedirectToAction("Index"));
 }
Beispiel #6
0
        public ActionResult Delete(int id)
        {
            Seattle thisSeattle = _db.Seattle.FirstOrDefault(seattle => seattle.SeattleId == id);

            return(View(thisSeattle));
        }
Beispiel #7
0
 public ActionResult Edit(Seattle seattle)
 {
     _db.Entry(seattle).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }