示例#1
0
        public ActionResult Create(Student student)
        {
            var studentProcess = new StudentProcess();

            switch (student.Gender)
            {
            case "0": student.Gender = "Masculino"; break;

            case "1": student.Gender = "Femenino"; break;
            }
            studentProcess.Create(student);
            return(RedirectToAction("Index"));
        }
示例#2
0
        public ActionResult Post([FromBody] List <Student> student)
        {
            StudentProcess Process = new StudentProcess();
            var            result  = Process.Create(student);

            if (result == 1)
            {
                return(Ok("Insertion is done Successfully"));
            }
            else
            {
                return(NotFound("Insertion failed "));
            }
        }