コード例 #1
0
    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;
    }
コード例 #2
0
    private string GetPostalCodesStringArrayCommandHandler() {
      int municipalityId = int.Parse(GetCommandParameter("municipalityId", false, "0"));
      int settlementId = int.Parse(GetCommandParameter("settlementId", false, "-1"));

      string items = String.Empty;
      if (municipalityId == 0) {
        return HtmlSelectContent.GetComboAjaxHtmlItem(String.Empty, "Municipio?");
      }
      if (settlementId <= 0) {
        return HtmlSelectContent.GetComboAjaxHtmlItem("-2", GeographicRegionItem.Unknown.Name);
      }
      GeographicRegionItem municipality = GeographicRegionItem.Parse(municipalityId);
      GeographicRegionItem settlement = GeographicRegionItem.Parse(settlementId);

      ObjectList<GeographicRegionItem> list = null;
      if (settlement.IsEmptyInstance) {
        list = municipality.GetRegions("Municipality_PostalCodes");
      } else {
        list = settlement.GetRegions("Settlement_PostalCodes");
      }
      if (list.Count != 0) {
        return HtmlSelectContent.GetComboAjaxHtml(list, 0, "Id", "Name", "( ? )", String.Empty, GeographicRegionItem.Unknown.Name);
      } else {
        return HtmlSelectContent.GetComboAjaxHtml("( No def ) ", String.Empty, GeographicRegionItem.Unknown.Name);
      }
    }
コード例 #3
0
    private string GetStreetRoadsStringArrayCommandHandler() {
      int municipalityId = int.Parse(GetCommandParameter("municipalityId", false, "0"));
      int settlementId = int.Parse(GetCommandParameter("settlementId", false, "-1"));
      int streetRoadTypeId = int.Parse(GetCommandParameter("pathTypeId", false, "305"));


      if (municipalityId == 0) {
        return HtmlSelectContent.GetComboAjaxHtmlItem(String.Empty, "( Primero seleccionar un municipio )");
      }
      if (settlementId <= 0) {
        return HtmlSelectContent.GetComboAjaxHtmlItem("-2", GeographicPathItem.Unknown.Name);
      }

      GeographicRegionItem municipality = GeographicRegionItem.Parse(municipalityId);
      GeographicRegionItem settlement = GeographicRegionItem.Parse(settlementId);
      GeographicItemType pathType = GeographicItemType.Parse(streetRoadTypeId);

      ObjectList<GeographicPathItem> list = null;
      if (settlement.IsEmptyInstance) {
        list = municipality.GetPaths("Municipality_Paths", pathType);
      } else {
        list = settlement.GetPaths("Settlement_Paths", pathType);
      }
      if (list.Count != 0) {
        string header = "( Seleccionar" + (pathType.FemaleGenre ? " una " : " un ") + pathType.DisplayName.ToLowerInvariant() + " )";

        Func<GeographicPathItem, string> textFunction = (x) => x.Name + " (" + x.ObjectTypeInfo.DisplayName + ")";

        return HtmlSelectContent.GetComboAjaxHtml(list, "Id", textFunction, header, String.Empty, GeographicPathItem.Unknown.Name);
      } else {
        string header = "( No hay " + pathType.DisplayPluralName.ToLowerInvariant() + (pathType.FemaleGenre ? " definidas )" : " definidos )");

        return HtmlSelectContent.GetComboAjaxHtml(header, String.Empty, GeographicPathItem.Unknown.Name);
      }
    }
コード例 #4
0
    private void FillNotaryDocument(RecordingDocumentType documentType) {
      RecordingDocument document = base.Document;

      document.ChangeDocumentType(documentType);
      document.IssuePlace = GeographicRegionItem.Parse(int.Parse(cboNotaryDocIssuePlace.Value));
      document.IssueOffice = NotaryOffice.Parse(int.Parse(Request.Form[cboNotaryDocIssueOffice.Name]));
      document.BookNumber = txtNotaryDocBook.Value;
      document.Number = txtNotaryDocNumber.Value;
    }
コード例 #5
0
    private string GetNotaryOfficesInPlaceStringArrayCommandHandler() {
      int placeId = int.Parse(GetCommandParameter("placeId", false, "0"));

      if (placeId == 0) {
        return HtmlSelectContent.GetComboAjaxHtmlItem(String.Empty, "( Primero seleccionar una ciudad )");
      }
      GeographicRegionItem place = GeographicRegionItem.Parse(placeId);
      ObjectList<NotaryOffice> list = NotaryOffice.GetList(place);

      return HtmlSelectContent.GetComboAjaxHtml(list, 0, "Id", "Number", "( ? )", String.Empty, "N/C");
    }
コード例 #6
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();
    }
