public bool Insert(DataSet dataSet) { bool flag = false; using (PersistentManager persistentManager = new PersistentManager()) { SysUserDao UserDao = new SysUserDao(); UserDao.InsertEntity(dataSet); flag = true; } return(flag); }
/// <summary> /// 公共注册 2014-08-24 14:58:50 By 唐有炜 /// </summary> /// <param name="httpContext">HttpContext</param> /// <param name="userName">用户名</param> /// <param name="phone">手机号</param> /// <param name="userPassword">密码</param> /// <param name="userTname">真实姓名</param> /// <returns>ResponseMessage</returns> public ResponseMessage PublicRegister(HttpContext httpContext, string userName, string phone, string userPassword, string userTname = null) { // ResponseMessage rmsg1 = ValidateAccount("register", null, userName + "@10000", userPassword); // if (!rmsg1.Status) // { // return rmsg1; // } // ResponseMessage rmsg2 = ValidateAccount("register", null, phone, userPassword); // if (!rmsg2.Status) // { // rmsg2.Msg = "对不起该手机号已存在!"; // return rmsg2; // } // ResponseMessage rmsg = rmsg2; // if (rmsg1.Status && rmsg2.Status) // { ResponseMessage rmsg = new ResponseMessage(); try { //注册提交 var dbPassword = DESEncrypt.Encrypt(userPassword); TSysUser sysUser = new TSysUser() { CompNum = "10000", UserLname = userName, UserPassword = dbPassword, UserPhone = phone, UserTname = userTname, //存储真实姓名,便于日后升级 RoleId = 1, //默认角色 DepId = 1 //默认部门 }; if (SysUserDao.InsertEntity(sysUser)) { rmsg.Status = true; rmsg.Msg = "注册成功"; } else { rmsg.Status = false; rmsg.Msg = "注册失败"; } } catch (Exception ex) { rmsg.Status = false; rmsg.Msg = "注册失败"; LogHelper.Error("注册失败:", ex); } //注册成功 if (rmsg.Status) { //获取用户信息 var compUser = GetVCompanyUserByAccountTypeAndUserName("phone", phone); //书写SessionCookie WriteSessionCookie(httpContext, compUser, userName + "@10000", userPassword); } return(rmsg); }