public IActionResult newUser(User user)
        {
            if (ModelState.IsValid)
            {
                user.saveUser(user);
                return(RedirectToAction("Index"));
            }

            return(View(user));
        }
        public IActionResult newUser(User user)
        {
            RequestResponse response;

            if (ModelState.IsValid)
            {
                try
                {
                    user     = user.saveUser(user);
                    response = new RequestResponse(1, user);
                }
                catch (Exception e)
                {
                    response = new RequestResponse(0, "the user wasn't added to database \n" + e.Message, null);
                }
            }
            else
            {
                response = new RequestResponse(0, "attributes not match", null);
            }

            return(Ok(response));
        }