public ActionResult Create([Bind(Include = "Oid,Nome,CPF,Email,Aniversario")] Cliente cliente) { if (ModelState.IsValid) { db.Clientes.Add(cliente); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cliente)); }
public ActionResult Create([Bind(Include = "Oid,Nome,Quantidade")] TipoPeca tipopeca) { if (ModelState.IsValid) { db.TipoPeca.Add(tipopeca); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tipopeca)); }
public ActionResult Create([Bind(Include = "Oid,ValorRecebido,TipoPagamento,parcelas")] Fatura fatura) { if (ModelState.IsValid) { db.Fatura.Add(fatura); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Oid = new SelectList(db.Atendimentos, "Oid", "Codigo", fatura.Oid); return(View(fatura)); }
public ActionResult Create([Bind(Include = "Oid,Placa,Cor,Modelo,Marca,Ano,Quilometragem,ClienteOid")] Carro carro) { if (ModelState.IsValid) { db.Carros.Add(carro); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ClienteOid = new SelectList(db.Clientes, "Oid", "Nome", carro.ClienteOid); return(View(carro)); }
public ActionResult Create([Bind(Include = "Oid,Codigo,AtendimentoOid,TipoPecaOid")] Peca peca) { if (ModelState.IsValid) { db.Peca.Add(peca); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AtendimentoOid = new SelectList(db.Atendimentos, "Oid", "Codigo", peca.AtendimentoOid); ViewBag.TipoPecaOid = new SelectList(db.TipoPeca, "Oid", "Nome", peca.TipoPecaOid); return(View(peca)); }
public ActionResult Create([Bind(Include = "Oid,Codigo,DataInicio,DataFim,CarroOid")] Atendimento atendimento) { if (ModelState.IsValid) { atendimento.Codigo = Guid.NewGuid().ToString().Substring(0, 8); db.Atendimentos.Add(atendimento); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CarroOid = new SelectList(db.Carros, "Oid", "Placa", atendimento.CarroOid); ViewBag.Oid = new SelectList(db.Fatura, "Oid", "TipoPagamento", atendimento.Oid); return(View(atendimento)); }
public void Salvar() { _context.SaveChanges(); }