Exemplo n.º 1
0
        public async Task <ActionResult> Create(User user)
        {
            try
            {
                await UsersBL.Create(user);

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return(View(user));
            }
        }
Exemplo n.º 2
0
        Create(string user, string names, string lastnames, string password, string email)
        {
            UsersDTO userDTO = new UsersDTO()
            {
                User           = user,
                UserNames      = names,
                UsersLastNames = lastnames,
                Email          = email,
                Password       = password,
                IsActive       = true
            };
            var result = userBL.Create(userDTO);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }