Beispiel #1
0
        public ActionResult ReporteTicketsf(string cotizacion, string ticket)
        {
            int idc = Convert.ToInt16(cotizacion);
            int idt = Convert.ToInt16(ticket);
            var pas = db.Cotizacion.Where(w => w.IdCotizacion == idc && w.IdEstado == 7).ToList();

            if (pas.Count > 0)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ReportViewerViewModel model = new ReportViewerViewModel();

                var user   = User.Identity.GetUserName();
                var iduser = User.Identity.GetUserId();

                string content = Url.Content("~/Reportes/ASP/CRV.aspx?id=6&cotizacion=" + cotizacion + "&ticket=" + ticket);
                model.ReportPath = content;



                return(View("ReporteTicketf", model));
            }
        }
Beispiel #2
0
        //
        // GET: /Report/

        public ActionResult EmployeeListReport()
        {
            ReportViewerViewModel model = new ReportViewerViewModel();
            string content = Url.Content("~/Reports/CrystalViewer/EmployeeList.aspx");

            model.ReportPath = content;
            return(View("ReportViewer", model));
        }
Beispiel #3
0
        public ActionResult ExportReport(string filtro, int especialidad)
        {
            try
            {
                dsMedico dsMedico        = new dsMedico();
                string   conn            = ConfigurationManager.AppSettings["conexion"];
                string   strEspecialidad = "Select * from especialidad";
                string   strMedico       = "Select * from medico";
                if (!String.IsNullOrEmpty(filtro))
                {
                    strMedico += " where med_nombres like '%" + filtro + "%' or med_apellidos like '%" + filtro + "%'";
                }
                if (especialidad != 0 && !String.IsNullOrEmpty(filtro))
                {
                    strMedico += " and med_especialidad=" + especialidad;
                }
                else if (especialidad != 0 && String.IsNullOrEmpty(filtro))
                {
                    strMedico += " where med_especialidad=" + especialidad;
                }
                SqlConnection  sqlcon         = new SqlConnection(conn);
                SqlDataAdapter daEspecialidad = new SqlDataAdapter(strEspecialidad, sqlcon);
                SqlDataAdapter daMedico       = new SqlDataAdapter(strMedico, sqlcon);
                daEspecialidad.Fill(dsMedico, "especialidad");
                daMedico.Fill(dsMedico, "medico");
                Session["ReportSource"] = dsMedico;
                Session["Titulo"]       = "Médicos";

                ReportViewerViewModel model = new ReportViewerViewModel();
                string content = Url.Content("~/Reports/RptViewer.aspx");
                model.ReportPath = content;
                return(View("ReportViewer", model));


                //RptMedico rp = new RptMedico();
                //rp.Load(Path.Combine(Server.MapPath("~/Reports"), "RptMedico.rpt"));
                //rp.SetDataSource(dsMedico);
                //rp.SetParameterValue("titulo", "General de Médicos");
                //if (especialidad != 0)
                //{
                //    rp.SetParameterValue("titulo", "Médicos por Especialidad");
                //}
                //Response.Buffer = false;
                //Response.ClearContent();
                //Response.ClearHeaders();

                //Stream stream = rp.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                //stream.Seek(0, SeekOrigin.Begin);
                //return File(stream, "application/pdf", "ReporteMedicos.pdf");
            }
            catch (Exception ex)
            {
                ViewBag.mensaje = ex.Message;
                return(View("Message"));
            }
        }
Beispiel #4
0
        public ReportViewModel(ILog log, IStandardDialog standardDialog, IDispatcherSchedulerProvider scheduler,
                               BindableCollection<IViewModel> itemsCollection,
                               ReportRunnerViewModel reportRunnerViewModel,
                               ReportViewerViewModel reportViewerViewModel)
            : base(log, standardDialog, scheduler, itemsCollection)
        {
            _reportRunnerViewModel = reportRunnerViewModel;
            this.SyncViewModelActivationStates(_reportRunnerViewModel).AddDisposable(Disposables);

            _reportViewerViewModel = reportViewerViewModel;
            this.SyncViewModelActivationStates(_reportViewerViewModel).AddDisposable(Disposables);
        }
Beispiel #5
0
        public ReportViewModel(ILog log, IStandardDialog standardDialog, IDispatcherSchedulerProvider scheduler,
                               BindableCollection <IViewModel> itemsCollection,
                               ReportRunnerViewModel reportRunnerViewModel,
                               ReportViewerViewModel reportViewerViewModel)
            : base(log, standardDialog, scheduler, itemsCollection)
        {
            _reportRunnerViewModel = reportRunnerViewModel;
            this.SyncViewModelActivationStates(_reportRunnerViewModel).AddDisposable(Disposables);

            _reportViewerViewModel = reportViewerViewModel;
            this.SyncViewModelActivationStates(_reportViewerViewModel).AddDisposable(Disposables);
        }
