示例#1
0
        public ResourceCategory QueryFirstCategory(Guid versionCode, ResourceStyle rStyle)
        {
            ResourceCategory category = new ResourceCategory();

            using (DataTable table = publicDbOpClass.DataTableQuary(string.Concat(new object[] { "select * from EPM_Res_Category where (VersionCode='", versionCode.ToString(), "')and(ResourceStyle=", Convert.ToInt32(rStyle), ")and(CategoryParentCode = '')" })))
            {
                if (table.Rows.Count == 1)
                {
                    category = this.DataRowToResourceCategoryInfo(table.Rows[0]);
                }
            }
            return(category);
        }
示例#2
0
        public DataTable GetResourceAssort(Guid versionCode, ResourceStyle resStyle)
        {
            string str2 = "";

            return(publicDbOpClass.DataTableQuary(str2 + "select * from EPM_Res_Category where (VersionCode='" + versionCode.ToString() + "')and(ResourceStyle=" + Convert.ToInt32(resStyle).ToString() + ")and(IsValid=1)"));
        }
示例#3
0
        public ResourceCategoryCollection QuerySecondLevelCategoryList(Guid versionCode, ResourceStyle resStyle)
        {
            ResourceCategoryCollection categorys = new ResourceCategoryCollection();
            string str = "";

            str = "select VersionCode,CategoryCode, CategoryParentCode,CategoryName, ResourceStyle, ResourceType,ChildNumber,IsValid ";
            using (DataTable table = publicDbOpClass.DataTableQuary(string.Format(str + " from EPM_Res_Category where VersionCode='{0}' and ResourceStyle = {1} and CategoryParentCode in " + "(select CategoryCode from EPM_Res_Category where (VersionCode='{0}') and (CategoryParentCode = '') and (ResourceStyle = {1}) and (IsValid = 1)) and IsValid = 1", versionCode.ToString(), Convert.ToInt32(resStyle))))
            {
                if (table.Rows.Count <= 0)
                {
                    return(categorys);
                }
                int count = table.Rows.Count;
                for (int i = 0; i < count; i++)
                {
                    categorys.Add(this.DataRowToResourceCategoryInfo(table.Rows[i]));
                }
            }
            return(categorys);
        }