//####################################################CLASS PersonalInformation EVENTS############################################### //event is raised when the class is loaded protected virtual void ClassLoad(object sender, EventArgs e) { _baseServiceManager = new BaseServicesLogic(_userInfo); _personInfo = new CommonExchange.Person(); _baseServiceManager.InitializeCodeReferenceCombo(this.cboGender, CommonExchange.CodeEntityId.Gender); _baseServiceManager.InitializeCodeReferenceCombo(this.cboLifeStatus, CommonExchange.CodeEntityId.LifeStatus); _baseServiceManager.InitializeCodeReferenceCombo(this.cboMaritalStatus, CommonExchange.CodeEntityId.MaritalStatus); }//----------------------
}//------------------------- //this procedure will assigne values to personal information controls public void AssingControlsValue() { this.txtLastName.Text = _personInfo.LastName; this.txtFirstName.Text = _personInfo.FirstName; this.txtMiddleName.Text = _personInfo.MiddleName; this.txtECode.Text = _personInfo.ECode; Boolean isEmployee = false; if (_baseServiceManager.IsExistsSysIDPersonStudentEmployeeInformation(_userInfo, _personInfo.PersonSysId, ref isEmployee) && !(RemoteServerLib.ProcStatic.IsSystemAccessAdmin(_userInfo) || RemoteServerLib.ProcStatic.IsSystemAccessVpOfFinance(_userInfo) || RemoteServerLib.ProcStatic.IsSystemAccessPayrollMaster(_userInfo) || RemoteServerLib.ProcStatic.IsSystemAccessCashier(_userInfo))) { this.txtLastName.Enabled = this.txtFirstName.Enabled = this.txtMiddleName.Enabled = false; } else { if (((RemoteServerLib.ProcStatic.IsSystemAccessAdmin(_userInfo) || RemoteServerLib.ProcStatic.IsSystemAccessVpOfFinance(_userInfo)) || (!isEmployee && RemoteServerLib.ProcStatic.IsSystemAccessCashier(_userInfo)) || (isEmployee && RemoteServerLib.ProcStatic.IsSystemAccessPayrollMaster(_userInfo))) || !(_baseServiceManager.IsExistsSysIDPersonStudentEmployeeInformation(_userInfo, _personInfo.PersonSysId, ref isEmployee))) { this.txtLastName.Enabled = this.txtFirstName.Enabled = this.txtMiddleName.Enabled = true; } else { this.txtLastName.Enabled = this.txtFirstName.Enabled = this.txtMiddleName.Enabled = false; } } DateTime dBirthDate = DateTime.MinValue; this.txtBirthDate.Clear(); if (DateTime.TryParse(_personInfo.BirthDate, out dBirthDate)) { this.txtBirthDate.Text = DateTime.Compare(dBirthDate, DateTime.MinValue) == 0 ? String.Empty : dBirthDate.ToLongDateString(); } this.txtPlaceOfBirth.Text = _personInfo.PlaceOfBirth; this.txtPressentAddress.Text = _personInfo.PresentAddress; this.txtPressentPhone.Text = _personInfo.PresentPhoneNos; this.txtHomeAddress.Text = _personInfo.HomeAddress; this.txtHomePhone.Text = _personInfo.HomePhoneNos; this.txtEMail.Text = _personInfo.EMailAddress; this.txtCitizenship.Text = _personInfo.Citizenship; this.txtNationality.Text = _personInfo.Nationality; this.txtReligion.Text = _personInfo.Religion; _baseServiceManager.InitializeCodeReferenceCombo(this.cboGender, CommonExchange.CodeEntityId.Gender, _personInfo.GenderCode.CodeReferenceId); _baseServiceManager.InitializeCodeReferenceCombo(this.cboLifeStatus, CommonExchange.CodeEntityId.LifeStatus, _personInfo.LifeStatusCode.CodeReferenceId); _baseServiceManager.InitializeCodeReferenceCombo(this.cboMaritalStatus, CommonExchange.CodeEntityId.MaritalStatus, _personInfo.MaritalStatusCode.CodeReferenceId); DateTime dMarriageDate = DateTime.MinValue; this.txtMarriageDate.Clear(); if (DateTime.TryParse(_personInfo.MarriageDate, out dMarriageDate)) { this.txtMarriageDate.Text = DateTime.Compare(dMarriageDate, DateTime.MinValue) == 0 ? String.Empty : dMarriageDate.ToLongDateString(); } this.txtOtherInformation.Text = _personInfo.OtherPersonInformation; if (!String.IsNullOrEmpty(_personInfo.FilePath) && File.Exists(_personInfo.FilePath)) { this.pbxPerson.Image = Image.FromFile(_personInfo.FilePath); } }//---------------------------