Пример #1
0
        public ActionResult IndexEvento(int id)
        {
            SessionInitialize();
            ReporteCAD cad = new ReporteCAD(session);
            var        aux = cad.FiltrarReportesPorEvento(id);

            SessionClose();

            return(View(aux));
        }
Пример #2
0
        public void BorrarReportesEvento(int id_evento)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CP.Whatever_Reporte_BorrarReportesEvento) ENABLED START*/

            IReporteCAD reporteCAD = null;
            ReporteCEN  reporteCEN = null;



            try
            {
                SessionInitializeTransaction();
                reporteCAD = new ReporteCAD(session);
                reporteCEN = new  ReporteCEN(reporteCAD);



                // Write here your custom transaction ...
                System.Collections.Generic.IList <ReporteEN> reportes = new System.Collections.Generic.List <ReporteEN>();
                reportes = reporteCAD.FiltrarReportesPorEvento(id_evento);
                foreach (ReporteEN element in reportes)
                {
                    reporteCAD.UnrelationerReporteEvento(element.ID, id_evento);
                    reporteCAD.Destroy(element.ID);
                }


                SessionCommit();
            }
            catch (Exception ex)
            {
                SessionRollBack();
                throw ex;
            }
            finally
            {
                SessionClose();
            }


            /*PROTECTED REGION END*/
        }