Exemplo n.º 1
0
        /// <summary>
        /// 获取指列的DataTable结果集
        /// </summary>
        /// <param name="top">前top条记录</param>
        /// <param name="strWhere">过滤条件</param>
        /// <param name="columList">列</param>
        /// <returns></returns>
        public DataTable GetDataTable(int top, string strWhere, params string[] columList)
        {
            //StringBuilder sb = new StringBuilder();
            //sb.Append("SELECT checkItemId,HolesIndex,IsShowOnData,IsDouble FROM tHolesSetting ");
            //if (strWhere != null && strWhere.Length > 0)
            //{
            //    sb.Append(" WHERE ");
            //    sb.Append(strWhere);
            //}

            return(DataBase.GetColumnList("tHolesSetting", top, strWhere, columList));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 通过用户名设置各用户所能操作的菜单
        /// </summary>
        /// <param name="userName">用户登记名</param>
        /// <returns></returns>
        public System.Collections.Hashtable IsMenuRight()//, string assetCode
        {
            System.Collections.Hashtable htbl = new System.Collections.Hashtable();
            DataTable dtbl = DataBase.GetColumnList("tMachine", 0, "IsShow=true", "SysCode,IsShow");

            //List<NDYLib.Model.Sys_Right> list = GetModelList(string.Format("UserName='******'", userName));
            if (dtbl != null && dtbl.Rows.Count > 0)
            {
                for (int i = 0; i < dtbl.Rows.Count; i++)
                {
                    //v = Convert.ToBoolean(dtbl.Rows[i]["IsShow"]);
                    htbl.Add(dtbl.Rows[i]["SysCode"], dtbl.Rows[i]["IsShow"]);
                }
                dtbl.Dispose();
                dtbl = null;
            }
            return(htbl);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 获取指定列指定结果集结果集
 /// 作者:
 /// </summary>
 /// <param name="top">表示前N个记录,小于等于0表示"*"</param>
 /// <param name="strWhere">过滤条件组合串,输入字符串中不能包含where关键字,需要排序时在条件后加 order by</param>
 /// <param name="columns">表示1个或者多个字段字符串,多个字段之间用","隔开如: "ID,Name,Value,...."</param>
 /// <returns>返回结果集</returns>
 public DataTable GetColumnDataTable(int top, string strWhere, params string[] columns)
 {
     return(DataBase.GetColumnList("tMachine", top, strWhere, columns));
 }