private void InitializePerson() { if (_tempPerson.Id != 0) { buttonSave.Text = MultiLanguageStrings.GetString(Ressource.PersonUserControl, "Update"); textBoxLastname.Text = _tempPerson.LastName; textBoxFirstName.Text = _tempPerson.FirstName; textBoxIdentificationData.Text = _tempPerson.IdentificationData; dateTimePickerDateOfBirth.Text = ServicesHelper.ConvertNullableDateTimeToString(_tempPerson.DateOfBirth); textBoxLoanCycle.Text = _tempPerson.LoanCycle.ToString(); textBoxFatherName.Text = _tempPerson.FatherName; textBoxBirthPlace.Text = _tempPerson.BirthPlace ?? String.Empty; textBoxNationality.Text = _tempPerson.Nationality ?? ServicesProvider.GetInstance().GetGeneralSettings().Country; comboBoxSex.SelectGender(_tempPerson.Sex); comboBoxSex.Text = _tempPerson.Sex.ToString(); eacPerson.Activity = _tempPerson.Activity; addressUserControlFirst.ZipCode = _tempPerson.ZipCode; addressUserControlFirst.Email = _tempPerson.Email; addressUserControlFirst.District = _tempPerson.District; addressUserControlFirst.City = _tempPerson.City; addressUserControlFirst.Comments = _tempPerson.Address; addressUserControlFirst.HomePhone = _tempPerson.HomePhone ?? String.Empty; addressUserControlFirst.PersonalPhone = _tempPerson.PersonalPhone ?? String.Empty; if (!_tempPerson.SecondaryAddressIsEmpty) { addressUserControlSecondaryAddress.ZipCode = _tempPerson.SecondaryZipCode; addressUserControlSecondaryAddress.Email = _tempPerson.SecondaryEmail; addressUserControlSecondaryAddress.District = _tempPerson.SecondaryDistrict; addressUserControlSecondaryAddress.City = _tempPerson.SecondaryCity; addressUserControlSecondaryAddress.Comments = _tempPerson.SecondaryAddress; addressUserControlSecondaryAddress.HomePhone = _tempPerson.SecondaryHomePhone ?? String.Empty; addressUserControlSecondaryAddress.PersonalPhone = _tempPerson.SecondaryPersonalPhone ?? String.Empty; } //_InitializeCustomizeFields(); DisplayProjects(_tempPerson.Projects); cbBranch.SelectedItem = _tempPerson.Branch; } else { _tempPerson.LoanCycle = 0; if (cbBranch.Items.Count > 0) { cbBranch.SelectedIndex = 0; } eacPerson.Activity = ServicesProvider.GetInstance() .GetEconomicActivityServices() .FindAllEconomicActivities(false) .FirstOrDefault(); } InitializePhoto(); }
private void InitializePerson() { if (_tempPerson.Id != 0) { buttonSave.Text = MultiLanguageStrings.GetString(Ressource.PersonUserControl, "Update"); textBoxLastname.Text = _tempPerson.LastName; textBoxFirstName.Text = _tempPerson.FirstName; textBoxIdentificationData.Text = _tempPerson.IdentificationData; dateTimePickerFirstContact.Text = ServicesHelper.ConvertNullableDateTimeToString(_tempPerson.FirstContact); dateTimePickerFirstAppointment.Text = ServicesHelper.ConvertNullableDateTimeToString(_tempPerson.FirstAppointment); dateTimePickerDateOfBirth.Text = ServicesHelper.ConvertNullableDateTimeToString(_tempPerson.DateOfBirth); checkBoxHeadOfHousehold.Checked = _tempPerson.HouseHoldHead; textBoxLoanCycle.Text = _tempPerson.LoanCycle.ToString(); textBoxFatherName.Text = _tempPerson.FatherName; textBoxBirthPlace.Text = _tempPerson.BirthPlace ?? String.Empty; textBoxNationality.Text = _tempPerson.Nationality ?? ServicesProvider.GetInstance().GetGeneralSettings().Country; richTextBoxCommentsActivity.Text = _tempPerson.FollowUpComment; comboBoxSex.SelectGender(_tempPerson.Sex); comboBoxSex.Text = _tempPerson.Sex.ToString(); eacPerson.Activity = _tempPerson.Activity; comboBoxSponsor1.Text = _tempPerson.Sponsor1; comboBoxSponsor2.Text = _tempPerson.Sponsor2; textBoxSponsor1.Text = _tempPerson.Sponsor1Comment; textBoxSponsor2.Text = _tempPerson.Sponsor2Comment; addressUserControlFirst.ZipCode = _tempPerson.ZipCode; addressUserControlFirst.HomeType = _tempPerson.HomeType; addressUserControlFirst.Email = _tempPerson.Email; addressUserControlFirst.District = _tempPerson.District; addressUserControlFirst.City = _tempPerson.City; addressUserControlFirst.Comments = _tempPerson.Address; addressUserControlFirst.HomePhone = _tempPerson.HomePhone ?? String.Empty; addressUserControlFirst.PersonalPhone = _tempPerson.PersonalPhone ?? String.Empty; if (!_tempPerson.SecondaryAddressIsEmpty) { addressUserControlSecondaryAddress.ZipCode = _tempPerson.SecondaryZipCode; addressUserControlSecondaryAddress.HomeType = _tempPerson.SecondaryHomeType; addressUserControlSecondaryAddress.Email = _tempPerson.SecondaryEmail; addressUserControlSecondaryAddress.District = _tempPerson.SecondaryDistrict; addressUserControlSecondaryAddress.City = _tempPerson.SecondaryCity; addressUserControlSecondaryAddress.Comments = _tempPerson.SecondaryAddress; addressUserControlSecondaryAddress.HomePhone = _tempPerson.SecondaryHomePhone ?? String.Empty; addressUserControlSecondaryAddress.PersonalPhone = _tempPerson.SecondaryPersonalPhone ?? String.Empty; } //_InitializeCustomizeFields(); DisplayProjects(_tempPerson.Projects); cbBranch.SelectedItem = _tempPerson.Branch; } else { _tempPerson.LoanCycle = 0; if (cbBranch.Items.Count > 0) { cbBranch.SelectedIndex = 0; } } InitializePhoto(); }
private void InitializePerson() { if (_tempPerson.Id != 0) { buttonSave.Text = MultiLanguageStrings.GetString(Ressource.PersonUserControl, "Update"); textBoxLastname.Text = _tempPerson.LastName; textBoxFirstName.Text = _tempPerson.FirstName; textBoxIdentificationData.Text = _tempPerson.IdentificationData; dateTimePickerDateOfBirth.Text = ServicesHelper.ConvertNullableDateTimeToString(_tempPerson.DateOfBirth); textBoxLoanCycle.Text = _tempPerson.LoanCycle.ToString(); textBoxFatherName.Text = _tempPerson.FatherName; textBoxBirthPlace.Text = _tempPerson.BirthPlace ?? String.Empty; textBoxNationality.Text = _tempPerson.Nationality ?? ServicesProvider.GetInstance().GetGeneralSettings().Country; comboBoxSex.SelectGender(_tempPerson.Sex); cbType.SelectedItem = _tempPerson.ParticularsType; tbIDNumber.Text = _tempPerson.ParticularsIDNumber; dtpIssueDate.Text = ServicesHelper.ConvertNullableDateTimeToString(_tempPerson.ParticularsIssueDate); dtpExpiryDate.Text = ServicesHelper.ConvertNullableDateTimeToString(_tempPerson.ParticularsExpiryDate); _relationshipOfficerComboBox.Text = _tempPerson.RelationshipOfficer != null ? _tempPerson.RelationshipOfficer.Name : string.Empty; comboBoxSex.Text = _tempPerson.Sex.ToString(); eacPerson.Activity = _tempPerson.Activity; addressUserControlFirst.ZipCode = _tempPerson.ZipCode; addressUserControlFirst.HomeType = _tempPerson.HomeType; addressUserControlFirst.Email = _tempPerson.Email; addressUserControlFirst.District = _tempPerson.District; addressUserControlFirst.City = _tempPerson.City; addressUserControlFirst.Comments = _tempPerson.Address; addressUserControlFirst.HomePhone = _tempPerson.HomePhone ?? String.Empty; addressUserControlFirst.PersonalPhone = _tempPerson.PersonalPhone ?? String.Empty; addressUserControlFirst.SMSDelivery = _tempPerson.SmsDelivery.HasValue ? _tempPerson.SmsDelivery.Value : false; addressUserControlFirst.EmailDelivery = _tempPerson.EmailDelivery.HasValue ? _tempPerson.EmailDelivery.Value : true; if (!_tempPerson.SecondaryAddressIsEmpty) { addressUserControlSecondaryAddress.ZipCode = _tempPerson.SecondaryZipCode; addressUserControlSecondaryAddress.HomeType = _tempPerson.SecondaryHomeType; addressUserControlSecondaryAddress.Email = _tempPerson.SecondaryEmail; addressUserControlSecondaryAddress.District = _tempPerson.SecondaryDistrict; addressUserControlSecondaryAddress.City = _tempPerson.SecondaryCity; addressUserControlSecondaryAddress.Comments = _tempPerson.SecondaryAddress; addressUserControlSecondaryAddress.HomePhone = _tempPerson.SecondaryHomePhone ?? String.Empty; addressUserControlSecondaryAddress.PersonalPhone = _tempPerson.SecondaryPersonalPhone ?? String.Empty; } //_InitializeCustomizeFields(); DisplayProjects(_tempPerson.Projects); cbBranch.SelectedItem = _tempPerson.Branch; } else { SetRelationshipOfficer(User.CurrentUser); _tempPerson.LoanCycle = 0; if (cbBranch.Items.Count > 0) { cbBranch.SelectedIndex = 0; } } InitializePhoto(); }