public ActionResult CreateTelefone(long fornecedor) { try { ViewBag.Telefones = new FornecedorTelefone().ConsultarPeloFornecedor(fornecedor); var model = new FornecedorTelefoneViewModel(); model.Fornecedor = fornecedor; return(View(model)); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "FornecedorController", "CreateTelefone"))); } }
public ActionResult CreateTelefone(FornecedorTelefoneViewModel model) { try { if (ModelState.IsValid) { var telefone = new FornecedorTelefoneModel(); telefone.Fornecedor = model.Fornecedor; telefone.Telefone = model.Telefone; var negocio = new FornecedorTelefone(); negocio.Incluir(telefone); return(RedirectToAction("Telefones", new { fornecedor = model.Fornecedor })); } return(View(model)); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "FornecedorController", "CreateTelefone"))); } }
public FornecedorTelefoneViewModel FornecedorTelefoneAtualizar(FornecedorTelefoneViewModel fornecedorTelefoneViewModel) { throw new NotImplementedException(); }