Beispiel #1
0
        // GET: Location
        public ActionResult Index()
        {
            LocationDBHandle dbhandle = new LocationDBHandle();

            ModelState.Clear();
            return(View(dbhandle.GetLocations()));
        }
Beispiel #2
0
        // GET: Location/Details/5
        public ActionResult Details(int id)
        {
            LocationDBHandle dbhandle = new LocationDBHandle();

            ModelState.Clear();
            return(View(dbhandle.GetLocationDetails(id)));
        }
Beispiel #3
0
 public ActionResult Edit(int id, Location location)
 {
     try
     {
         LocationDBHandle dbhandle = new LocationDBHandle();
         dbhandle.UpdateDetails(location);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Beispiel #4
0
 public ActionResult Create(Location location)
 {
     try
     {
         if (ModelState.IsValid)
         {
             LocationDBHandle dbhandle = new LocationDBHandle();
             if (dbhandle.AddLocation(location))
             {
                 ViewBag.Message = "Location Added Successfully";
                 ModelState.Clear();
             }
         }
         return(View());
     }
     catch (Exception e)
     {
         ViewBag.Message = e.ToString();
         return(View());
     }
 }
Beispiel #5
0
        // GET: Location/Edit/5
        public ActionResult Edit(int id)
        {
            LocationDBHandle dbhandle = new LocationDBHandle();

            return(View(dbhandle.GetLocations().Find(location => location.LocationId == id)));
        }