public ActionResult Add_usuario(UserViewModel UserViewModel)
        {
            Users User = new Users();

            UserRepository UserRepository = new UserRepository();

            if (ModelState.IsValid)
            {
                User.Active = UserViewModel.Active;
                User.Departament = UserViewModel.Departament;
                User.Email = UserViewModel.Email;
                User.Job = UserViewModel.Job;
                User.Name = UserViewModel.Name;
                User.Password = UserViewModel.Password;
                User.Username = UserViewModel.Username;
                User.UserType = UserViewModel.UserType;
                User.RegisterDate = DateTime.Now;
                User.Token = "123";
                User.IP = "123";

                UserRepository.Add(User);

                return View("Index", UserViewModel.UserDev);
            }
                return View(UserViewModel);

        }
        public void Edit(Users UserViewModel)
        {
            Users UserDB = AccessDatabase.Users.FirstOrDefault(x => x.Id == UserViewModel.Id);

            UserDB.Active = UserViewModel.Active;
            UserDB.Departament = UserViewModel.Departament;
            UserDB.Email = UserViewModel.Email;
            UserDB.IP = UserViewModel.IP;
            UserDB.Job = UserViewModel.Job;
            UserDB.Name = UserViewModel.Name;
            UserDB.Password = UserViewModel.Password;
            UserDB.Username = UserViewModel.Username;
            UserDB.UserType = UserViewModel.UserType;

            AccessDatabase.SaveChanges();
        }
 public void Add(Users User)
 {
     AccessDatabase.Users.Add(User);
     AccessDatabase.SaveChanges();
 }