private PrecoServico LoadDefaultParameters() { var srv = new PrecoServico(); srv.DataAtualizacao = DateTime.Now; return(srv); }
public ActionResult DeleteConfirmed(int id) { PrecoServico precoServico = db.PrecoServico.Find(id); db.PrecoServico.Remove(precoServico); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,IdServico,DataAtualizacao,PrecoDinheiro,PrecoDebito,PrecoCredito")] PrecoServico precoServico) { if (ModelState.IsValid) { db.Entry(precoServico).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdServico = new SelectList(db.Servico, "Id", "Descricao", precoServico.IdServico); return(View(precoServico)); }
public ActionResult Create([Bind(Include = "Id,IdServico,DataAtualizacao,PrecoDinheiro,PrecoDebito,PrecoCredito")] PrecoServico precoServico) { if (ModelState.IsValid) { db.PrecoServico.Add(precoServico); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdServico = new SelectList(BuscarServicosNaoCadastrados(), "Id", "Descricao", precoServico.IdServico); return(View(precoServico)); }
// GET: PrecoServico/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PrecoServico precoServico = db.PrecoServico.Find(id); if (precoServico == null) { return(HttpNotFound()); } return(View(precoServico)); }
// GET: PrecoServico/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PrecoServico precoServico = db.PrecoServico.Find(id); if (precoServico == null) { return(HttpNotFound()); } ViewBag.IdServico = new SelectList(db.Servico, "Id", "Descricao", precoServico.IdServico); return(View(precoServico)); }