Step Validation ASP.NET MVC Question to continue the process

0

Good afternoon, I have the following method, where the intention is to return a Yes or No message to the user at View :

public ObjetoResposta BeforePost(int step, string nomeUsuario, bool gravaLog)
{
  if (!gravaLog && step < 1)
  {
    return new ObjetoResposta() {Step = 1, Mensagem = "Deseja realmente continuar sem gravar log?"};
  }
  
  if (nomeUsuario.Equals("Administrador") && step < 2)
  {
    return new ObjetoResposta() {Step = 2, Mensagem = "Deseja realmente continuar sendo administrador?"};
  }
  
  Console.WriteLine("Processo completo.");
}

public class ObjetoResposta 
{
  public int Step {get; set; }
  public string Mensagem {get; set; }
}

I need to know the best way to continue the method in controller after I reply to the message with yes or no in my view . Would you run the method again by passing the step as it is already done?

    
asked by anonymous 13.12.2018 / 18:28

0 answers