示例#1
0
        public PagedList <UserInfo> QueryRoletUserList(Entities.PageView view, int roleId, string qtext)
        {
            string where = " AND B.RoleID=" + roleId;
            if (string.IsNullOrEmpty(qtext))
            {
                where += " AND (A.UserUID like '%" + qtext + "%' or A.FullName like '%" + qtext + "%')";
            }
            StoredProcedure sp = StoredProcedures.SP_PAGESELECT(where, view.PageSize, view.PageIndex,
                                                                "UserInfos A INNER JOIN  RoleUserRelation B ON A.UserUID= B.UserUID",
                                                                "A.[UserUID],A.[FullName],A.[Password],A.[OrgCode],A.[OrgName],A.[IsManager],A.[IsSystem],A.[Sequence],A.[AccountState],A.[LastUpdateUserUID],A.[LastUpdateUserName],A.[LastUpdateTime]",
                                                                "A.[UserUID]", " Order By A.[Sequence]");
            var pl = new PagedList <UserInfo>();

            pl.DataList = new List <UserInfo>();
            using (IDataReader dr = base.SPExecuteDataReader(sp))
            {
                while (dr.Read())
                {
                    UserInfo u = new UserInfo();
                    u.UserUID            = dr.IsDBNull(0) ? null : dr.GetString(0);
                    u.FullName           = dr.IsDBNull(1) ? null : dr.GetString(1);
                    u.Password           = dr.IsDBNull(2) ? null : dr.GetString(2);
                    u.OrgCode            = dr.IsDBNull(3) ? null : dr.GetString(3);
                    u.OrgName            = dr.IsDBNull(4) ? null : dr.GetString(4);
                    u.IsManager          = dr.IsDBNull(5) ? false : dr.GetBoolean(5);
                    u.IsSystem           = dr.IsDBNull(6) ? false : dr.GetBoolean(6);
                    u.Sequence           = dr.GetInt32(7);
                    u.AccountState       = dr.IsDBNull(8) ? (byte)0 : dr.GetByte(8);
                    u.LastUpdateUserUID  = dr.IsDBNull(9) ? null : dr.GetString(9);
                    u.LastUpdateUserName = dr.IsDBNull(10) ? null : dr.GetString(10);
                    u.LastUpdateTime     = dr.GetDateTime(11);
                    u.IsNew = false;
                    pl.DataList.Add(u);
                }
            }
            if (view.PageIndex == 0)
            {
                pl.Total = Convert.ToInt32(sp.GetParameterValue(sp.ParamsCount - 1));
            }
            pl.PageIndex = view.PageIndex;

            return(pl);
        }
示例#2
0
        public PagedList <UserInfo> QueryOrgUserList(PageView view, string orgCode)
        {
            string where = " AND OrgCode='" + orgCode + "'";
            StoredProcedure sp = StoredProcedures.SP_PAGESELECT(where, view.PageSize, view.PageIndex
                                                                , "UserInfos", "[UserUID],[FullName],[Password],[OrgCode],[OrgName],[Sequence],[AccountState],[LastUpdateUserUID],[LastUpdateUserName],[LastUpdateTime]"
                                                                , "[UserUID]", "");
            var pl = new PagedList <UserInfo>();

            pl.DataList = new List <UserInfo>();
            using (IDataReader dr = base.SPExecuteDataReader(sp))
            {
                while (dr.Read())
                {
                    UserInfo u = new UserInfo();
                    u.UserUID            = dr.IsDBNull(0) ? null : dr.GetString(0);
                    u.FullName           = dr.IsDBNull(1) ? null : dr.GetString(1);
                    u.Password           = dr.IsDBNull(2) ? null : dr.GetString(2);
                    u.OrgCode            = dr.IsDBNull(3) ? null : dr.GetString(3);
                    u.OrgName            = dr.IsDBNull(4) ? null : dr.GetString(4);
                    u.Sequence           = dr.GetInt32(5);
                    u.AccountState       = dr.GetByte(6);
                    u.LastUpdateUserUID  = dr.IsDBNull(7) ? null : dr.GetString(7);
                    u.LastUpdateUserName = dr.IsDBNull(8) ? null : dr.GetString(8);
                    u.LastUpdateTime     = dr.IsDBNull(9) ? DateTime.MinValue : dr.GetDateTime(9);
                    u.IsNew = false;
                    pl.DataList.Add(u);
                }
            }

            if (view.PageIndex == 0)
            {
                pl.Total = Convert.ToInt32(sp.GetParameterValue(sp.ParamsCount - 1));
            }
            pl.PageIndex = view.PageIndex;

            return(pl);
        }
示例#3
0
        public void SetRolePrivilege(int roleid, string addids, string minusids, string userid, string username)
        {
            StoredProcedure sp = StoredProcedures.SP_SetRoleRolePrivilege(roleid, addids, minusids, userid, username);

            base.SPExecuteNonQuery(sp);
        }
示例#4
0
        public int AddRoleUser(int roleid, string userids, string opUserId, string opUserName)
        {
            StoredProcedure sp = StoredProcedures.SP_AddRoleUsers(roleid, userids, opUserId, opUserName);

            return(base.SPExecuteNonQuery(sp));
        }
示例#5
0
        public int DeleteRoleUser(int roleid, string userids)
        {
            StoredProcedure sp = StoredProcedures.SP_RemoveRoleUsers(roleid, userids);

            return(base.SPExecuteNonQuery(sp));
        }
示例#6
0
        public void SaveRoleInfo(RoleInfo ri)
        {
            StoredProcedure sp = StoredProcedures.SP_SaveRoleInfo(ri.RoleID, ri.RoleCode, ri.RoleName, ri.Remark, ri.ParentID.HasValue ? ri.ParentID.Value : -1, ri.IsSystem, ri.LastUpdateUserUID, ri.LastUpdateUserName);

            base.SPExecuteNonQuery(sp);
        }
示例#7
0
        public int DeleteUserInfo(string id)
        {
            StoredProcedure sp = StoredProcedures.SP_DeleteUserInfo(id);

            return(base.SPExecuteNonQuery(sp));
        }
示例#8
0
        public int DeletePrivilege(string privilegeCode)
        {
            StoredProcedure sp = StoredProcedures.SP_DeletePrivilege(privilegeCode);

            return(base.SPExecuteNonQuery(sp));
        }
示例#9
0
        public void SaveOrgInfo(Organization d)
        {
            StoredProcedure sp = StoredProcedures.SP_SaveOrgInfo(d.OrgCode, d.OrgName, d.ParentCode, d.Remark, d.OrgType, d.Sequence, d.LastUpdateUserUID, d.LastUpdateUserName);

            base.SPExecuteNonQuery(sp);
        }