public DataTable SelectALL(Boolean StateIsTrue = true)
        {
            String state = StateIsTrue ? " AND AStatus=1" : "";
            String sql   = "SELECT * FROM ActionInfo WHERE 1=1 " + state;

            return(DataBaseOpen.Query(sql));
        }
Example #2
0
        /// <summary>
        /// 查询RoteUser额外一个票数统计的 RoteInfoCount
        /// </summary>
        /// <param name="AID">ActionID</param>
        /// <returns></returns>
        public DataTable SelectRoteUsersAndAllRoteInfoCountOrderByDesc(int AID)
        {
            String sql = "SELECT RU.*,COUNT(RI.RID) AS 'RoteInfoCount' FROM RoteUser AS RU  INNER JOIN RoteInfo AS RI ON RU.RUID=RI.RUID WHERE RU.AID=@AID GROUP BY RU.RUName,RU.RUID,RU.AID,RU.RUSex,RU.RUAge,RU.RUDetail,RU.RUImGUrl ORDER BY COUNT(RI.RID) DESC";

            return(DataBaseOpen.Query(sql, new SqlParameter[] {
                new SqlParameter("@AID", AID),
            }));
        }
        public DataTable SelectByStat(Boolean Stat)
        {
            String sql = "SELECT * FROM ActionInfo WHERE AStatus=@Stat";

            return(DataBaseOpen.Query(sql, new SqlParameter[] {
                new SqlParameter("@Stat", Stat)
            }));
        }
        public DataTable SelectByBeginTimeAndEndTime(String BeginTime, String EndTime)
        {
            String sql = "SELECT * FROM ActionInfo WHERE ABeginTime<=@ABeginTime AND AEndTime>=@AEndTime ";

            return(DataBaseOpen.Query(sql, new SqlParameter[] {
                new SqlParameter("@ABeginTime", BeginTime),
                new SqlParameter("@AEndTime", EndTime),
            }));
        }
Example #5
0
        public DataTable LoginByUserCodePasswordReturnModel(String UserCode, String Password)
        {
            String sql = "SELECT * FROM Users WHERE UCode=@UserCode AND uPwd=@Password";

            return(DataBaseOpen.Query(sql, new SqlParameter[] {
                new SqlParameter("@UserCode", UserCode),
                new SqlParameter("@Password", Password),
            }));
        }
Example #6
0
        /// <summary>
        /// 查找指定页数的 产于用户信息 并且包含了被投票的数量
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="Page"></param>
        /// <param name="AID"></param>
        /// <returns></returns>
        public DataTable SelectRoteInfoByPageAndAID(int PageSize, int Page, int AID)
        {
            String sql = "SELECT * FROM SelectRoteInfoByPageAndAID(@PageSize,@Page,@AID)";

            return(DataBaseOpen.Query(sql, new SqlParameter[] {
                new SqlParameter("@PageSize", PageSize),
                new SqlParameter("@Page", Page),
                new SqlParameter("@AID", AID),
            }));
        }
Example #7
0
        public DataTable SelectByActionID(int ID)
        {
            String sql = "SELECT * FROM  RoteUser WHERE AID=" + ID;

            return(DataBaseOpen.Query(sql));
        }
Example #8
0
        public DataTable SelectALL()
        {
            String sql = "SELECT * FROM  RoteUser";

            return(DataBaseOpen.Query(sql));
        }
Example #9
0
        public DataTable SelectByID(int ID)
        {
            String sql = "SELECT * FROM  RoteInfo WHERE IRD=" + ID;

            return(DataBaseOpen.Query(sql));
        }
Example #10
0
        /// <summary>
        /// 获取到的值分别是 RID  RUID	RUName	UID	UName	RIP
        /// </summary>
        /// <param name="AID"></param>
        /// <returns></returns>
        public DataTable SelectRoteInfoByAID(int AID)
        {
            String sql = "SELECT RI.RID,RI.RUID,RU.RUName,U.UID,U.UName,RI.RIP FROM RoteInfo AS RI INNER JOIN RoteUser AS RU ON RI.RUID=RU.RUID INNER JOIN Users AS U ON U.UID=RI.UID WHERE RU.AID=" + AID;

            return(DataBaseOpen.Query(sql));
        }
Example #11
0
        public DataTable SelectByID(int ID)
        {
            String sql = "SELECT * FROM  Users WHERE UID=" + ID;

            return(DataBaseOpen.Query(sql));
        }