Example #1
0
        public async Task <IActionResult> Create([Bind("Uid,FirstName,LastName,EmailAddress,PhoneNumber,Resume,DegreePlan,GPA,HoursPerWeek,personalStatement,ExpectedGraduationDate,ApplicationDate,Active,StudentSkills,StudentCompletedCourses,StudentInterests")] Student student)
        {
            if (ModelState.IsValid)
            {
                var time = DateTime.Now;
                student.ApplicationDate = time;

                _contextStudent.Add(student);
                await _contextStudent.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            return(View(student));
        }
 public JsonResult Add(Student sdt)
 {
     return(Json(db.Add(sdt), JsonRequestBehavior.AllowGet));
 }
Example #3
0
 public JsonResult Add(Student std)
 {
     return(Json(stdDB.Add(std), JsonRequestBehavior.AllowGet));
 }
        /// <summary>
        /// Add new student
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public JsonResult Create(Student entity)
        {
            var rs = db.Add(entity);

            return(Json(new { msg = rs }, JsonRequestBehavior.AllowGet));
        }