Пример #1
0
        private PrecoServico LoadDefaultParameters()
        {
            var srv = new PrecoServico();

            srv.DataAtualizacao = DateTime.Now;
            return(srv);
        }
Пример #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            PrecoServico precoServico = db.PrecoServico.Find(id);

            db.PrecoServico.Remove(precoServico);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #3
0
 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));
 }
Пример #4
0
        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));
        }
Пример #5
0
        // 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));
        }
Пример #6
0
        // 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));
        }