public Result <StudentEdit> GetStudentEditById(long id)
        {
            var result        = new Result <StudentEdit>();
            var getPersonById = _personDAOService.GetPersonById(id);

            if (!getPersonById.Success)
            {
                result.Message = getPersonById.Message;
                return(result);
            }

            var getStudentById = _studentDAOService.GetStudentById(id);

            if (!getStudentById.Success)
            {
                result.Message = getStudentById.Message;
                return(result);
            }
            result.Data = new StudentEdit {
                Person = getPersonById.Data, Student = getStudentById.Data
            };

            result.Success = true;
            return(result);
        }
Ejemplo n.º 2
0
        public ActionResult UpdPerson(int id)
        {
            var getPersonById = _personService.GetPersonById(id);

            if (!getPersonById.Success)
            {
                ModelState.AddModelError("Error", getPersonById.Message);
                return(View(new Person()));
            }
            return(PartialView(getPersonById.Data));
        }