Ejemplo n.º 1
0
        public ActionResult AddDiploma(DiplomaViewModel diploma)
        {
            var user = _userService.GetCurrent(User.Identity.Name);

            foreach (var photo in diploma.Photos)
            {
                var diplomaToAdd = new Diploma
                {
                    MasterId = user.Master.MasterId
                };

                using (var binaryReader = new BinaryReader(photo.InputStream))
                {
                    diplomaToAdd.ScanDiploma = binaryReader.ReadBytes(photo.ContentLength);
                }

                _photoService.AddDiploma(diplomaToAdd);
            }

            return(RedirectToAction("UserProfile", "User"));
        }
Ejemplo n.º 2
0
        public ReportViewerWindow(DiplomaViewModel diplomaViewModel)
        {
            InitializeComponent();

            _reportViewer.ShowContextMenu = false;

            List <DiplomaViewModel> diplomaDatas = new List <DiplomaViewModel>
            {
                diplomaViewModel
            };

            ReportDataSource reportDataSource1 = new ReportDataSource();

            reportDataSource1.Name = "DataSetMain";


            _reportViewer.LocalReport.DataSources.Add(reportDataSource1);

            _reportViewer.LocalReport.ReportEmbeddedResource = "BestApp.Reports.Diploma.Diploma.rdlc";
            _reportViewer.LocalReport.DataSources[0].Value   = diplomaDatas;

            _reportViewer.RefreshReport();
        }