public ActionResult Save(UsuarioPublico model)
        {
            if (IsAuth)
            {
                string key1    = Util.RandomString(4);
                string key2    = Util.RandomString(4);
                string fullkey = key1 + "-" + key2;
                model.Spk           = fullkey;
                model.SpkExpiration = DateTime.Now.AddHours(24);
                if (model.Id == -1)
                {
                    model.Pwd = fullkey; //invalid pw when creating a user
                    result    = _usuarioPublicoManager.Create(model);
                }
                else
                {
                    var dbUser = _usuarioPublicoManager.Get(model.Id);
                    var usr    = (UsuarioPublico)dbUser.Result;
                    model.Pwd = usr.Pwd;

                    result = _usuarioPublicoManager.Update(model);
                }
            }
            return(Json(result, JsonRequestBehavior.DenyGet));
        }
 public ActionResult ResetPW(UsuarioPublico model)
 {
     if (model.Id > 0)
     {
         result = _usuarioPublicoManager.SetPassword(model);
     }
     return(Json(result, JsonRequestBehavior.DenyGet));
 }
        public JsonResult CreateMasterUser()
        {
            var user = new UsuarioPublico()
            {
                Nombre = "MasterUser",
                Cuenta = "*****@*****.**",
                Pwd    = "123"
            };

            var resultX = _usuarioPublicoManager.SignIn(user);

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