Esempio n. 1
0
        public Hashtable CreateSession(Object username)
        {
            using (XinJishu.Data.SQLServer.DataAccess conn = new Data.SQLServer.DataAccess(connectionStringName))
            {
                using (var cmd = conn.GetCommand())
                {
                    List<RoleModel> roles = new List<RoleModel>();

                    cmd.CommandText = "[xju].[Session_Create]";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;

                    cmd.Parameters.Clear();
                    cmd.Parameters.AddWithValue("@username", username);

                    return conn.ExecuteHash(cmd).FirstOrDefault();
                }
            }
        }
Esempio n. 2
0
        public IList<Hashtable> ListRolesForUser(Object userId)
        {
            using (XinJishu.Data.SQLServer.DataAccess conn = new Data.SQLServer.DataAccess(connectionStringName))
            {
                using (var cmd = conn.GetCommand())
                {
                    List<RoleModel> roles = new List<RoleModel>();

                    cmd.CommandText = "[xju].[Roles_ListForUserId]";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;

                    cmd.Parameters.Clear();
                    cmd.Parameters.AddWithValue("@userId", userId);

                    return conn.ExecuteHash(cmd);
                }
            }
        }
Esempio n. 3
0
        public IList<Hashtable> ListSessions()
        {
            using (XinJishu.Data.SQLServer.DataAccess conn = new Data.SQLServer.DataAccess(connectionStringName))
            {
                using (var cmd = conn.GetCommand())
                {
                    List<RoleModel> roles = new List<RoleModel>();

                    cmd.CommandText = "[xju].[Session_List]";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;

                    return conn.ExecuteHash(cmd);
                }
            }
        }
Esempio n. 4
0
        public Hashtable GetUserByEmail(String email)
        {
            using (XinJishu.Data.SQLServer.DataAccess conn = new Data.SQLServer.DataAccess(connectionStringName))
            {
                using (var cmd = conn.GetCommand())
                {
                    List<RoleModel> roles = new List<RoleModel>();

                    cmd.CommandText = "[xju].[User_GetByEmail]";
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;

                    cmd.Parameters.Clear();
                    cmd.Parameters.AddWithValue("@email", email);

                    return conn.ExecuteHash(cmd).FirstOrDefault();
                }
            }
        }