Exemplo n.º 1
0
        //GET : /Class/Update
        public ActionResult Update(int id)
        {
            ClassDataController controller = new ClassDataController();
            Class SelectedClass            = controller.FindClass(id);

            return(View(SelectedClass));
        }
Exemplo n.º 2
0
        //POST : /Class/Delete/{id}
        public ActionResult Delete(int id)
        {
            ClassDataController controller = new ClassDataController();

            controller.DeleteClass(id);
            return(RedirectToAction("List"));
        }
Exemplo n.º 3
0
        // GET: /Class/DeleteConfirm/{id}
        public ActionResult ConfirmDelete(int id)
        {
            ClassDataController controller = new ClassDataController();
            Class NewClass = controller.FindClass(id);

            return(View(NewClass));
        }
Exemplo n.º 4
0
        // GET: Class/List
        public ActionResult List(string SearchKey = null)
        {
            ClassDataController controller = new ClassDataController();
            IEnumerable <Class> Classes    = controller.ListClasses(SearchKey);

            return(View(Classes));
        }
Exemplo n.º 5
0
        public ActionResult Create(string ClassCode, string ClassName, DateTime StartDate, DateTime FinishDate)
        {
            Class NewClass = new Class();

            NewClass.ClassCode  = ClassCode;
            NewClass.ClassName  = ClassName;
            NewClass.StartDate  = StartDate;
            NewClass.FinishDate = FinishDate;

            ClassDataController controller = new ClassDataController();

            controller.AddClass(NewClass);

            return(RedirectToAction("List"));
        }
Exemplo n.º 6
0
        public ActionResult Update(int id, string ClassCode, string ClassName, DateTime StartDate, DateTime FinishDate)
        {
            Class ClassInfo = new Class();

            ClassInfo.ClassCode  = ClassCode;
            ClassInfo.ClassName  = ClassName;
            ClassInfo.StartDate  = StartDate;
            ClassInfo.FinishDate = FinishDate;


            ClassDataController controller = new ClassDataController();

            controller.UpdateClass(id, ClassInfo);

            return(RedirectToAction("Show/" + id));
        }