Ejemplo n.º 1
0
    private void SaveUsufructuaryRoleParty() {
      string[] selectedParties = null;
      if (cboUsufructuaryOf.Value == "multiselect") {
        selectedParties = hdnMultiPartiesInRole.Value.Split('|');
      } else {
        selectedParties = new string[] { cboUsufructuaryOf.Value };
      }
      foreach (string selectedParty in selectedParties) {
        RecordingActParty rap = RecordingActParty.Create(this.RecordingAct, this.party);
        rap.UsufructMode = (UsufructMode) Convert.ToChar(cboUsufruct.Value.Substring(0, 1));
        if (txtUsufructPartAmount.Value.Length == 0) {
          txtUsufructPartAmount.Value = "1.00";
        }
        rap.OwnershipPart = Quantity.Parse(DataTypes.Unit.Parse(cboUsufructPartUnit.Value),
                                           decimal.Parse(txtUsufructPartAmount.Value));
        rap.UsufructTerm = txtUsufructEndCondition.Value;
        rap.PartyRole = DomainActPartyRole.Usufructuary;
        rap.SecondaryPartyRole = PartiesRole.Empty;
        rap.SecondaryParty = Party.Parse(int.Parse(selectedParty));

        FillPartyData(rap);

        rap.Save();
      }

    }
Ejemplo n.º 2
0
    private void LoadFirstPartyInRoleCombo(ObjectList<RecordingActParty> parties) {
      cboFirstPartyInRole.Items.Clear();
      parties.Sort((x, y) => x.Party.FullName.CompareTo(y.Party.FullName));

      cboFirstPartyInRole.Items.Add(new ListItem("( Seleccionar una persona u organización )", String.Empty));
      foreach (RecordingActParty item in parties) {
        if (item.Party.Equals(this.party)) {
          continue;
        }
        ListItem listItem = new ListItem(item.Party.FullName, item.Party.Id.ToString());
        if (!cboFirstPartyInRole.Items.Contains(listItem)) {
          cboFirstPartyInRole.Items.Add(listItem);
        }
      }

      parties = RecordingActParty.GetSecondaryPartiesList(this.recordingAct);

      parties.Sort((x, y) => x.SecondaryParty.FullName.CompareTo(y.SecondaryParty.FullName));
      foreach (RecordingActParty item in parties) {
        if (item.SecondaryParty.Equals(this.party)) {
          continue;
        }
        ListItem listItem = new ListItem(item.SecondaryParty.FullName, item.SecondaryParty.Id.ToString());
        if (!cboFirstPartyInRole.Items.Contains(listItem)) {
          cboFirstPartyInRole.Items.Add(listItem);
        }
      }
      if (cboFirstPartyInRole.Items.Count > 2) {
        cboFirstPartyInRole.Items.Add(new ListItem("( Selección múltiple )", "multiselect"));
      }
    }
Ejemplo n.º 3
0
 private void FillHumanPartyOnRecording() {
   ObjectList<RecordingActParty> list = RecordingActParty.GetList(this.RecordingAct.Recording, this.Party);
   foreach (RecordingActParty rap in list) {
     if ((rap.Party.Equals(this.Party) && rap.SecondaryParty.IsEmptyInstance) || rap.SecondaryParty.Equals(this.Party)) {
       UpdateRecordingActParty(rap);
     }
   }
 }
Ejemplo n.º 4
0
    private void UpdateRecordingActParty(RecordingActParty rap) {
      rap.Notes = txtNotes.Value;
      rap.PartyAddress = txtAddress.Value;
      if (!String.IsNullOrEmpty(Request.Form[cboAddressPlace.Name])) {
        rap.PartyAddressPlace = GeographicRegionItem.Parse(int.Parse(Request.Form[cboAddressPlace.Name]));
      } else {
        rap.PartyAddressPlace = GeographicRegionItem.Unknown;
      }
      rap.PartyMarriageStatus = MarriageStatus.Parse(int.Parse(cboMarriageStatus.Value));
      rap.PartyOccupation = Occupation.Parse(int.Parse(cboOccupation.Value));

      rap.Save();
    }