Beispiel #6
0
        public ActionResult ReporteCostos(string fecha, bool isYear)
        {
            ReportViewerViewModel model = new ReportViewerViewModel();

            var user   = User.Identity.GetUserName();
            var iduser = User.Identity.GetUserId();

            string content = Url.Content("~/Reportes/ASP/CRV.aspx?id=2&Fecha=" + fecha + "&IsYear=" + isYear + "&user="******"Reportecostos", model));
        }
Beispiel #7
0
        public ActionResult Reporte(int id)
        {
            try
            {
                //var consulta = db.registro.Where(r => r.reg_paciente == registro.reg_paciente && r.reg_fecha == registro.reg_fecha && r.reg_estado == true);
                //if (!consulta.Any())
                //    return RedirectToAction("Message", "Home", new { mensaje = "El paciente no tiene exámenes para esta fecha" });

                Session["esp_id"] = id;
                ReportViewerViewModel model = new ReportViewerViewModel();
                string content = Url.Content("~/Reports/Viewer/ViewEspirometria.aspx");
                model.ReportPath = content;
                return(View("ReportViewer", model));
            }
            catch (Exception ex)
            {
                ViewBag.mensaje = ex.Message;
                //return View("Message");
                return(RedirectToAction("Message", "Home", new { mensaje = ex.Message }));
            }
        }
Beispiel #8
0
        public ActionResult InbondExbondRawMaterialStatus(int?BonderID, Nullable <System.DateTime> FromDate, Nullable <System.DateTime> ToDate)
        {
            ReportViewerViewModel rvvm = new ReportViewerViewModel();
            string contentPath         = Url.Content("~/Report/CrystalViewer/InBondExBondRptVw.aspx");

            rvvm.reportPath = contentPath;

            if (null != BonderID && null != FromDate && null != ToDate)
            {
                ViewBag.SearchBonderID = BonderID;
                ViewBag.SearchFromDate = FromDate;
                ViewBag.SearchToDate   = ToDate;

                Session[AppConstants.SearchBonderID] = BonderID;
                Session[AppConstants.SearchFromDate] = FromDate;
                Session[AppConstants.SearchToDate]   = ToDate;

                return(View("ReportViewerPage", rvvm));
            }

            ViewBag.BonderID = new SelectList(db.BONDERs, "BONDERSLNO", "BONDERNAME");
            return(View());


            //Session[INBOND_EXBOND_RAWMATERIAL_REPORT_DATA] = null;
            //List<InBondExBondMaterial> RawMaterialList = null;
            //if (null != BonderID && null != FromDate && null != ToDate)
            //{
            //    ViewBag.SearchBonderID = BonderID;
            //    ViewBag.SearchFromDate = FromDate;
            //    ViewBag.SearchToDate = ToDate;

            //    RawMaterialList = getInBondExBondQueryData(BonderID, FromDate, ToDate);
            //}

            //ViewBag.BonderID = new SelectList(db.BONDERs, "BONDERSLNO", "BONDERNAME");
            //Session[INBOND_EXBOND_RAWMATERIAL_REPORT_DATA] = RawMaterialList;
            //return View(RawMaterialList);
        }
Beispiel #9
0
        public ActionResult ReporteNomina(string nomina)
        {
            int idc = Convert.ToInt16(nomina);
            var pas = db.Nomina.Where(w => w.IdNomina == idc && (w.regAnulado == true || w.IdEstado == clsReferencias.EnBorrador)).ToList();

            if (pas.Count > 0)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ReportViewerViewModel model = new ReportViewerViewModel();
                var user   = User.Identity.GetUserName();
                var iduser = User.Identity.GetUserId();


                string content = Url.Content("~/Reportes/ASP/CRV.aspx?id=6&nomina=" + nomina + "&user="******"ReporteNomina", model));
            }
        }
        //private void TxtDoAction_OnTextChanged(object sender, TextChangedEventArgs e)
        //{
        //    CrvReportViewer.ViewerCore.ReportSource = ReportViewerViewModel.ReportToView;// reportDoc;
        //}

        private void ReportViewerCommon_OnUnloaded(object sender, RoutedEventArgs e)
        {
            ReportViewerViewModel.CleanUp();
        }
Beispiel #11
0
 public ReportController()
 {
     _model = new ReportViewerViewModel();
 }