public User Save(User user) { //const string execName = "Proc_InsertUser"; var sqlText = new StringBuilder(); User retUser; #region sql sqlText.Append(@" INSERT INTO [dbo].[User] ([UserName] ,[UserPWD] ,[Email] ,[Mobile] ,[CreateDateTime] ,[UpdateDateTime]) OUTPUT INSERTED.* VALUES( @UserName ,@UserPWD ,@Email ,@Mobile ,GETDATE() ,GETDATE()); "); #endregion using (var conn = SqlServerDB.GetSqlConnection()) { var re = conn.Query<User>(sqlText.ToString(), user); retUser = re.FirstOrDefault(); } return retUser; }
public ActionResult RegisterUser(User user) { var response = _iUserBll.Register(user); if (response.IsSuccess) { return AlertSuccessJsonResult(response, "register success"); } else { return AlertErrorJsonResult("", response.Message); } }
public void UserRegister() { var num = new Random().Next(3, 300); var user = new User() { UserName = "******" + num, UserPWD = ("1_Unit_Test2" + num).ToBase64String(), Mobile = "13678900123", Email = "*****@*****.**" }; var response = _userBll.Register(user); Assert.AreEqual(true, response != null && response.IsSuccess); }
private static void Register() { var num = Guid.NewGuid().ToString();// GenerareRandomString();// new Random().Next();// Guid.NewGuid().ToString();////DateTime.Now.ToString("ddHHmmssfffff");//new Random().Next(0, int.MaxValue);//CodeTimer.GetCurrentThreadTimes(); var user = new User() { UserName = "******" + num, UserPWD = ("1_Unit_Test" + num), Mobile = "13678900123", Email = "*****@*****.**" }; UserBll.Register(user); }
public User Update(User user) { throw new NotImplementedException(); }
public bool Delete(User user) { throw new NotImplementedException(); }