Exemple #1
0
        public void BorrarUnReporte(int p_oid)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CP.Whatever_Reporte_borrarUnReporte) ENABLED START*/

            IReporteCAD reporteCAD = null;
            ReporteCEN  reporteCEN = null;



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



                // Write here your custom transaction ...

                EventoEN even = new EventoEN();
                even = reporteCAD.GetID(p_oid).Evento;
                RetoEN reten = new RetoEN();
                reten = reporteCAD.GetID(p_oid).Reto;
                GymkanaEN gymen = new GymkanaEN();
                gymen = reporteCAD.GetID(p_oid).Gymkana;

                if (even != null)
                {
                    reporteCAD.UnrelationerReporteEvento(p_oid, even.ID);
                    reporteCAD.Destroy(p_oid);
                }
                else if (reten != null)
                {
                    reporteCAD.UnrelationerReporteReto(p_oid, reten.ID);
                    reporteCAD.Destroy(p_oid);
                }
                else if (gymen != null)
                {
                    reporteCAD.UnrelationerReporteGymkana(p_oid, gymen.ID);
                    reporteCAD.Destroy(p_oid);
                }


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


            /*PROTECTED REGION END*/
        }
Exemple #2
0
        public void ReportarComentario(string p_oid, int arg1, string texto, Fight4FitGenNHibernate.Enumerated.Fight4Fit.MotivoEnum motivo)
        {
            /*PROTECTED REGION ID(Fight4FitGenNHibernate.CP.Fight4Fit_Usuario_ReportarComentario) ENABLED START*/

            IUsuarioCAD usuarioCAD = null;
            UsuarioCEN  usuarioCEN = null;

            IReporteCAD reporteCAD = null;


            try
            {
                SessionInitializeTransaction();
                usuarioCAD = new UsuarioCAD(session);
                usuarioCEN = new UsuarioCEN(usuarioCAD);

                reporteCAD = new ReporteCAD(session);
                ReporteCEN reporteCEN = new ReporteCEN(reporteCAD);
                reporteCEN.NuevoReporte(-1,   //foto
                                        arg1, //oid comentario
                                        -1,   // oid evento
                                        texto,
                                        motivo,
                                        usuarioCAD.ReadOID(p_oid).Email); //usuario

                //  reporteCAD.NuevoReporte (reporteEN);



                // Write here your custom transaction ...



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


            /*PROTECTED REGION END*/
        }
        public void BorrarReportesGymkana(int id_gym)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CP.Whatever_Reporte_BorrarReportesGymkana) 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.FiltrarReportesPorGymkana(id_gym);
                foreach (ReporteEN element in reportes)
                {
                    reporteCAD.UnrelationerReporteGymkana(element.ID, id_gym);
                    reporteCAD.Destroy(element.ID);
                }


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


            /*PROTECTED REGION END*/
        }
        public int ReportarGymkana(int id_usuario, int id_gym, string motivo)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CP.Whatever_Reporte_ReportarGymkana) ENABLED START*/

            IReporteCAD reporteCAD = null;
            ReporteCEN  reporteCEN = null;

            int result = -1;


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



                // Write here your custom transaction ...

                int id = reporteCEN.New_(motivo, id_usuario);
                reporteCAD.RelationerReporteGymkana(id, id_gym);


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


            /*PROTECTED REGION END*/
        }
Exemple #5
0
        public void BorrarReporteReto(int id_reto)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CP.Whatever_Reporte_BorrarReporteReto) ENABLED START*/

            IReporteCAD reporteCAD = null;
            ReporteCEN  reporteCEN = null;



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



                // Write here your custom transaction ...

                throw new NotImplementedException("Method BorrarReporteReto() not yet implemented.");



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


            /*PROTECTED REGION END*/
        }
Exemple #6
0
 public ReporteCEN(IReporteCAD _IReporteCAD)
 {
     this._IReporteCAD = _IReporteCAD;
 }
