Beispiel #1
0
        public void GetFlowTree(string ParentID)
        {
            NSeparete = ParentID.Equals("0") ? "" : "|-";

            string    sqlstr = string.Format("SELECT ROW_NUMBER() OVER (ORDER BY PARENTID) AS ROWNUM,('{0}'+WorkName) AS WorkName,WorkCode,CASE WHEN State=1 THEN '正常' ELSE '未启用' END AS STATE,ModifyDate,ModifyUser,WorkFlowID  FROM Meter_WorkFlow WHERE ParentID='{1}'", NSeparete, ParentID);
            DataTable dt     = new DataTable();

            dt = new SqlServerHelper().GetDateTableBySql(sqlstr);
            if (_dtFlowTree == null)
            {
                _dtFlowTree = dt.Clone();
            }
            if (DataTableHelper.IsExistRows(dt))
            {
                foreach (DataRow dr in dt.Rows)
                {
                    if (ParentID.Equals("0"))
                    {
                        NSeparete = "";
                    }
                    _dtFlowTree.Rows.Add(dr.ItemArray);
                    GetFlowTree(dr["WorkFlowID"].ToString());
                }
            }
        }