예제 #1
0
        public GuarantorEditView(int GuarantorId)
        {
            InitializeComponent();
            _guarantorEditViewModel = Program.Factory.Resolve <GuarantorEditViewModel>();
            _guarantorEditViewModel.AccountsLoaded += _guarantorEditViewModel_AccountsLoaded;
            _GuarantorEntityValidator = Program.Factory.Resolve <IEntityValidator>();

            LoadGuarantor(GuarantorId);
            TranslateControls();
            _isNewGuarantor = false;
        }
예제 #2
0
        public IActionResult Edit(int id)
        {
            var model = _employeeRepository.GetGuarantor(id);
            GuarantorEditViewModel guarantorEditViewModel = new GuarantorEditViewModel
            {
                DocUrl    = model.DocUrl,
                Name      = model.Name,
                StudentId = model.StudentId,
                Phone     = model.Phone,
                ID        = model.ID
            };

            return(View(guarantorEditViewModel));
        }
예제 #3
0
        public IActionResult Edit(GuarantorEditViewModel guarantorEditViewModel)
        {
            if (ModelState.IsValid)
            {
                Guarantor guarantor = _employeeRepository.GetGuarantor(guarantorEditViewModel.ID);
                guarantor.DocUrl    = guarantorEditViewModel.DocUrl;
                guarantor.StudentId = guarantorEditViewModel.StudentId;
                guarantor.Phone     = guarantorEditViewModel.Phone;
                guarantor.Name      = guarantorEditViewModel.Name;

                _employeeRepository.UpdateGuarantor(guarantor);
                return(RedirectToAction("Index"));
            }
            return(View());
        }
예제 #4
0
        public GuarantorEditView()
        {
            InitializeComponent();
            _guarantorEditViewModel = Program.Factory.Resolve <GuarantorEditViewModel>();
            _guarantorEditViewModel.AccountsLoaded += _guarantorEditViewModel_AccountsLoaded;

            _GuarantorEntityValidator = Program.Factory.Resolve <IEntityValidator>();
            _GuarantorEntityValidator.controlCollection = Controls;
            _GuarantorEntityValidator.DataEntity        = _Guarantor;

            guarantorBindingSource.DataSource = new OrphanageDataModel.Persons.Guarantor();
            _Guarantor      = new OrphanageDataModel.Persons.Guarantor();
            _isNewGuarantor = true;
            addressForm1.AddressDataSource = new Address();
            nameForm1.NameDataSource       = new Name();
            EnableDisableControls(false);
            TranslateControls();
        }