Пример #1
0
        public FileStreamResult Pdf(string id)
        {
            if (id == null)
            {
                RedirectToAction("Index", "Error");
            }

            var pdf = new Bll.PdfWrapper.Pdf();

            Bll.Instruments instruments = null;
            if (id.ToLower() == "test")
            {
                instruments = new Bll.TestUnitHelper.Mock.InstrumentsMock().GetDemoInstruments();
            }
            else
            {
                var instrument = new Bll.Instrument();
                instruments = instrument.GetInstruments(id);
            }

            if (instruments == null)
            {
                RedirectToAction("Index", "Error");
            }

            byte[] byteInfo   = pdf.Get(instruments, true);
            var    workStream = new MemoryStream();

            workStream.Write(byteInfo, 0, byteInfo.Length);
            workStream.Position = 0;

            return(new FileStreamResult(workStream, "application/pdf"));
        }
Пример #2
0
 public PlanViewModel(Bll.Instruments inst, string token) : this()
 {
     this.Token         = token;
     this.Instruments   = inst;
     this.Contact       = new SharePlan();
     this.Contact.Band  = inst.BandName;
     this.Contact.Token = token;
 }