コード例 #7
0
    private void AppendSettlement() {
      GeographicRegionItem municipality = GeographicRegionItem.Parse(int.Parse(Request.Form[cboMunicipality.ClientID]));
      GeographicItemType settlementType = GeographicItemType.Parse(int.Parse(cboSettlementType.Value));

      GeographicRegionItem settlement = (GeographicRegionItem) settlementType.CreateInstance();
      settlement.Name = txtSearchText.Value;
      settlement.Save();

      municipality.AddMember("Municipality_Settlements", settlement);

      FillPropertyData();
      property.Settlement = settlement;
      property.Save();
    }
コード例 #8
0
    private void FillPrivateContractDocument(RecordingDocumentType documentType) {
      RecordingDocument document = base.Document;

      document.ChangeDocumentType(documentType);
      document.IssuePlace = GeographicRegionItem.Parse(int.Parse(cboPrivateDocIssuePlace.Value));
      document.Number = txtPrivateDocNumber.Value;
      document.MainWitnessPosition = TypeAssociationInfo.Parse(int.Parse(Request.Form[cboPrivateDocMainWitnessPosition.Name]));
      document.MainWitness = Contact.Parse(int.Parse(Request.Form[cboPrivateDocMainWitness.Name]));
      if (txtPrivateDocIssueDate.Value.Length != 0) {
        document.IssueDate = EmpiriaString.ToDate(txtPrivateDocIssueDate.Value);
      } else {
        document.IssueDate = ExecutionServer.DateMinValue;
      }
    }
コード例 #9
0
    private void FillJudicialDocument(RecordingDocumentType documentType) {
      RecordingDocument document = base.Document;

      document.ChangeDocumentType(documentType);
      document.IssuePlace = GeographicRegionItem.Parse(int.Parse(Request.Form[cboJudicialDocIssuePlace.Name]));
      document.IssueOffice = Organization.Parse(int.Parse(Request.Form[cboJudicialDocIssueOffice.Name]));
      document.IssuedBy = Contact.Parse(int.Parse(Request.Form[cboJudicialDocIssuedBy.Name]));
      document.BookNumber = txtJudicialDocBook.Value;
      document.Number = txtJudicialDocNumber.Value;
      if (txtJudicialDocIssueDate.Value.Length != 0) {
        document.IssueDate = EmpiriaString.ToDate(txtJudicialDocIssueDate.Value);
      } else {
        document.IssueDate = ExecutionServer.DateMinValue;
      }
    }
コード例 #10
0
    private string GetSettlementIdCommandHandler() {
      int settlementTypeId = int.Parse(GetCommandParameter("settlementTypeId", true));
      int municipalityId = int.Parse(GetCommandParameter("municipalityId", true));
      string name = GetCommandParameter("name", true);

      GeographicItemType settlementType = GeographicItemType.Parse(settlementTypeId);
      GeographicRegionItem municipality = GeographicRegionItem.Parse(municipalityId);

      GeographicRegionItem result = GeographicItemValidator.SearchSettlement(settlementType, municipality, name);

      if (result.Id != GeographicRegionItem.Empty.Id) {
        return result.Id.ToString();
      }

      return String.Empty;
    }
コード例 #11
0
    private void FillNotaryDocument(RecordingDocumentType documentType) {
      RecordingDocument document = base.Document;

      document.ChangeDocumentType(documentType);
      document.IssuePlace = GeographicRegionItem.Parse(int.Parse(cboNotaryDocIssuePlace.Value));
      document.IssueOffice = NotaryOffice.Parse(int.Parse(Request.Form[cboNotaryDocIssueOffice.Name]));
      document.IssuedBy = Contact.Parse(int.Parse(Request.Form[cboNotaryDocIssuedBy.Name]));
      document.BookNumber = txtNotaryDocBook.Value;
      document.Number = txtNotaryDocNumber.Value;
      document.StartSheet = txtNotaryDocStartSheet.Value;
      document.EndSheet = txtNotaryDocEndSheet.Value;
      if (txtNotaryDocIssueDate.Value.Length != 0) {
        document.IssueDate = EmpiriaString.ToDate(txtNotaryDocIssueDate.Value);
      } else {
        document.IssueDate = ExecutionServer.DateMinValue;
      }
    }
コード例 #12
0
    private void AppendStreetRoad() {
      GeographicRegionItem settlement = GeographicRegionItem.Parse(int.Parse(Request.Form[cboSettlement.ClientID]));
      GeographicItemType streetRoadType = GeographicItemType.Parse(int.Parse(cboStreetRoadType.Value));

      GeographicPathItem street = (GeographicPathItem) streetRoadType.CreateInstance();
      street.Name = txtSearchText.Value;
      street.Save();

      settlement.AddMember("Settlement_Paths", street);

      GeographicRegionItem municipality = GeographicRegionItem.Parse(int.Parse(Request.Form[cboMunicipality.ClientID]));
      municipality.AddMember("Municipality_Paths", street);

      FillPropertyData();
      property.Street = street;
      property.Save();
    }
