Exemplo n.º 1
0
 public IList <Org> GetChildOrgs(string orgId, OrgType type)
 {
     return((IList <Org>)CacheHelper.Get("GetChildOrgs_" + orgId + "_" + type.ToString(), () =>
     {
         return Config.Logic.OrgService.GetChildOrgs(orgId, type);
     }));
 }
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);
            }
        }
Exemplo n.º 3
0
        public static IList <Org> GetChildOrgs(string orgId, OrgType type)
        {
            var sqlHelper = SQLHelper.CreateSqlHelper(ConnEnum.Base);
            var sql       = string.Format("select * from S_A_Org where ParentID = '{0}' and Type='{1}' and IsDeleted = '0'", orgId, type.ToString());
            var dt        = sqlHelper.ExecuteDataTable(sql);

            var orgs = new List <Org>();

            foreach (DataRow row in dt.Rows)
            {
                var org = new Org();

                org.ID        = row["ID"].ToString();
                org.Code      = row["Code"].ToString();
                org.Name      = row["Name"].ToString();
                org.ParentID  = row["ParentID"].ToString();
                org.FullID    = row["FullID"].ToString();
                org.SortIndex = row["SortIndex"] is DBNull?0:float.Parse(row["SortIndex"].ToString());

                orgs.Add(org);
            }
            return(orgs);
        }