Example #1
0
        private DataTable QueryData(ViewQueryBase viewQuery, ref int DataCount)
        {
            int    parentId      = -1;
            string parentKeyName = string.Empty;

            if (thisGridParma.QueryParmaList.Count > 0)
            {
                parentId      = Convert.ToInt32(thisGridParma.QueryParmaList[0].Value);
                parentKeyName = thisGridParma.QueryParmaList[0].QueryField.FieldName;
            }
            if (!string.IsNullOrEmpty(parentKeyName))
            {
                var subQuery = viewQuery.GetMMSubQuery("T_User_Role", "Role_ID", parentKeyName, parentId);
                viewQuery.ViewQueryExs.Add(
                    new ViewQueryEx()
                {
                    TableAlias  = "a",
                    FieldName   = "Role_ID",
                    SubQuery    = subQuery,
                    CompareType = CompareTypeEnum.IN,
                }
                    );
            }

            DataCount = viewQuery.QueryCount();
            return(viewQuery.Query());
        }
        private DataTable QueryData(ViewQueryBase viewQuery, ref int DataCount)
        {
            //附加过来的条件,基本是级联查询
            string ParaName  = Request["ParaName"];
            string ParaValue = Request["ParaValue"];

            if (ParaName != null)
            {
                viewQuery.ViewQueryExs.Add(new ViewQueryEx()
                {
                    TableAlias = "a", FieldName = ParaName, CompareType = CompareTypeEnum.Equal, ConditionValue = ParaValue
                });
            }


            DataCount = viewQuery.QueryCount();
            return(viewQuery.Query());
        }