Example #1
0
        public static Guid ContactTypeQuery(int id)
        {
            var c = DbUtil.Db.ScratchPadCondition();

            c.Reset();
            var comp   = CompareType.Equal;
            var clause = c.AddNewClause(QueryType.RecentContactType, comp, "1,True");

            clause.Days = 10000;
            var cvc = new CodeValueModel();
            var q   = from v in cvc.ContactTypeList()
                      where v.Id == id
                      select v.IdValue;

            clause.CodeIdValue = q.Single();
            c.Save(DbUtil.Db);
            return(c.Id);
        }
Example #2
0
        public Guid ConvertToQuery()
        {
            var c = DbUtil.Db.ScratchPadCondition();

            c.Reset();
            var clause = c.AddNewClause(QueryType.MadeContactTypeAsOf, CompareType.Equal, "1,True");

            clause.Program   = SearchParameters.Ministry.Value;
            clause.StartDate = SearchParameters.StartDate ?? DateTime.Parse("1/1/2000");
            clause.EndDate   = SearchParameters.EndDate ?? DateTime.Today;
            var cvc = new CodeValueModel();
            var q   = from v in cvc.ContactTypeList()
                      where v.Id == SearchParameters.ContactType.Value.ToInt()
                      select v.IdValue;
            var idvalue = q.Single();

            clause.CodeIdValue = idvalue;
            c.Save(DbUtil.Db);
            return(c.Id);
        }