/// <summary> /// 向数据库注册UserInfo,返回一个bool。 /// </summary> /// <param name="user">注册的UserInfo对象</param> /// <param name="returnMessage">返回注册信息字符串:如注册成功、失败</param> /// <returns></returns> public bool AddUserInfo(UserInfo user, out string returnMessage) { foreach (UserInfo u in userList) { if (user.Account == u.Account) { returnMessage = "对不起,该账号名已被占用!"; return(false); } } UserInfoDal uid = new UserInfoDal(); int influenceRow = uid.AddUserInfo(user); if (influenceRow > 0) { userList = new UserInfoDal().GetUserInfoList(); returnMessage = "注册成功,请返回登录"; return(true); } else { returnMessage = "数据库异常,注册失败,请稍后重试"; return(false); } }
/// <summary> /// 添加用户 /// </summary> /// <param name="userInfo"></param> /// <returns></returns> public bool AddUserInfo(UserInfo userInfo) { bool res = UserInfoDal.AddUserInfo(userInfo) > 0; return(res); }
/// <summary> /// 添加数据 /// </summary> /// <param name="userInfo"></param> /// <returns></returns> public bool AddUserInfo(UserInfo userInfo) { return(UserInfoDal.AddUserInfo(userInfo) > 0); }
public int AddUserInfo(UserInfo f) { return(userinformation.AddUserInfo(f)); }
public UserInfo AddUserInfo(UserInfo userInfo) { return(_userInfoDal.AddUserInfo(userInfo)); }
/// <summary> /// 新增用户 /// </summary> /// <param name="user">用户对象</param> /// <returns></returns> public static bool AddUserInfo(UserInfo user) { return(UserInfoDal.AddUserInfo(user) == 1); }