예제 #1
0
 private void tsbtnEditPerson_Click(object sender, System.EventArgs e)
 {
     PersonForm form = new PersonForm(AIS.SN.Model.DomainObjects.Person.FindById(this.GetCurrentApartmentResident().PersonId));
     if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
     {
         this.RefreshTabControl();
         this.UpdateBindingSourceApartmentResidents();
     }
 }
 private void btnChangePerson_Click(object sender, System.EventArgs e)
 {
     Person person = Mappers.PersonMapper.FindById(this.apr.PersonId);
     PersonForm form = new PersonForm(person);
     if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
     {
         this.apr.PersonName = person.ToString();
         this.tbxPersonName.set_Text(this.apr.PersonName);
     }
 }
예제 #3
0
 private void btnAdd_Click(object sender, System.EventArgs e)
 {
     Person person = new Person {
         Id = -1L,
         LName = this.tbxLName.get_Text(),
         FName = this.tbxFName.get_Text(),
         MName = this.tbxMName.get_Text(),
         NumDoc = this.tbxNumDoc.get_Text(),
         SerDoc = this.tbxSerDoc.get_Text(),
         OrgDoc = this.tbxOrg.get_Text(),
         TypeDoc = this.selectTypeDoc.SelectedFasetItem.Id
     };
     if (!this.dbxBirthDay.IsNull)
     {
         person.BirthDate = this.dbxBirthDay.Value;
     }
     if (!this.dbxDoc.IsNull)
     {
         person.DateDoc = this.dbxDoc.Value;
     }
     if (this.FirstTextInsuranceCertificate != this.mtbInsuranceCertificate.get_Text())
     {
         person.InsuranceCertificate = this.mtbInsuranceCertificate.get_Text();
     }
     person.AccountBenefit = this.tbAccountBenefit.get_Text();
     PersonForm form = new PersonForm(person);
     if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
     {
         this.bsPersons.Add(person);
         this.bsPersons.set_Position(this.bsPersons.IndexOf(person));
     }
 }