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; }
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()); } }
public Manobrista ListarPorCPF(Manobrista manobrista) { return(ManobristaBLL.ListarPorCPF(manobrista)); }
public IEnumerable <Manobrista> Listar(Manobrista manobrista) { return(ManobristaBLL.Listar(manobrista)); }