示例#1
0
        public async void AddStudent()
        {
            await StudentModel.AddStudent(CurrentStudent);


            lstStudent = await StudentModel.GetAllStudents();

            CurrentStudent = new StudentModel();

            await((MasterDetailPage)App.Current.MainPage).Detail.Navigation.PopAsync();
        }
 public ActionResult Create(StudentModel sModel)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var studentModel = new StudentModel();
             if (studentModel.AddStudent(sModel))
             {
                 ViewBag.Message = "Student Details Added Successfully";
                 ModelState.Clear();
             }
         }
         return(View());
     }
     catch (Exception ex)
     {
         ViewBag.ErrorMessage = "Exception occured" + ex;
         return(View());
     }
 }
示例#3
0
 public IActionResult Add(StudentModel model)
 {
     model.AddStudent();
     return(RedirectToAction("GetAll"));
 }