Пример #1
0
        public IEnumerable <R_ContributionMonetary> GetContributionMonetarys()
        {
            IEnumerable <R_ContributionMonetary> results = null;

            var sql = PetaPoco.Sql.Builder
                      .Select("*")
                      .From("R_ContributionMonetary")
                      .Where("IsDeleted = 0")

            ;

            results = R_ContributionMonetary.Query(sql);

            return(results);
        }
Пример #2
0
        public IEnumerable <R_ContributionMonetary> GetContributionMonetaryListAdvancedSearch(
            int?nucleoId
            , int?responsiblePersonId
            , int?documentId
            , int?partnerId
            , System.DateTime?contributionDateFrom
            , System.DateTime?contributionDateTo
            , double?amount
            , string contactPerson
            , string ibanOrigin
            , string bicSwiftOrigin
            , string ibanDestination
            , string bicSwiftDestination
            , string fiscalNumber
            , int?contributionChannelId
            )
        {
            IEnumerable <R_ContributionMonetary> results = null;

            var sql = PetaPoco.Sql.Builder
                      .Select("*")
                      .From("R_ContributionMonetary")
                      .Where("IsDeleted = 0"
                             + (nucleoId != null ? " and NucleoId like '%" + nucleoId + "%'" : "")
                             + (responsiblePersonId != null ? " and ResponsiblePersonId like '%" + responsiblePersonId + "%'" : "")
                             + (documentId != null ? " and DocumentId like '%" + documentId + "%'" : "")
                             + (partnerId != null ? " and PartnerId like '%" + partnerId + "%'" : "")
                             + (contributionDateFrom != null ? " and ContributionDate >= '" + contributionDateFrom.Value.ToShortDateString() + "'" : "")
                             + (contributionDateTo != null ? " and ContributionDate <= '" + contributionDateTo.Value.ToShortDateString() + "'" : "")
                             + (amount != null ? " and Amount like '%" + amount + "%'" : "")
                             + (contactPerson != null ? " and ContactPerson like '%" + contactPerson + "%'" : "")
                             + (ibanOrigin != null ? " and IbanOrigin like '%" + ibanOrigin + "%'" : "")
                             + (bicSwiftOrigin != null ? " and BicSwiftOrigin like '%" + bicSwiftOrigin + "%'" : "")
                             + (ibanDestination != null ? " and IbanDestination like '%" + ibanDestination + "%'" : "")
                             + (bicSwiftDestination != null ? " and BicSwiftDestination like '%" + bicSwiftDestination + "%'" : "")
                             + (fiscalNumber != null ? " and FiscalNumber like '%" + fiscalNumber + "%'" : "")
                             + (contributionChannelId != null ? " and ContributionChannelId like '%" + contributionChannelId + "%'" : "")
                             )
            ;

            results = R_ContributionMonetary.Query(sql);

            return(results);
        }