コード例 #13
0
    private string GetRegionsStringArrayCommandHandler() {
      string header = GetCommandParameter("header", false, "( Seleccionar )");
      string keywords = GetCommandParameter("keywords", false, String.Empty);

      if (keywords.Length == 0) {
        return HtmlSelectContent.GetComboAjaxHtml(header, String.Empty, GeographicRegionItem.Unknown.Name);
      }
      string filter = SearchExpression.ParseAndLike("GeoItemKeywords", keywords);

      if (filter.Length != 0) {
        filter += " AND ";
      }
      filter += "GeoItemTypeId IN (307, 308, 315, 316, 317, 318, 322)";

      ObjectList<GeographicRegionItem> list = GeographicRegionItem.GetList(filter);

      return HtmlSelectContent.GetComboAjaxHtml(list, 0, "Id", "CompoundName", header, String.Empty, GeographicRegionItem.Unknown.Name);
    }
コード例 #14
0
    private void AppendPostalCode() {
      GeographicItemType postalCodeType = GeographicItemType.Parse(309);

      GeographicRegionItem postalCode = (GeographicRegionItem) postalCodeType.CreateInstance();
      postalCode.Name = txtSearchText.Value;
      postalCode.Save();

      if (Request.Form[cboSettlement.ClientID].Length != 0 && int.Parse(Request.Form[cboSettlement.ClientID]) > 0) {
        GeographicRegionItem settlement = GeographicRegionItem.Parse(int.Parse(Request.Form[cboSettlement.ClientID]));
        settlement.AddMember("Settlement_PostalCodes", postalCode);
      }
      GeographicRegionItem municipality = GeographicRegionItem.Parse(int.Parse(Request.Form[cboMunicipality.ClientID]));
      municipality.AddMember("Municipality_PostalCodes", postalCode);

      FillPropertyData();
      property.PostalCode = postalCode;
      property.Save();
    }
コード例 #15
0
    private string SearchSettlementsCommandHandler() {
      int municipalityId = int.Parse(GetCommandParameter("municipalityId", true));
      string name = GetCommandParameter("name", true);

      GeographicRegionItem municipality = GeographicRegionItem.Parse(municipalityId);
      ObjectList<GeographicRegionItem> list = GeographicItemValidator.SearchSettlements(municipality, name, 0.75m);

      string temp = String.Empty;
      foreach (GeographicRegionItem region in list) {
        string item = region.Id.ToString() + " " + region.Name + " " + region.ObjectTypeInfo.DisplayName;
        item += " (DL " + EmpiriaString.DamerauLevenshteinProximityFactor(region.Name, name).ToString("P2") + " - ME ";
        item += EmpiriaString.MongeElkanProximityFactor(EmpiriaString.DistanceAlgorithm.DamerauLevenshtein, region.Name, name).ToString("P2") + " - J ";
        item += EmpiriaString.JaroProximityFactor(region.Name, name).ToString("P2") + " - JW ";
        item += EmpiriaString.JaroWinklerProximityFactor(region.Name, name).ToString("P2") + ") ";

        temp += item + "|";
      }
      return temp.Trim('|');
    }
コード例 #16
0
    private void FillPropertyData() {
      property.CadastralKey = txtCadastralNumber.Value;
      if (cboPropertyType.Value.Length != 0) {
        property.PropertyType = PropertyType.Parse(int.Parse(cboPropertyType.Value));
      } else {
        property.PropertyType = PropertyType.Empty;
      }
      property.CommonName = txtPropertyCommonName.Value;
      property.Antecedent = txtAntecendent.Value;
      property.Notes = txtObservations.Value;

      if (Request.Form[cboMunicipality.ClientID].Length != 0) {
        property.Municipality = GeographicRegionItem.Parse(int.Parse(Request.Form[cboMunicipality.ClientID]));
        property.CadastralOffice = RecorderOffice.Parse(int.Parse(cboCadastralOffice.Value));
      } else {
        property.Municipality = GeographicRegionItem.Empty;
      }
      if (Request.Form[cboSettlement.ClientID].Length != 0) {
        property.Settlement = GeographicRegionItem.Parse(int.Parse(Request.Form[cboSettlement.ClientID]));
      } else {
        property.Settlement = GeographicRegionItem.Empty;
      }
      if (Request.Form[cboStreetRoad.ClientID].Length != 0) {
        property.Street = GeographicPathItem.Parse(int.Parse(Request.Form[cboStreetRoad.ClientID]));
      } else {
        property.Street = GeographicPathItem.Empty;
      }
      if (Request.Form[cboPostalCode.ClientID].Length != 0) {
        property.PostalCode = GeographicRegionItem.Parse(int.Parse(Request.Form[cboPostalCode.ClientID]));
      } else {
        property.PostalCode = GeographicRegionItem.Empty;
      }
      property.Ubication = txtUbication.Value;
      property.ExternalNumber = txtExternalNumber.Value;
      property.InternalNumber = txtInternalNumber.Value;
      property.FractionTag = txtFractionTag.Value;
      property.BatchTag = txtBatchTag.Value;
      property.BlockTag = txtBlockTag.Value;
      property.SectionTag = txtSectionTag.Value;
      property.SuperSectionTag = txtSuperSectionTag.Value;
    }
