Esempio n. 1
0
        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;
        }
Esempio n. 2
0
 public ActionResult RegisterUser(User user)
 {
     var response = _iUserBll.Register(user);
     if (response.IsSuccess)
     {
         return AlertSuccessJsonResult(response, "register success");
     }
     else
     {
         return AlertErrorJsonResult("", response.Message);
     }
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 public User Update(User user)
 {
     throw new NotImplementedException();
 }
Esempio n. 6
0
 public bool Delete(User user)
 {
     throw new NotImplementedException();
 }