Esempio n. 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Mod_Sys_User> GetList(Hashtable ht, string order, Mod_Com_Pager pager = null)
        {
            DataSet             dataSet     = null;
            List <Mod_Sys_User> li_Sys_User = new List <Mod_Sys_User>();
            StringBuilder       strSql      = new StringBuilder();

            strSql.Append("select * ");
            strSql.Append(" FROM Sys_User ");
            strSql.Append(" Where 1=1  ");
            if (ht != null)
            {
                foreach (DictionaryEntry de in ht)
                {
                    strSql.AppendLine(de.Value.ToString());
                }
            }
            string strPageSql = string.Empty;

            if (pager != null)
            {
                Dal_Common.GetPageSql(ref strPageSql, strSql.ToString(), order, pager);
            }
            if (!string.IsNullOrEmpty(strPageSql))
            {
                dataSet = SqlEasy.ExecuteDataSet(strPageSql);
                return(ConvertToListData(dataSet));
                //return dataSet;
            }
            else
            {
                dataSet = SqlEasy.ExecuteDataSet(strSql.ToString());
                return(ConvertToListData(dataSet));
                //return dataSet;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(Hashtable ht, string order = null, Mod_Com_Pager pager = null)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select a.*,b.Name as RoleStatusName ");
            strSql.Append(" FROM Sys_Role a ");
            strSql.Append(" LEFT JOIN Sys_Role_Status b on a.RoleStatus=b.ID ");
            strSql.Append(" Where 1=1  ");
            if (ht != null)
            {
                foreach (DictionaryEntry de in ht)
                {
                    strSql.AppendLine(de.Value.ToString());
                }
            }
            string strPageSql = string.Empty;

            if (pager != null)
            {
                Dal_Common.GetPageSql(ref strPageSql, strSql.ToString(), order, pager);
            }
            if (!string.IsNullOrEmpty(strPageSql))
            {
                return(SqlEasy.ExecuteDataSet(strPageSql));
            }
            else
            {
                return(SqlEasy.ExecuteDataSet(strSql.ToString()));
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Mod_Sys_Author> GetList(Hashtable ht)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select * ");
            strSql.Append(" FROM Sys_Author ");
            strSql.Append(" Where 1=1  ");
            if (ht != null)
            {
                foreach (DictionaryEntry de in ht)
                {
                    strSql.AppendLine(de.Value.ToString());
                }
            }
            return(ConvertToListData(SqlEasy.ExecuteDataSet(strSql.ToString())));
        }
Esempio n. 4
0
        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select ");
            if (Top > 0)
            {
                strSql.Append(" top " + Top.ToString());
            }
            strSql.Append(" * ");
            strSql.Append(" FROM Sys_Btn ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            strSql.Append(" order by " + filedOrder);
            return(SqlEasy.ExecuteDataSet(strSql.ToString()));
        }
Esempio n. 5
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_Sys_Menu GetModel(int MenuId)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select MenuId, Pid, MenuName, Menu_Url, Icon, Sort  ");
            strSql.Append("  from Sys_Menu ");
            strSql.Append(" where MenuId=@MenuId");
            SqlParameter[] parameters =
            {
                new SqlParameter("@MenuId", SqlDbType.Int, 4)
            };
            parameters[0].Value = MenuId;


            Mod_Sys_Menu model = new Mod_Sys_Menu();
            DataSet      ds    = SqlEasy.ExecuteDataSet(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["MenuId"].ToString() != "")
                {
                    model.MenuId = int.Parse(ds.Tables[0].Rows[0]["MenuId"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Pid"].ToString() != "")
                {
                    model.Pid = int.Parse(ds.Tables[0].Rows[0]["Pid"].ToString());
                }
                model.MenuName = ds.Tables[0].Rows[0]["MenuName"].ToString();
                model.Menu_Url = ds.Tables[0].Rows[0]["Menu_Url"].ToString();
                model.Icon     = ds.Tables[0].Rows[0]["Icon"].ToString();
                if (ds.Tables[0].Rows[0]["Sort"].ToString() != "")
                {
                    model.Sort = int.Parse(ds.Tables[0].Rows[0]["Sort"].ToString());
                }

                return(model);
            }
            else
            {
                return(null);
            }
        }