コード例 #17
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;
     }
   }
 }
コード例 #18
0
    private string GetWitnessInPositionStringArrayCommandHandler() {
      int placeId = int.Parse(GetCommandParameter("placeId", false, "-1"));
      int positionId = int.Parse(GetCommandParameter("positionId", false, "0"));

      if (positionId == 0) {
        return HtmlSelectContent.GetComboAjaxHtmlItem(String.Empty, "( Primero seleccionar el rol del certificador )");
      } else if (positionId == -2) {
        return HtmlSelectContent.GetComboAjaxHtmlItem("-2", "No consta o no se puede determinar");
      }
      if (placeId == -1) {
        return HtmlSelectContent.GetComboAjaxHtmlItem(String.Empty, "( Primero seleccionar una ciudad )");
      } else if (placeId == -2) {
        return HtmlSelectContent.GetComboAjaxHtmlItem("-2", "No consta o no se puede determinar");
      }

      GeographicRegionItem place = GeographicRegionItem.Parse(placeId);
      TypeAssociationInfo role = place.ObjectTypeInfo.GetAssociation(positionId);
      ObjectList<Person> list = place.GetPeople(role.Name);

      return HtmlSelectContent.GetComboAjaxHtml(list, 0, "Id", "FamilyFullName", "( Seleccionar al certificador del contrato )",
                                            String.Empty, "No consta o no se puede determinar");
    }
 private void FillCreditFields() {
   if (!String.IsNullOrEmpty(Request.Form[txtContractDate.Name])) {
     recordingAct.ContractDate = EmpiriaString.ToDateTime(txtContractDate.Value);
   } else {
     recordingAct.ContractDate = ExecutionServer.DateMaxValue;
   }
   recordingAct.ContractNumber = txtContractNumber.Value;
   if (!String.IsNullOrEmpty(Request.Form[cboContractPlace.Name])) {
     recordingAct.ContractPlace = GeographicRegionItem.Parse(int.Parse(Request.Form[cboContractPlace.Name]));
   } else {
     recordingAct.ContractPlace = GeographicRegionItem.Unknown;
   }
   if (txtTermPeriod.Value.Length == 0) {
     txtTermPeriod.Value = "0";
   }
   if (txtInterestRate.Value.Length == 0) {
     txtInterestRate.Value = "0.00";
   }
   recordingAct.TermPeriods = int.Parse(txtTermPeriod.Value);
   recordingAct.TermUnit = DataTypes.Unit.Parse(int.Parse(cboTermUnit.Value));
   recordingAct.InterestRate = decimal.Parse(txtInterestRate.Value);
   recordingAct.InterestRateType = InterestRateType.Parse(int.Parse(cboInterestRateType.Value));
 }
コード例 #20
0
    private Party FillOrganizationParty() {
      if (this.Party == null) {
        this.Party = OrganizationParty.Create(Ontology.ObjectTypeInfo.Parse(int.Parse(cboPartyType.Value)));
      }
      OrganizationParty org = (OrganizationParty) this.Party;

      org.FullName = txtOrgName.Value;
      org.Nicknames = txtOrgNicknames.Value;
      org.TaxIDNumber = txtOrgTaxIDNumber.Value;
      org.Notes = txtOrgRegistryText.Value;
      if (!String.IsNullOrEmpty(Request.Form[txtOrgRegistryDate.Name])) {
        org.RegistryDate = EmpiriaString.ToDateTime(txtOrgRegistryDate.Value);
      } else {
        org.RegistryDate = ExecutionServer.DateMaxValue;
      }
      if (!String.IsNullOrEmpty(Request.Form[cboOrgRegistryLocation.Name])) {
        org.RegistryLocation = GeographicRegionItem.Parse(int.Parse(Request.Form[cboOrgRegistryLocation.Name]));
      } else {
        org.RegistryLocation = GeographicRegionItem.Unknown;
      }
      org.Save();

      return org;
    }