Пример #1
0
        public ViewResult create(int id)
        {
            GuarantorView guarantorView = new GuarantorView()
            {
                studentID = id //_studentRepo.GetStudent(id)
            };

            return(View(guarantorView));
        }
Пример #2
0
        public ViewResult FullView(int id)
        {
            GuarantorView guarantorView = new GuarantorView()
            {
                guarantor = _guarantor.GetGuarantor(id),
                //pagetitle = "full view"
            };

            return(View(guarantorView));
        }
Пример #3
0
 public IActionResult create(GuarantorView model)
 {
     if (ModelState.IsValid)
     {
         Guarantor guarantor1 = new Guarantor()
         {
             //ID = model.Id,
             FirstName     = model.FirstName,
             LastName      = model.LastName,
             Address       = model.Address,
             Email         = model.Email,
             Gender        = model.Gender,
             Phone         = model.Phone,
             _student_id   = model.studentID,
             MaritalStatus = model.MaritalStatus,
             Nationality   = model.Nationality
         };
         _guarantor.AddGuarantor(guarantor1);
         return(RedirectToAction("create"));
     }
     return(View());
 }