public Rp3.AgendaComercial.Web.BinaryResult Preview(int idOportunidad, string addressBase) { PartialViewResult data = GetDatos(idOportunidad) as PartialViewResult; OportunidadListado oportunidad = data.Model as OportunidadListado; //agenda.AgendaClientes.ForEach(p => p.SetSecuencia()); //PartialViewResult map = ExpandMap(idOportunidad) as PartialViewResult; data.ViewBag.MapWidth = 450; data.ViewBag.MapHeight = 195; data.ViewBag.UrlBase = string.Format("{0}://{1}{2}", this.Request.UrlReferrer.Scheme, this.Request.UrlReferrer.Authority, string.IsNullOrEmpty(addressBase) ? string.Empty : string.Format("/{0}", addressBase)); Rp3.AgendaComercial.Web.Areas.Oportunidad.Reports.Oportunidad report = new Areas.Oportunidad.Reports.Oportunidad(data.ViewBag, oportunidad); System.IO.MemoryStream reportStream = new System.IO.MemoryStream(); report.ExportToPdf(reportStream); reportStream.Position = 0; return(new Rp3.AgendaComercial.Web.BinaryResult { Data = reportStream.ToArray(), ContentType = "application/pdf", FileName = string.Format("Oportunidad.{0:yyyy.MM.dd}.{1:HH.mm.ss}.pdf", DateTime.Now, DateTime.Now) }); }
public Oportunidad(dynamic viewBag, OportunidadListado model) { InitializeComponent(); this.ViewBag = viewBag; this.Ubicaciones = model.Ubicaciones; this.bindingSource.DataSource = model; //this.bindingSourceCliente.DataSource = model.AgendaClientes[0]; this.DetailImagenes.Visible = model.Imagen.Count != 0; this.GroupFooterNoImagenes.Visible = !this.DetailImagenes.Visible; this.xrPictureBoxEstado.ImageUrl = string.Format("{0}/Content/AgendaComercial/img/{1}", this.ViewBag.UrlBase, model.EstadoImageUrl); //this.DetailTareas.Visible = model.AgendaClientes.Count != 0 && model.AgendaClientes[0].Tarea.Count != 0; //this.GroupFooterNoTareas.Visible = !this.DetailTareas.Visible; this.xrLineObservacion.Visible = !string.IsNullOrEmpty(model.Observacion); this.xrPictureBoxLogo.BackColor = Color.FromArgb(52, 56, 60); this.cellTitulo.BackColor = Color.FromArgb(52, 56, 60); this.cellRangoFechas.BackColor = Color.FromArgb(52, 56, 60); this.cellEmitidoEl.Text = DateTime.Now.ToString("g"); this.cellEmitidoPor.Text = Rp3.Web.Mvc.Session.LogonName; }