Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Exclude = "[SchoolID]")] School school)
 {
     if (ModelState.IsValid)
     {
         DA_School.EditSchool(school);
         return(RedirectToAction("Index"));
     }
     return(View(school));
 }
Ejemplo n.º 2
0
 public ActionResult Create([Bind(Exclude = "[SchoolID]")] School schoolToInsert)
 {
     if (ModelState.IsValid)
     {
         DA_School.AddSchool(schoolToInsert);
         return(RedirectToAction("Index"));
     }
     return(View());
 }
Ejemplo n.º 3
0
        // GET: Course/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            School school = DA_School.GetSchool(id);

            if (school == null)
            {
                return(HttpNotFound());
            }
            return(View(school));
        }
Ejemplo n.º 4
0
 public ActionResult Delete(int id)
 {
     if (ModelState.IsValid)
     {
         try
         {
             DA_School.DeleteSchool(id);
         }
         catch (Exception)
         {
             //Log the error (uncomment dex variable name and add a line here to write a log.
             return(RedirectToAction("Delete", new { id = id, saveChangesError = true }));
         }
         return(RedirectToAction("Index"));
     }
     return(View());
 }
Ejemplo n.º 5
0
        public ActionResult Index()
        {
            List <School> schools = DA_School.GetSchools();

            return(View(schools));
        }