コード例 #1
0
        /// <summary>
        /// 查询所有数据并返回数据集
        /// </summary>
        public static DataTable GetTbuserDT(string strWhere)
        {
            string sql = "select * from [Tbuser]";

            sql = (strWhere.Length > 0) ? sql += " where " + strWhere : sql;
            DataTable dt = DBM.getTable(sql);

            return(dt);
        }
コード例 #2
0
        /// <summary>
        /// 查询所有数据并返回数据集
        /// </summary>
        public static DataTable GetTbsusheTop(int i, string strWhere)
        {
            string sql = "select top " + i + "  [id],[ssname],'~/Upload/'+[pic] as pic  from [Tbsushe]";

            sql  = (strWhere.Length > 0) ? sql += " where " + strWhere : sql;
            sql += " order by id desc ";
            DataTable dt = DBM.getTable(sql);

            return(dt);
        }
コード例 #3
0
        /// <summary>
        /// 查询所有数据并返回数据集
        /// </summary>
        public static List <AdminInfo> GetAdmin(string strWhere)
        {
            string sql = "select * from [Admin]";

            sql = (strWhere.Length > 0) ? sql += " where " + strWhere : sql;
            DataTable        dt   = DBM.getTable(sql);
            List <AdminInfo> list = new List <AdminInfo>();

            foreach (DataRow dr in dt.Rows)
            {
                AdminInfo model = new AdminInfo();
                model.Id   = int.Parse(dr["Id"].ToString());
                model.Name = dr["Name"].ToString();
                model.Pass = dr["Pass"].ToString();
                list.Add(model);
            }
            return(list);
        }
コード例 #4
0
        /// <summary>
        /// 查询所有数据并返回数据集
        /// </summary>
        public static List <TbsusheInfo> GetTbsushe(string strWhere)
        {
            string sql = "select * from [Tbsushe]";

            sql = (strWhere.Length > 0) ? sql += " where " + strWhere : sql;
            DataTable          dt   = DBM.getTable(sql);
            List <TbsusheInfo> list = new List <TbsusheInfo>();

            foreach (DataRow dr in dt.Rows)
            {
                TbsusheInfo model = new TbsusheInfo();
                model.Id     = int.Parse(dr["Id"].ToString());
                model.Ssname = dr["Ssname"].ToString();
                model.Remark = dr["Remark"].ToString();
                model.Pic    = "Upload/" + dr["Pic"].ToString();
                list.Add(model);
            }
            return(list);
        }
コード例 #5
0
        /// <summary>
        /// 查询所有数据并返回数据集
        /// </summary>
        public static List <TbruzhuInfo> GetTbruzhu(string strWhere)
        {
            string sql = "select * from [Tbruzhu]";

            sql = (strWhere.Length > 0) ? sql += " where " + strWhere : sql;
            DataTable          dt   = DBM.getTable(sql);
            List <TbruzhuInfo> list = new List <TbruzhuInfo>();

            foreach (DataRow dr in dt.Rows)
            {
                TbruzhuInfo model = new TbruzhuInfo();
                model.Id        = int.Parse(dr["Id"].ToString());
                model.Chuangid  = int.Parse(dr["Chuangid"].ToString());
                model.Userid    = int.Parse(dr["Userid"].ToString());
                model.Ruzhudate = dr["Ruzhudate"].ToString();
                model.Tuchudate = dr["Tuchudate"].ToString();
                model.State     = int.Parse(dr["State"].ToString());
                list.Add(model);
            }
            return(list);
        }
コード例 #6
0
        /// <summary>
        /// 查询所有数据并返回数据集
        /// </summary>
        public static List <TbuserInfo> GetTbuser(string strWhere)
        {
            string sql = "select * from [Tbuser]";

            sql = (strWhere.Length > 0) ? sql += " where " + strWhere : sql;
            DataTable         dt   = DBM.getTable(sql);
            List <TbuserInfo> list = new List <TbuserInfo>();

            foreach (DataRow dr in dt.Rows)
            {
                TbuserInfo model = new TbuserInfo();
                model.Id      = int.Parse(dr["Id"].ToString());
                model.Name    = dr["Name"].ToString();
                model.Pwd     = dr["Pwd"].ToString();
                model.Sex     = dr["Sex"].ToString();
                model.Phone   = dr["Phone"].ToString();
                model.Address = dr["Address"].ToString();
                model.Email   = dr["Email"].ToString();
                model.Remark  = dr["Remark"].ToString();
                model.Uname   = dr["Uname"].ToString();
                list.Add(model);
            }
            return(list);
        }