Exemplo n.º 1
0
        public string ConvertToSearch()
        {
            var cc = DbUtil.Db.ScratchPadCondition();

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

            if (Name.HasValue())
            {
                c.OrgName = Name;
            }
            if (ProgramId != 0)
            {
                c.Program = ProgramId.ToString();
            }
            if (DivisionId != 0)
            {
                c.Division = DivisionId.ToString();
            }
            if (StatusId != 0)
            {
                c.OrgStatus = StatusId.ToString();
            }
            if (TypeId != 0)
            {
                c.OrgType2 = TypeId ?? 0;
            }
            if (CampusId != 0)
            {
                c.Campus = CampusId.ToString();
            }
            if (ScheduleId != 0)
            {
                c.Schedule = ScheduleId.ToString();
            }
            if (OnlineReg != 0)
            {
                c.OnlineReg = OnlineReg.ToString();
            }

            cc.Save(DbUtil.Db);
            return("/Query/" + cc.Id);
        }
Exemplo n.º 2
0
        private void WriteAttributes(XmlWriter w, bool newGuids = false)
        {
            if (newGuids)
            {
                w.WriteAttributeString("Id", Guid.NewGuid().ToString());
            }
            else
            {
                w.WriteAttributeString("Id", Id.ToString());
            }

            w.WriteAttributeString("Order", Order.ToString());
            w.WriteAttributeString("Field", ConditionName);
            w.WriteAttributeString("Comparison", Comparison);
            if (Description.HasValue())
            {
                w.WriteAttributeString("Description", Description);
            }
            if (PreviousName.HasValue())
            {
                w.WriteAttributeString("PreviousName", Description);
            }
            if (TextValue.HasValue())
            {
                w.WriteAttributeString("TextValue", TextValue);
            }
            if (DateValue.HasValue)
            {
                w.WriteAttributeString("DateValue", DateValue.ToString());
            }
            if (CodeIdValue.HasValue())
            {
                w.WriteAttributeString("CodeIdValue", CodeIdValue);
            }
            if (StartDate.HasValue)
            {
                w.WriteAttributeString("StartDate", StartDate.ToString());
            }
            if (EndDate.HasValue)
            {
                w.WriteAttributeString("EndDate", EndDate.ToString());
            }
            if (Program > 0)
            {
                w.WriteAttributeString("Program", Program.ToString());
            }
            if (Division > 0)
            {
                w.WriteAttributeString("Division", Division.ToString());
            }
            if (Organization > 0)
            {
                w.WriteAttributeString("Organization", Organization.ToString());
            }
            if (OrgType > 0)
            {
                w.WriteAttributeString("OrgType", OrgType.ToString());
            }
            if (Days > 0)
            {
                w.WriteAttributeString("Days", Days.ToString());
            }
            if (Quarters.HasValue())
            {
                w.WriteAttributeString("Quarters", Quarters);
            }
            if (Tags.HasValue())
            {
                w.WriteAttributeString("Tags", Tags);
            }
            if (Schedule != 0)
            {
                w.WriteAttributeString("Schedule", Schedule.ToString());
            }
            if (Campus > 0)
            {
                w.WriteAttributeString("Campus", Campus.ToString());
            }
            if (ConditionName != "FamilyHasChildrenAged")
            {
                Age = null;
            }
            if (Age.HasValue)
            {
                w.WriteAttributeString("Age", Age.ToString());
            }
            if (SavedQuery.HasValue())
            {
                w.WriteAttributeString("SavedQueryIdDesc", SavedQuery);
            }
            if (OnlineReg.HasValue)
            {
                w.WriteAttributeString("OnlineReg", OnlineReg.ToString());
            }
            if (OrgStatus.HasValue)
            {
                w.WriteAttributeString("OrgStatus", OrgStatus.ToString());
            }
            if (OrgType2.HasValue)
            {
                w.WriteAttributeString("OrgType2", OrgType2.ToString());
            }
            if (OrgName.HasValue())
            {
                w.WriteAttributeString("OrgName", OrgName);
            }
        }