Esempio n. 1
0
        public List<User> getUser_SameItem_InTransac(string ItemID)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("@ItemID", ItemID);
            string strSelect = "select DISTINCT  [UserID] from [rs].TRANSACTION_TBL where  ItemID = @ItemID;";
            SqlDataReader dr = executeReader(strSelect, parameters);

            List<User> list = new List<User>();
            while (dr.Read())
            {
                User obj = new User();
                obj.UserID = dr.GetString(dr.GetOrdinal("UserID"));
                //obj.UserName = dr.GetString(dr.GetOrdinal("UserName"));
                //obj.CategoryID = dr.GetString(dr.GetOrdinal("U_CategoryID"));
                list.Add(obj);
            }
            dr.Close();
            return list;
        }
Esempio n. 2
0
        public List<User> getUser_SameClusterID_InTransac(string UserID, string ItemID)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("@ItemID", ItemID);
            parameters.Add("@UserID", UserID);
            string strSelect = "select DISTINCT u.[UserID],u.[UserName],u.[U_CategoryID] from ( SELECT [USER_TBL].[UserID],[USER_TBL].[UserName],[USER_TBL].[U_CategoryID] FROM [RS].[USER_TBL], [RS].[PARTION_TBL] WHERE [USER_TBL].[UserID] = [PARTION_TBL].[UserID] and [ClusterID] IN (SELECT [ClusterID] FROM [RS].[PARTION_TBL] WHERE [UserID]= @UserID)) u inner join [RS].[TRANSACTION_TBL] t on u.[UserID] = t.[UserID] Where t.[ItemID] = @ItemID";
            SqlDataReader dr = executeReader(strSelect, parameters);

            List<User> list = new List<User>();
            while (dr.Read())
            {
                User obj = new User();
                obj.UserID = dr.GetString(dr.GetOrdinal("UserID"));
                obj.UserName = dr.GetString(dr.GetOrdinal("UserName"));
                obj.U_SubCategoryID = dr.GetString(dr.GetOrdinal("U_CategoryID"));
                list.Add(obj);
            }
            dr.Close();
            return list;
        }
Esempio n. 3
0
        public List<User> getTraditionalUser_UnBlocked()
        {
            //string strSelect = "SELECT DISTINCT [USER_TBL].[UserID] ,[UserName] ,[U_CategoryID] FROM [RS].[USER_TBL] WHERE [USER_TBL].[UserID] IN ( SELECT [UserID] FROM [RS].[TRANSACTION_TBL] ) and [Blocked] = 0";
            string strSelect = "SELECT DISTINCT [USER_TBL].[UserID] ,[UserName] ,[U_CategoryID] FROM [RS].[USER_TBL] WHERE [USER_TBL].[UserID] IN ( SELECT [UserID] FROM [RS].[TRANSACTION_TBL] ) ";
            SqlDataReader dr = executeReader(strSelect);

            List<User> list = new List<User>();
            while (dr.Read())
            {
                User obj = new User();
                obj.UserID = dr.GetString(dr.GetOrdinal("UserID"));
                obj.UserName = dr.GetString(dr.GetOrdinal("UserName"));
                obj.U_SubCategoryID = dr.GetString(dr.GetOrdinal("U_CategoryID"));
                list.Add(obj);
            }
            dr.Close();
            return list;
        }
Esempio n. 4
0
        public List<User> getUnBlockUsers()
        {
            //tring strSelect = "SELECT [UserID] ,[UserName] ,[U_CategoryID] ,[Blocked] ,[CreateDate] FROM [RS].[USER_TBL] Where [Blocked] = 0";
            string strSelect = "SELECT [UserID] ,[UserName] ,[U_CategoryID] ,[CreateDate] FROM [RS].[USER_TBL]";
            SqlDataReader dr = executeReader(strSelect);

            List<User> list = new List<User>();
            while (dr.Read())
            {
                User obj = new User();
                obj.UserID = dr.GetString(dr.GetOrdinal("UserID"));
                obj.UserName = dr.GetString(dr.GetOrdinal("UserName"));
                obj.U_SubCategoryID = dr.GetString(dr.GetOrdinal("U_CategoryID"));
                obj.CreateDate = dr.GetDateTime(dr.GetOrdinal("CreateDate"));
                list.Add(obj);
            }
            dr.Close();
            return list;
        }
Esempio n. 5
0
        public List<User> GetListTraditionalUsers()
        {
            List<User> list = new List<User>();
            User U = null;

            string sql = "Select DISTINCT UserID, U_SUBCATEGORYID from [RS].User_TBL";
            SqlDataReader dr = executeReader(sql);
            while (dr.Read())
            {
                U = new User();
                U.UserID = dr[0].ToString();
                U.UserName = dr[1].ToString();
                U.U_SubCategoryID = dr[2].ToString();
                list.Add(U);
            }
            return list;
        }