Пример #1
0
        public ViewResult EditGuarantor(Guid Id)
        {
            Guarantor       guarantor = _guarantorRepository.GetGuarantor(Id);
            UpdateGuarantor update    = new UpdateGuarantor
            {
                Id           = guarantor.Id,
                Name         = guarantor.Name,
                Number       = guarantor.Number,
                Gender       = guarantor.Gender,
                Relationship = guarantor.Relationship,
                Occupation   = guarantor.Occupation,
                Email        = guarantor.Email,
                Nationality  = guarantor.Nationality,
                Address      = guarantor.Address
            };

            return(View(update));
        }
Пример #2
0
        public IActionResult EditGuarantor(UpdateGuarantor updateGuarantor)
        {
            if (ModelState.IsValid)
            {
                Guarantor guarantor = _guarantorRepository.GetGuarantor(updateGuarantor.Id);
                guarantor.Name         = updateGuarantor.Name;
                guarantor.Number       = updateGuarantor.Number;
                guarantor.Gender       = updateGuarantor.Gender;
                guarantor.Address      = updateGuarantor.Address;
                guarantor.Relationship = updateGuarantor.Relationship;
                guarantor.Occupation   = updateGuarantor.Occupation;
                guarantor.Email        = updateGuarantor.Email;
                guarantor.Nationality  = updateGuarantor.Nationality;

                _guarantorRepository.UpdateGuarantor(guarantor);
            }
            return(View());
        }