예제 #1
0
        public bool SignIn(string name, string pass)
        {
            var model = UserInfoAccess.GetDataBy(name);

            if (model != null && model.password == pass)
            {
                model.state = Global.State.ONLINE;
                UserInfoAccess.Update(model);
                return(true);
            }
            return(false);
        }
예제 #2
0
        public bool updateUserInfo(string username, string password, byte state, bool sex, string nickName, string birthday)
        {
            UserInfo model = new UserInfo()
            {
                username = username,
                password = password,
                state    = state,
                sex      = sex,
                nickName = nickName,
                birthday = DateTime.Parse(birthday)
            };

            return(UserInfoAccess.Update(model));
        }
예제 #3
0
        public string SignUp(string name, string pass, bool sex, string nickName)
        {
            if (UserInfoAccess.GetDataBy(name) != null)
            {
                return(Global.ERROR_EXISTED_USER);
            }
            UserInfo model = new UserInfo()
            {
                username = name,
                password = pass,
                sex      = sex,
                nickName = nickName
            };

            if (UserInfoAccess.AddData(model))
            {
                return(Global.OPT_SUCCEED);
            }
            else
            {
                return(Global.ERROR_UNEXCEPT);
            }
        }
예제 #4
0
 public int DeleteAll(string tabelName)
 {
     return(UserInfoAccess.DeleteAll());
 }
예제 #5
0
 public UserInfo GetUser(string name)
 {
     return(UserInfoAccess.GetDataBy(name));
 }