Пример #1
0
        public bool Add(out string message)
        {
            try
            {
                if (UserInfoDA.FindAll(string.Format("where [LoginName]='{0}'", LoginName)).Count > 0)
                {
                    message = "登陆帐号已经存在!";
                    return(false);
                }

                m_UserInfoDA.Edition = CurrentUser.Instance.User.Edition;
                m_UserInfoDA.Insert();
                m_UserInfoDA.Save();

                message = "添加用户成功!";

                return(true);
            }
            catch (Exception exception)
            {
                Loger.Instance.WriteErrorLog(exception.Message);
                message = "添加用户失败!";
                return(false);
            }
        }
Пример #2
0
        public static List <UserInfo> GetList(string where)
        {
            List <UserInfo> userInfoList = new List <UserInfo>();

            foreach (UserInfoDA userDA in UserInfoDA.FindAll(where))
            {
                UserInfo userInfo = new UserInfo(userDA);

                userInfoList.Add(userInfo);
            }

            userInfoList.Sort();

            return(userInfoList);
        }
Пример #3
0
        public bool Delete()
        {
            try
            {
                ClearRoleModule();

                foreach (UserInfoDA user in UserInfoDA.FindAll(string.Format("where [Role]={0}", ID)))
                {
                    user.Role = 0;
                    user.Update();
                    user.Save();
                }

                m_RoleDA.Delete();
                m_RoleDA.Save();
                return(true);
            }
            catch (Exception exception)
            {
                Loger.Instance.WriteErrorLog(exception.Message);
                return(false);
            }
        }