Exemplo n.º 1
0
        public ActionResult EditStudent(string code = "")
        {
            StudentViewModel studentViewModel = new StudentViewModel();

            if (code.Length <= 0 || code.Equals("0"))
            {
                studentViewModel.FormTitle = "Add Student";
                studentViewModel.Dob       = DateTime.Today;
            }
            else
            {
                studentViewModel           = studentViewModel.CopyModelToViewModel(_studentService.GetStudentByCode(code));
                studentViewModel.FormTitle = "Edit Student";
            }
            return(PartialView("_EditStudent", studentViewModel));
        }