// GET: /Evento/ListaPorCasa/5 public ActionResult Gerar(int id, string qual = "EV", bool generate = false) { biz.OS os; string tipo = string.Empty; if (qual == "EV") { tipo = Util.TipoDocumentoOS; os = new bus.OS(id); os.GerarOS(); } else if (qual == "CP") { tipo = Util.TipoDocumentoCapa; os = new bus.OS(id); os.GerarCapa(); ViewBag.OutputFile = Server.MapPath("~/OS/Capa"); } else if (qual == "RD") { tipo = Util.TipoDocumentoDegustacao; os = new bus.OS(id); os.GerarDegustacao(); } model.Evento evento = Util.context.Evento.FirstOrDefault(e => e.Id == id); string PdfUrl = Util.GetOSFileUrl(evento, tipo); ViewBag.GeneratedUrl = PdfUrl; return(View()); }
public ActionResult Edited([Bind(Include = "EventoId,Id,Observacoes,Evento")] model.Gastronomia gastronomia) { new biz.Gastronomia().Save(gastronomia); if (gastronomia.Evento.CardapioId != 0) { biz.OS os = new biz.OS(gastronomia.EventoId); os.GerarCapa(); SessionFacade.CurrentEvento = null; } return(Redirect(Request.UrlReferrer.AbsolutePath)); }