示例#1
0
 public ActionResult Create([Bind] Student student)
 {
     if (ModelState.IsValid)
     {
         objstudent.AddStudent(student);
         return(RedirectToAction("Index"));
     }
     return(View(student));
 }
示例#2
0
 public IActionResult Create(Student student)
 {
     try
     {
         studentDataAccessLayer.AddStudent(student);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
示例#3
0
        public ActionResult Create(Student student)
        {
            try
            {
                // TODO: Add insert logic here
                studentDataAccessLayer.AddStudent(student);

                return(RedirectToAction(nameof(Index)));
            }
            catch (Exception ex)
            {
                return(View());
            }
        }
示例#4
0
        public void Post([FromBody] Student student)
        {
            StudentDataAccessLayer studentDataAccessLayer = new StudentDataAccessLayer();

            studentDataAccessLayer.AddStudent(student);
        }
 public void Post([FromBody] Student value)
 {
     sdal.AddStudent(value);
 }
        public ActionResult Create(Student student)
        {
            objStudent.AddStudent(student);

            return(RedirectToAction("Index"));
        }
示例#7
0
 public int Create([FromBody] Student Student)
 {
     return(objStudent.AddStudent(Student));
 }