Exemplo n.º 1
0
 public ActionResult Save(EditUserViewModel model, string command)
 {
     if (command.ToLower() == "save")
     {
         var modelError = MembershipManagementService.InsertOrUpdateUser(model.UserData, CurrentUser, model.LGS);
         if (modelError.IsError)
         {
             prepareEditModel(model, model.UserData.Id);
             model.SetErrorOnField(ErrorIcon.Error,
                                   modelError.Message,
                                   "UserData_" + modelError.FieldName);
             return(View("MyOptions", model));
         }
         else
         {
             // Return to dashboard
             model.SetError(ErrorIcon.Information, EvolutionResources.infChangesSuccessfullySaved, null, null, null, null, true);
             return(RedirectToAction("Index", "Home"));
         }
     }
     else
     {
         // Return to dashboard
         return(RedirectToAction("Index", "Home"));
     }
 }