Ejemplo n.º 1
0
        public DataTable showNewsPer(string id)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select * from news where newsid=@id ");
            SqlParameter[] param =
            {
                SQLDbHelper.GetParameter("@id", SqlDbType.NVarChar, 30, "id", id)
            };
            DataTable table = SQLDbHelper.ExecuteDt(sb.ToString(), param);

            return(table);
        }
Ejemplo n.º 2
0
        public DataTable SelectVoteByID(MVote objvote)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select * from tb_vote where ID=@ID");
            SqlParameter[] param =
            {
                SQLDbHelper.GetParameter("@ID", SqlDbType.Int, 4, "ID", objvote.ID)
            };
            DataTable dt = SQLDbHelper.ExecuteDt(sb.ToString(), param);

            return(dt);
        }
Ejemplo n.º 3
0
        public DataTable SocialStyle(string author)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select * from stylesocial where author=@aut order by styleid desc ");
            SqlParameter[] param =
            {
                SQLDbHelper.GetParameter("@aut", SqlDbType.NVarChar, 30, "id", author)
            };
            DataTable table = SQLDbHelper.ExecuteDt(sb.ToString(), param);

            return(table);
        }
Ejemplo n.º 4
0
        public DataTable userSocial(string social)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select * from userlogin where social = @mem ");
            SqlParameter[] param =
            {
                SQLDbHelper.GetParameter("@mem", SqlDbType.NVarChar, 30, "id", social)
            };
            DataTable table = SQLDbHelper.ExecuteDt(sb.ToString(), param);

            return(table);
        }
Ejemplo n.º 5
0
        public DataTable SelectSysUserByUserName(MSysUser objSysUser)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select * from tb_sysUser where userName=@UserName");
            SqlParameter[] param =
            {
                SQLDbHelper.GetParameter("@UserName", SqlDbType.VarChar, 20, "userName", objSysUser.UserName)
            };
            DataTable dt = SQLDbHelper.ExecuteDt(sb.ToString(), param);

            return(dt);
        }
Ejemplo n.º 6
0
        public DataTable SelectAllFilesByExamineAndAccepter(MFile objfiles)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select * from tb_file where examine=@Examine and fileAccepter=@FileAccepter order by fileTime desc");
            SqlParameter[] param =
            {
                SQLDbHelper.GetParameter("@Examine",      SqlDbType.VarChar, 10, "examine",      objfiles.Examine),
                SQLDbHelper.GetParameter("@FileAccepter", SqlDbType.VarChar, 20, "fileAccepter", objfiles.FileAccepter)
            };
            DataTable dt = SQLDbHelper.ExecuteDt(sb.ToString(), param);

            return(dt);
        }
Ejemplo n.º 7
0
        public DataTable SelectSysUserByUserNameAndUserPwd(MSysUser objSysUser)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select top 1 * from tb_sysUser where userName=@UserName and userPwd=@UserPwd and IsSystemManager=@IsSysManager");
            SqlParameter[] param =
            {
                SQLDbHelper.GetParameter("@UserName",     SqlDbType.VarChar,                20, "userName", objSysUser.UserName),
                SQLDbHelper.GetParameter("@UserPwd",      SqlDbType.VarChar,                50, "userPwd",  objSysUser.UserPwd),
                SQLDbHelper.GetParameter("@IsSysManager", SqlDbType.Bit,     "IsSystemManager", objSysUser.IsSystemManager)
            };
            DataTable dt = SQLDbHelper.ExecuteDt(sb.ToString(), param);

            return(dt);
        }
Ejemplo n.º 8
0
        public bool isManagerTwo(string name)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select * from association where manager=@social");
            SqlParameter[] param =
            {
                SQLDbHelper.GetParameter("@social", SqlDbType.NVarChar, 30, "username", name)
            };
            DataTable table = SQLDbHelper.ExecuteDt(sb.ToString(), param);

            if (table.Rows.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 9
0
        //注册 函数
        public bool InserUser(string username, string pwd, string sex, string phone, string mail)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("SELECT * FROM userlogin  WHERE id =@username ");

            SqlParameter[] param =
            {
                SQLDbHelper.GetParameter("@username", SqlDbType.NVarChar, 30, "username", username)
            };
            DataTable table = SQLDbHelper.ExecuteDt(sb.ToString(), param);

            if (table.Rows.Count > 0)
            {
                return(false);
            }
            else
            {
                return(InsertUsers(username, pwd, sex, phone, mail));
            }
        }
Ejemplo n.º 10
0
        //登录
        public bool validUser(string username, string password)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("SELECT * FROM userlogin WHERE ID =@username and userpwd =@password");
            SqlParameter[] param =
            {
                SQLDbHelper.GetParameter("@username", SqlDbType.NVarChar, 30, "username", username),
                SQLDbHelper.GetParameter("@password", SqlDbType.VarChar,  20, "userpwd",  password)
            };
            DataTable table = SQLDbHelper.ExecuteDt(sb.ToString(), param);

            if (table.Rows.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 11
0
        public bool InsertSocial(string[] array)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("SELECT * FROM association  WHERE socname =@name ");

            SqlParameter[] param =
            {
                SQLDbHelper.GetParameter("@name", SqlDbType.NVarChar, 30, "username", array[0])
            };
            DataTable table = SQLDbHelper.ExecuteDt(sb.ToString(), param);

            if (table.Rows.Count > 0)
            {
                return(false);
            }
            else
            {
                InsertSocial2(array);
                StringBuilder sb2 = new StringBuilder();
                sb2.Append("SELECT * FROM association  WHERE socname =@name ");

                SqlParameter[] param2 =
                {
                    SQLDbHelper.GetParameter("@name", SqlDbType.NVarChar, 30, "username", array[0])
                };
                DataTable table2  = SQLDbHelper.ExecuteDt(sb.ToString(), param2);
                string    assocID = "0";
                if (table2.Rows.Count > 0)
                {
                    assocID = table2.Rows[0]["social"].ToString();
                }
                signOut(array[1], assocID);
                return(true);
            }
        }
Ejemplo n.º 12
0
 public DataTable getBooks()
 {
     return(SQLDbHelper.ExecuteDt("select * from Books order by bookID desc"));
 }
Ejemplo n.º 13
0
 public DataTable getTopBooksOrderByBought()
 {
     return(SQLDbHelper.ExecuteDt("select top 13 * from books order by bookBought desc"));
 }
Ejemplo n.º 14
0
 public DataTable getTopBooksOrderByID()
 {
     return(SQLDbHelper.ExecuteDt("select top 8 * from books order by bookID desc"));
 }