Exemple #7
0
 public ReporteCEN()
 {
     this._IReporteCAD = new ReporteCAD();
 }
 public ReporteCEN(IReporteCAD _IReporteCAD)
 {
     this._IReporteCAD = _IReporteCAD;
 }
 public ReporteCEN()
 {
     this._IReporteCAD = new ReporteCAD ();
 }
        public Fight4FitGenNHibernate.EN.Fight4Fit.ReporteEN NuevoReporte(string p_Texto, Fight4FitGenNHibernate.Enumerated.Fight4Fit.MotivoEnum p_Motivo, string p_usuario, int p_idRef, Fight4FitGenNHibernate.Enumerated.Fight4Fit.TipoReporteEnum p_tipo)
        {
            /*PROTECTED REGION ID(Fight4FitGenNHibernate.CP.Fight4Fit_Reporte_NuevoReporte) ENABLED START*/

            IReporteCAD reporteCAD = null;
            ReporteCEN  reporteCEN = null;

            Fight4FitGenNHibernate.EN.Fight4Fit.ReporteEN result = null;

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



                int oid;
                //Initialized ReporteEN
                ReporteEN reporteEN;
                reporteEN       = new ReporteEN();
                reporteEN.Texto = p_Texto;

                reporteEN.Motivo = p_Motivo;


                if (p_usuario != null)
                {
                    reporteEN.Usuario       = new Fight4FitGenNHibernate.EN.Fight4Fit.UsuarioEN();
                    reporteEN.Usuario.Email = p_usuario;
                }

                reporteEN.Tipo = p_tipo;



                //Call to ReporteCAD

                oid = reporteCAD.NuevoReporte(reporteEN);
                if (p_tipo == TipoReporteEnum.foto)
                {
                    reporteCEN.VincularFoto(oid, p_idRef);
                }

                else if (p_tipo == TipoReporteEnum.comentario)
                {
                    reporteCEN.VincularComentario(oid, p_idRef);
                }

                else if (p_tipo == TipoReporteEnum.evento)
                {
                    reporteCEN.VincularEvento(oid, p_idRef);
                }


                result = reporteCAD.ReadOIDDefault(oid);



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


            /*PROTECTED REGION END*/
        }
Exemple #11
0
        public void Reportar(int id_usuario, int id_gym, int id_reto, string motivo)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CP.Whatever_Reporte_Reportar) ENABLED START*/

            IReporteCAD reporteCAD = null;
            ReporteCEN  reporteCEN = null;



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



                ReporteEN  repor    = new ReporteEN();
                ReporteCAD reporcad = new ReporteCAD(session);
                AdminCAD   admincad = new AdminCAD(session);
                AdminCEN   admincen = new AdminCEN(admincad);
                GymkanaEN  gymen    = new GymkanaEN();
                GymkanaCAD gymcad   = new GymkanaCAD(session);
                RetoCAD    retocad  = new RetoCAD(session);
                RetoEN     retoen   = new RetoEN();
                UsuarioEN  usuen    = new UsuarioEN();
                UsuarioCAD usucad   = new UsuarioCAD(session);

                System.Collections.Generic.IList <AdminEN>   admin        = new System.Collections.Generic.List <AdminEN>();
                System.Collections.Generic.IList <AdminEN>   numadmins    = new System.Collections.Generic.List <AdminEN>();
                System.Collections.Generic.IList <ReporteEN> listareporte = new System.Collections.Generic.List <ReporteEN>();
                listareporte = reporcad.GetAll(0, 0);
                //int aux = 0;

                foreach (AdminEN element in admin)
                {
                    numadmins.Add(element);
                }
                admin = admincen.GetAll(0, 0);
                //aux = listareporte [listareporte.Count - 1].ID;

                repor.Admin_reporte = numadmins;
                repor.Motivo        = motivo;
                if (id_gym != -1)
                {
                    gymen = gymcad.GetID(id_gym);
                }
                else
                {
                    gymen = null;
                }
                repor.Reporte = gymen;
                if (id_reto != -1)
                {
                    retoen = retocad.GetID(id_reto);
                }
                else
                {
                    retoen = null;
                }
                repor.Reporte_reto2 = retoen;
                usuen = usucad.GetID(id_usuario);
                repor.Usuario_reporte = usuen;


                reporcad.New_(repor);


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


            /*PROTECTED REGION END*/
        }