示例#1
0
        public void AddStaff(SignUp staff)
        {
            var user = new Staff() { Firstname = staff.FirstName, Lastname = staff.LastName, In = null, Out = null, IsOut = false, Location = "Melbourne kOffice" };

            using (var db = _documentStore.OpenSession())
            {
                db.Store(user);
                db.SaveChanges();
            }
        }
示例#2
0
        public SignIn SignUp(SignUp model)
        {
            var salt = SecurityHelper.GenerateSalt();

            var passwordHash = SecurityHelper.GeneratePasswordHash(model.Password+salt);

            var securityToken = SecurityHelper.GenerateSecurityToken();

            var user = new User(model.Email, passwordHash) { Salt = salt, FirstName = model.FirstName, LastName = model.LastName, Token = securityToken };

            using (var db = _documentStore.OpenSession())
            {
                db.Store(user);
                db.SaveChanges();
            }

            return SignInUser(user);
        }
示例#3
0
 public SignIn SignUp(SignUp model)
 {
     return _accountService.SignUp(model);
 }
示例#4
0
 public void AddUser(SignUp model)
 {
     _intranetService.AddStaff(model);
 }