public IActionResult Delete(int id) { using (var data = new ProcedimentoData()) data.Delete(id); return(RedirectToAction("Index")); }
public string SalvarProcedimento(out bool salvo) { string msg; Procedimento.Produtos = ListaDeProdutosAdd; NormalizaDataTime(); if (NomeValido() == false) { msg = "Nome do procedimento invalido!"; salvo = false; return(msg); } if (Procedimento.Id == 0) { msg = ProcedimentoData.CadastroDeNovoProcedimento(Procedimento); salvo = true; } else { msg = ProcedimentoData.AlterarProcedimento(Procedimento); salvo = true; } return(msg); }
public IActionResult Create() { using (var data = new ProcedimentoData()) { return(View()); } }
public IActionResult Index() { using (var data = new ProcedimentoData()) { return(View(data.Read())); } }
public ProcedimentoViewModel(int id) { Procedimento = ProcedimentoData.PegarProcedimento(id); ListaDeProdutosAdd = new ObservableCollection <Produto>(Procedimento.Produtos); NomeDaTela = "> Editar Procedimento"; CarregarHoraAgendada(); }
public IActionResult Create(Procedimento e) { if (!ModelState.IsValid) { return(View(e)); } using (var data = new ProcedimentoData()) data.Create(e); return(RedirectToAction("Index")); }
public IActionResult Update(int id, Procedimento e) { e.Id = id; if (!ModelState.IsValid) { return(View(e)); } using (var data = new ProcedimentoData()) data.Update(e); return(RedirectToAction("Index")); }
public IActionResult Create() { using (var data = new AnimalData()) { ViewBag.Animal = data.Read(); } using (var data = new VeterinarioData()) { ViewBag.Veterinario = data.Read(); } using (var data = new ProcedimentoData()) { ViewBag.Procedimento = data.Read(); } using (var data = new ConsultaData()) { return(View()); } }
public IActionResult Update(int id) { using (var data = new ProcedimentoData()) return(View(data.Read(id))); }