public ActionResult Create(CLRegras.Cliente collection) { try { model.Carregar(); collection.id = Convert.ToString(model.ContadorID()); model.Adicionar(collection); model.Salvar(); // TODO: Add insert logic here return(RedirectToAction("Create", "Contato", new { idPessoa = collection.id })); } catch { return(View()); } }
public ActionResult Edit(int id, CLRegras.Cliente collection) { try { model.Carregar(); Cliente clienteEdit = model.BuscarClientePorID(id); clienteEdit.nome = collection.nome; clienteEdit.rg = collection.rg; clienteEdit.sexo = collection.sexo; clienteEdit.dataDeNascimento = collection.dataDeNascimento; clienteEdit.dataDeExpiracao = collection.dataDeExpiracao; clienteEdit.cpf = collection.cpf; clienteEdit.grupoSanguineo = collection.grupoSanguineo; model.Salvar(); model.Carregar(); // TODO: Add update logic here return(RedirectToAction("Index")); } catch { return(View()); } }