Ejemplo n.º 5
0
    private void SaveAdditionalRole() {
      if (cboAdditionalRole.Value.Length == 0) {
        return;
      }
      int partyId = int.Parse(cboAdditionalRole.Value.Split('|')[0]);
      int roleId = int.Parse(cboAdditionalRole.Value.Split('|')[1]);

      RecordingActParty rap = RecordingActParty.Create(this.RecordingAct, this.party);
      rap.PartyRole = DomainActPartyRole.Empty;
      rap.SecondaryPartyRole = PartiesRole.Parse(roleId);
      rap.SecondaryParty = Party.Parse(partyId);

      rap.Save();
    }
Ejemplo n.º 6
0
    public void SelectParty(int partyId) {
      this.Party = Party.Parse(partyId);
      if (this.Party.ObjectTypeInfo.Id == 2433) {
        LoadHumanParty();
      } else {
        LoadOrganizationParty();
      }
      cboParty.Items.Clear();
      cboParty.Items.Add(new ListItem(this.Party.ExtendedName, this.Party.Id.ToString()));

      ObjectList<RecordingActParty> parties = RecordingActParty.GetInvolvedDomainParties(this.recordingAct);

      LoadRolesCombo(parties);
      LoadFirstPartyInRoleCombo(parties);
      LoadAdditionalRoleCombo();
    }
Ejemplo n.º 7
0
    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();
    }
Ejemplo n.º 8
0
    private void LoadMainCombos() {
      HtmlSelectContent.LoadCombo(this.cboOccupation, Occupation.GetList(), "Id", "Name",
                                  "( Seleccionar )", String.Empty, "No consta");

      HtmlSelectContent.LoadCombo(this.cboMarriageStatus, MarriageStatus.GetList(), "Id", "Name",
                                  "( ? )", String.Empty, "No consta");

      HtmlSelectContent.LoadCombo(cboBornLocation, "( Seleccionar lugar de nacimiento )",
                                  String.Empty, GeographicRegionItem.Unknown.Name);

      HtmlSelectContent.LoadCombo(cboAddressPlace, "( Seleccionar lugar de residencia )",
                                  String.Empty, GeographicRegionItem.Unknown.Name);

      ObjectList<RecordingActParty> parties = RecordingActParty.GetInvolvedDomainParties(this.recordingAct);

      LoadRolesCombo(parties);
      LoadFirstPartyInRoleCombo(parties);
    }
Ejemplo n.º 9
0
    private void SaveSecondaryRoleParty() {
      string[] selectedParties = null;
      if (cboFirstPartyInRole.Value == "multiselect") {
        selectedParties = hdnMultiPartiesInRole.Value.Split('|');
      } else {
        selectedParties = new string[] { cboFirstPartyInRole.Value };
      }
      foreach (string selectedParty in selectedParties) {
        RecordingActParty rap = RecordingActParty.Create(this.RecordingAct, Party.Parse(int.Parse(selectedParty)));
        rap.PartyRole = DomainActPartyRole.Empty;
        rap.SecondaryPartyRole = PartiesRole.Parse(int.Parse(cboRole.Value));
        rap.SecondaryParty = this.party;

        FillPartyData(rap);

        rap.Save();
      }
    }
Ejemplo n.º 10
0
    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;
    }
Ejemplo n.º 11
0
 private void FillPartyData(RecordingActParty rap) {
   if (this.party is HumanParty) {
     rap.Notes = txtNotes.Value;
     rap.PartyAddress = txtAddress.Value;
     if (!String.IsNullOrEmpty(Request.Form[cboAddressPlace.Name])) {
       rap.PartyAddressPlace = GeographicRegionItem.Parse(int.Parse(Request.Form[cboAddressPlace.Name]));
     } else {
       rap.PartyAddressPlace = GeographicRegionItem.Unknown;
     }
     if (!String.IsNullOrEmpty(Request.Form[cboMarriageStatus.Name])) {
       rap.PartyMarriageStatus = MarriageStatus.Parse(int.Parse(Request.Form[cboMarriageStatus.Name]));
     } else {
       rap.PartyMarriageStatus = MarriageStatus.Unknown;
     }
     if (!String.IsNullOrEmpty(Request.Form[cboOccupation.Name])) {
       rap.PartyOccupation = Occupation.Parse(int.Parse(Request.Form[cboOccupation.Name]));
     } else {
       rap.PartyOccupation = Occupation.Unknown;
     }
   }
 }
Ejemplo n.º 12
0
 private void DeleteParty() {
   int partyId = int.Parse(base.GetCommandParameter("partyId"));
   RecordingActParty party = RecordingActParty.Parse(partyId);
   party.Delete();
 }