Exemple #1
0
        public static List <Set10ExchangeLoyClient> SearchClientInfo(QueryForFindClientInfo query)
        {
            var queryDictionary = new Dictionary <string, object>();

            if (query.IsLastNameEnabled && !string.IsNullOrEmpty(query.LastName))
            {
                queryDictionary.Add(nameof(query.LastName), query.LastName);
            }
            if (query.IsFirstNameEnabled && !string.IsNullOrEmpty(query.FirstName))
            {
                queryDictionary.Add(nameof(query.FirstName), query.FirstName);
            }
            if (query.IsMiddleNameEnabled && !string.IsNullOrEmpty(query.MiddleName))
            {
                queryDictionary.Add(nameof(query.MiddleName), query.MiddleName);
            }
            if (query.IsMobilePhoneEnabled && !string.IsNullOrEmpty(query.FirstName))
            {
                queryDictionary.Add(nameof(query.MobilePhone), query.MobilePhone);
            }
            if (query.IsDateBirthEnabled && query.BirthDate != null)
            {
                queryDictionary.Add(nameof(query.BirthDate), query.BirthDate);
            }
            if (query.IsCategoryIdEnabled)
            {
                queryDictionary.Add(nameof(query.CategoryId), query.CategoryId);
            }
            var dbConnection = new SqlConnection(ConnectionSettings.ConMsStr);

            return(dbConnection.Query <Set10ExchangeLoyClient>(BaseScriptsMs.SearchClientInfoScript(queryDictionary))
                   .ToList());
        }
Exemple #2
0
        public static List <Set10ExchangeLoyClient> SearchClientInfo(string numCard)
        {
            var card12       = numCard.Length == 8 ? numCard.ToDec() : numCard;
            var dbConnection = new SqlConnection(ConnectionSettings.ConMsStr);

            return(dbConnection.Query <Set10ExchangeLoyClient>(BaseScriptsMs.SearchClientInfoScript(), new { card12 })
                   .ToList());
        }