Ejemplo n.º 1
0
        public string[] FindNames(string type, string term, int limit, string optionstring)
        {
            var options = TaskSearchInfo.GetOptions(optionstring);
            var q       = GetBaseResults(_dataContext, options);

            switch (type)
            {
            case "Delegate":
                return((from t in q
                        where t.Delegate2.StartsWith(term)
                        select t.Delegate2).Distinct().Take(limit).ToArray());

            case "About":
                return((from t in q
                        where t.About2.StartsWith(term)
                        select t.About2).Distinct().Take(limit).ToArray());

            case "Owner":
                return((from t in q
                        where t.Owner2.StartsWith(term)
                        select t.Owner2).Distinct().Take(limit).ToArray());

            case "Originator":
                return((from t in q
                        where t.Originator2.StartsWith(term)
                        select t.Originator2).Distinct().Take(limit).ToArray());
            }
            return(new string[0]);
        }
Ejemplo n.º 2
0
        public TaskSearchModel() : base("Date", "desc", true)
        {
            Search = new TaskSearchInfo();

            _host        = Util.Host;
            _dataContext = DbUtil.Create(_host);
            _gcm         = new GCMHelper(_host, _dataContext);
        }
Ejemplo n.º 3
0
 public TaskSearchModel()
     : base("Date", "desc", true)
 {
     Search = new TaskSearchInfo();
 }
Ejemplo n.º 4
0
 public TaskSearchModel(CMSDataContext db) : base(db, "Date", "desc", true)
 {
     Search = new TaskSearchInfo();
     _gcm   = new GCMHelper(db.Host, CurrentDatabase);
 }