Esempio n. 1
0
 public User SaveUser(User user)
 {
     using (Database db = DbFactory.PayDbFactory.GetDatabase())
     {
         db.Save<User>(user);
         return user;
     }
 }
Esempio n. 2
0
        public BasicPrincipal(User user, string clientName)
        {
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }

            Identity = new GenericIdentity(user.Username);

            Id = user.Id;
            ClientId = user.ClientId;
            Username = user.Username;
            ClientName = clientName;
        }
Esempio n. 3
0
        public ActionResult Create(AddEditUserViewModel input)
        {
            try
            {
                User user = new User
                {
                    Username = input.Username,
                    ClientId = input.ClientId,
                    Password = input.Password
                };

                _adminRepo.SaveUser(user);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }