public ActionResult AddRecipient(RecipientAddModel model)
        {
            //if (ModelState.IsValid)
            //{
                try
                {
                    new RecipientAddHandler().Handle(Current.User,model);

                }
                catch (ValidationException e)
                {
                    ModelState.AddModelError(e.Key, e.Message);
                }
            //}

            //if (!ModelState.IsValid)
            //    return this.View();

            return RedirectToAction("Index", "MyAccount");
        }
 public void Handle(User owner, RecipientAddModel form)
 {
     //TODO: No se puede agregar como beneficiario a uno mismo
     var user = this.Find(form.Email);
     if (user == null)
     {
         user = User.CreateDataheir(form.FirstName, form.LastName, null, null, form.Email, null, null, null, null, 0, 0, null, 0, System.DateTime.Now, 1, 0, null, false, false, false, true, false);
         Save(user);
         AddRecipientToOwner(owner.Id, user.Id);
         SendInvitation(owner.FullName(), user, "");
     }
     else
     {
         //user.AddRole(UserRoles.Dataheir);
         user.FirstName = form.FirstName;
         user.LastName = form.LastName;
         Update(user);
         //AddRecipientToOwner(owner.Id, user.Id);
         //TODO: Tambien enviar email indicando que ha sido agregado como testigo
     }
 }