Exemplo n.º 1
0
 public ActionResult Delete(Manobrista manobrista)
 {
     try
     {
         Mensagem retorno = new Mensagem();
         retorno.msg = ManobristaBLL.Excluir(manobrista);
         return(RedirectToAction("Index", retorno));
     }
     catch
     {
         return(View());
     }
 }
 public ManobristaController(IOptions<Parametros> connectionString,
     Parametros parametros,
     IMapper mapper,
     IToastNotification toastNotification,
     ILogger<ManobristaController> logger,
     ManobristaBLL manobristaBLL
     )
     : base(connectionString, mapper, toastNotification)
 {
     this.parametros = parametros;
     this.logger = logger;
     this.manobristaBLL = manobristaBLL;
 }
Exemplo n.º 3
0
 public ActionResult Create(Manobrista manobrista)
 {
     try
     {
         ViewBag.Alerta = string.Empty;
         if (manobrista.cpf.Length != 14)
         {
             ViewBag.Alerta = "CPF incorreto, favor preenche-lo conforme o modelo XXX.XXX.XXX-XX!";
         }
         if (!IsCpf(manobrista.cpf))
         {
             ViewBag.Alerta = "CPF invalido, favor preenche-lo conforme o modelo XXX.XXX.XXX-XX e com uma combinacao valida!";
         }
         if (manobrista.nome.Length <= 3 || manobrista.nome.Length > 200)
         {
             ViewBag.Alerta = "O Nome deve ter no minimo 3 caracteres e no maximo de 200!";
         }
         if (manobrista.dataNasc.Length != 10)
         {
             ViewBag.Alerta = "A data deve estar no formato DD/MM/YYYY!";
         }
         if (ViewBag.Alerta == string.Empty)
         {
             Mensagem retorno = new Mensagem();
             manobrista.nome = manobrista.nome.ToUpper();
             retorno.msg     = ManobristaBLL.Inserir(manobrista);
             return(RedirectToAction("Index", retorno));
         }
         else
         {
             return(View());
         }
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 4
0
 public Manobrista ListarPorCPF(Manobrista manobrista)
 {
     return(ManobristaBLL.ListarPorCPF(manobrista));
 }
Exemplo n.º 5
0
 public IEnumerable <Manobrista> Listar(Manobrista manobrista)
 {
     return(ManobristaBLL.Listar(manobrista));
 }