示例#1
0
        public ActionResult AddCour(Course data)
        {
            LearnerEntities ORM  = new LearnerEntities();
            List <Course>   temp = new List <Course>();

            temp = ORM.Courses.Where(x => x.CourName == data.CourName).ToList();

            if (!ModelState.IsValid || temp.Count > 0)
            {
                ViewBag.VerifyAdd = "That Entry Exists Aleady.";
                return(View("About"));
            }
            ORM.Courses.Add(data);
            ORM.SaveChanges();
            ViewBag.VerifyAdd = data.CourName;

            return(View("About"));
        }
示例#2
0
        public ActionResult AddStudent(Student data)
        {
            LearnerEntities ORM  = new LearnerEntities();
            List <Student>  temp = new List <Student>();

            temp = ORM.Students.Where(x => x.StudentID == data.StudentID).ToList();

            if (!ModelState.IsValid || temp.Count > 0)
            {
                ViewBag.VerifyAdd = "That Entry Exists Aleady.";
                return(View("About"));
            }
            ORM.Students.Add(data);
            ORM.SaveChanges();
            ViewBag.VerifyAdd = data.FirstName;

            return(View("About"));
        }
示例#3
0
        public ActionResult Index()
        {
            LearnerEntities ORM = new LearnerEntities();

            return(View());
        }