Ejemplo n.º 1
0
        public void VincularEvento(int p_Reporte_OID, int p_evento_OID)
        {
            Fight4FitGenNHibernate.EN.Fight4Fit.ReporteEN reporteEN = null;
            try
            {
                SessionInitializeTransaction();
                reporteEN        = (ReporteEN)session.Load(typeof(ReporteEN), p_Reporte_OID);
                reporteEN.Evento = (Fight4FitGenNHibernate.EN.Fight4Fit.EventoEN)session.Load(typeof(Fight4FitGenNHibernate.EN.Fight4Fit.EventoEN), p_evento_OID);

                reporteEN.Evento.Reporte.Add(reporteEN);



                session.Update(reporteEN);
                SessionCommit();
            }

            catch (Exception ex) {
                SessionRollBack();
                if (ex is Fight4FitGenNHibernate.Exceptions.ModelException)
                {
                    throw ex;
                }
                throw new Fight4FitGenNHibernate.Exceptions.DataLayerException("Error in ReporteCAD.", ex);
            }


            finally
            {
                SessionClose();
            }
        }
Ejemplo n.º 2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            ReporteEN t = obj as ReporteEN;

            if (t == null)
            {
                return(false);
            }
            if (Id.Equals(t.Id))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
 public ReporteEN(ReporteEN reporte)
 {
     this.init(Id, reporte.Evento, reporte.Comentario, reporte.Foto, reporte.Texto, reporte.Motivo, reporte.Usuario, reporte.Tipo);
 }
Ejemplo n.º 4
0
        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*/
        }