private Party FillHumanParty() { if (this.Party == null) { this.Party = new HumanParty(); } HumanParty person = (HumanParty) this.Party; if (!String.IsNullOrEmpty(Request.Form[txtBornDate.Name])) { person.RegistryDate = EmpiriaString.ToDateTime(txtBornDate.Value); } else { person.RegistryDate = ExecutionServer.DateMaxValue; } if (!String.IsNullOrEmpty(Request.Form[cboBornLocation.Name])) { person.RegistryLocation = GeographicRegionItem.Parse(int.Parse(Request.Form[cboBornLocation.Name])); } else { person.RegistryLocation = GeographicRegionItem.Unknown; } person.CURPNumber = txtCURPNumber.Value; person.FirstFamilyName = txtFirstFamilyName.Value; person.FirstName = txtFirstName.Value; person.MaritalFamilyName = txtMaritalFamilyName.Value; person.Gender = (Contacts.Gender) Convert.ToChar(cboGender.Value); person.IFENumber = txtIFENumber.Value; person.Nicknames = txtNicknames.Value; person.SecondFamilyName = txtSecondFamilyName.Value; person.TaxIDNumber = txtTaxIDNumber.Value; person.Save(); return person; }
private void SaveDomainRoleParty() { RecordingActParty rap = RecordingActParty.Create(this.RecordingAct, this.party); rap.PartyRole = DomainActPartyRole.Parse(int.Parse(cboRole.Value)); rap.SecondaryPartyRole = PartiesRole.Empty; rap.SecondaryParty = HumanParty.Parse(-1); rap.OwnershipMode = (OwnershipMode) Convert.ToChar(cboOwnership.Value.Substring(0, 1)); if (txtOwnershipPartAmount.Value.Length == 0) { txtOwnershipPartAmount.Value = "1.00"; } rap.OwnershipPart = Quantity.Parse(DataTypes.Unit.Parse(cboOwnershipPartUnit.Value), decimal.Parse(txtOwnershipPartAmount.Value)); FillPartyData(rap); rap.Save(); }
private void LoadHumanParty() { HumanParty person = (HumanParty) this.Party; cboPartyType.Value = person.ObjectTypeInfo.Id.ToString(); if (person.RegistryDate != ExecutionServer.DateMaxValue) { txtBornDate.Value = person.RegistryDate.ToString("dd/MMM/yyyy"); } else { txtBornDate.Value = String.Empty; } txtFirstFamilyName.Value = person.FirstFamilyName; txtFirstName.Value = person.FirstName; txtMaritalFamilyName.Value = person.MaritalFamilyName; cboGender.Value = ((char) person.Gender).ToString(); txtIFENumber.Value = person.IFENumber; txtCURPNumber.Value = person.CURPNumber; txtTaxIDNumber.Value = person.TaxIDNumber; txtNicknames.Value = person.Nicknames; txtSecondFamilyName.Value = person.SecondFamilyName; cboBornLocation.Items.Clear(); cboBornLocation.Items.Add(new ListItem(person.RegistryLocation.CompoundName, person.RegistryLocation.Id.ToString())); ObjectList<RecordingActParty> list = RecordingActParty.GetList(this.RecordingAct.Recording, this.Party); List<RecordingActParty> p = list.FindAll((x) => (x.Party.Equals(this.Party) && x.SecondaryParty.IsEmptyInstance) || x.SecondaryParty.Equals(this.Party)); RecordingActParty lastParty = null; if (p.Count != 0) { lastParty = p[0]; } else { lastParty = person.GetLastRecordingActParty(this.recordingAct.Recording.PresentationTime); } if (lastParty == null) { isLoaded = true; return; } txtAddress.Value = lastParty.PartyAddress; cboAddressPlace.Items.Clear(); cboAddressPlace.Items.Add(new ListItem(lastParty.PartyAddressPlace.CompoundName, lastParty.PartyAddressPlace.Id.ToString())); cboOccupation.Value = lastParty.PartyOccupation.Id.ToString(); cboMarriageStatus.Value = lastParty.PartyMarriageStatus.Id.ToString(); isLoaded = true; }