public List <ClubCloud_Land> GetLandenBySearch(string prefixText, int count, string contextKey, ClubCloud_Setting _settings = null)
        {
            if (_settings != null)
            {
                ValidateSettings(ref _settings);
            }

            List <string> landen = new List <string>();

            using (new SPMonitoredScope("Landen GetLandenBySearch"))
            {
                try
                {
                    bool enabled = false;             //beheerModel.Database.SqlQuery<bool>("SELECT (CAST((FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))AS BIT))").FirstOrDefault();

                    List <ClubCloud_Land> entities = null;

                    if (enabled)
                    {
                        var fts = BeheerFullTextInterceptor.Fts(prefixText);


                        entities = beheerModel.ClubCloud_Landen.Where(e => e.Naam.Contains(fts) || e.Code.Contains(fts)).ToList();
                    }
                    else
                    {
                        entities = beheerModel.Database.SqlQuery <ClubCloud_Land>("SELECT * FROM ClubCloud_Land WHERE  Naam LIKE '%" + prefixText + "%' OR  Code LIKE '%" + prefixText + "%'").ToList();
                    }

                    if (entities != null && entities.Count > 0)
                    {
                        return(entities);
                    }
                }
                catch (Exception ex)
                {
                    Logger.WriteLog(Logger.Category.Unexpected, ex.Source, ex.Message);
                }
            }

            return(new List <ClubCloud_Land>());
        }
Example #2
0
        public List <ClubCloud_Address> GetAddressenBySearch(string prefixText, int count, string contextKey, ClubCloud_Setting _settings = null)
        {
            if (_settings != null)
            {
                ValidateSettings(ref _settings);
            }

            List <string> addressen = new List <string>();

            using (new SPMonitoredScope("Addressen GetAddressenBySearch"))
            {
                try
                {
                    bool enabled = false;             //beheerModel.Database.SqlQuery<bool>("SELECT (CAST((FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))AS BIT))").FirstOrDefault();

                    List <ClubCloud_Address> entities = null;

                    if (enabled)
                    {
                        var fts = BeheerFullTextInterceptor.Fts(prefixText);


                        entities = beheerModel.ClubCloud_Addressen.Where(e => e.Stad.Contains(fts) || e.Provincie.Contains(fts) || e.Postcode.Contains(fts) || e.Straat.Contains(fts) || e.Nummer.Contains(fts) || e.Fax.Contains(fts) || e.Toevoeging.Contains(fts) || e.Postbus.Contains(fts) || e.TelefoonPrimair.Contains(fts) || e.TelefoonSecundair.Contains(fts) || e.TelefoonTertiair.Contains(fts) || e.Gemeente.Contains(fts)).ToList();
                    }
                    else
                    {
                        entities = beheerModel.Database.SqlQuery <ClubCloud_Address>("SELECT * FROM ClubCloud_Address WHERE  Stad LIKE '%" + prefixText + "%' OR  Provincie LIKE '%" + prefixText + "%' OR  Postcode LIKE '%" + prefixText + "%' OR  Straat LIKE '%" + prefixText + "%' OR  Nummer LIKE '%" + prefixText + "%' OR  Fax LIKE '%" + prefixText + "%' OR  Toevoeging LIKE '%" + prefixText + "%' OR  Postbus LIKE '%" + prefixText + "%' OR  TelefoonPrimair LIKE '%" + prefixText + "%' OR  TelefoonSecundair LIKE '%" + prefixText + "%' OR  TelefoonTertiair LIKE '%" + prefixText + "%' OR  Gemeente LIKE '%" + prefixText + "%'").ToList();
                    }

                    if (entities != null && entities.Count > 0)
                    {
                        return(entities);
                    }
                }
                catch (Exception ex)
                {
                    Logger.WriteLog(Logger.Category.Unexpected, ex.Source, ex.Message);
                }
            }

            return(new List <ClubCloud_Address>());
        }
Example #3
0
        public List <ClubCloud_Afhang> GetAfhangenBySearch(string prefixText, int count, string contextKey, ClubCloud_Setting _settings = null)
        {
            if (_settings != null)
            {
                ValidateSettings(ref _settings);
            }

            List <string> afhangen = new List <string>();

            using (new SPMonitoredScope("Afhangen GetAfhangenBySearch"))
            {
                try
                {
                    bool enabled = false;             //beheerModel.Database.SqlQuery<bool>("SELECT (CAST((FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))AS BIT))").FirstOrDefault();

                    List <ClubCloud_Afhang> entities = null;

                    if (enabled)
                    {
                        var fts = BeheerFullTextInterceptor.Fts(prefixText);
                    }
                    else
                    {
                    }

                    if (entities != null && entities.Count > 0)
                    {
                        return(entities);
                    }
                }
                catch (Exception ex)
                {
                    Logger.WriteLog(Logger.Category.Unexpected, ex.Source, ex.Message);
                }
            }

            return(new List <ClubCloud_Afhang>());
        }