void HackSecurity()
        {
            var any = RavenSession.Query<User>().Any();
            if (any) return;

            var command = new UserCreateCommand
                          {
                              Email = "*****@*****.**",
                              UserName = AccountController.Administrator,
                              Password = "******",
                              CommandCompanyId = AccountController.AdministratorCompany,
                              CommandByUser = "******",
                              CommandWhen = DateTime.UtcNow
                          };

            var admin = new User();
            admin.Update(command);

            RavenSession.Advanced.UseOptimisticConcurrency = true;
            RavenSession.Store(admin);
            RavenSession.Store(UniqueUser.FromUser(admin));
            RavenSession.SaveChanges();
        }
        public ActionResult Register(RegisterModel model)
        {
            if (ModelState.IsValid)
            {
                var command = new UserCreateCommand
                {
                    Email = model.Email,
                    UserName = model.UserName,
                    Password = model.Password,
                    CommandCompanyId = model.CommandCompanyId,
                    CommandByUser = model.CommandByUser,
                    CommandWhen = model.CommandWhen
                };

                var user = new User();
                user.Update(command);

                RavenSession.Advanced.UseOptimisticConcurrency = true;
                RavenSession.Store(user);
                RavenSession.Store(UniqueUser.FromUser(user));
                RavenSession.SaveChanges();
                return RedirectToAction("Register");
            }

            // If we got this far, something failed, redisplay form
            return View(model);
        }