Пример #1
0
        public void RelationerMapaEvento(int p_Mapa_OID, int p_evento_OID)
        {
            WhateverGenNHibernate.EN.Whatever.MapaEN mapaEN = null;
            try
            {
                SessionInitializeTransaction();
                mapaEN        = (MapaEN)session.Load(typeof(MapaEN), p_Mapa_OID);
                mapaEN.Evento = (WhateverGenNHibernate.EN.Whatever.EventoEN)session.Load(typeof(WhateverGenNHibernate.EN.Whatever.EventoEN), p_evento_OID);

                mapaEN.Evento.Mapa = mapaEN;



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

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


            finally
            {
                SessionClose();
            }
        }
Пример #2
0
        public void ModificarPaso(WhateverGenNHibernate.EN.Whatever.PasoEN paso, WhateverGenNHibernate.EN.Whatever.MapaEN mapa)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CEN.Whatever_Paso_modificarPaso) ENABLED START*/

            PasoCAD pas = new PasoCAD();
            MapaCAD map = new MapaCAD();

            pas.Modify(paso);
            map.Modify(mapa);
            /*PROTECTED REGION END*/
        }
        public void ModificarEvento(WhateverGenNHibernate.EN.Whatever.MapaEN mapa, WhateverGenNHibernate.EN.Whatever.EventoEN evento)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CEN.Whatever_Evento_modificarEvento) ENABLED START*/

            EventoCAD eve = new EventoCAD();
            MapaCAD   map = new MapaCAD();

            eve.Modify(evento);
            map.Modify(mapa);
            /*PROTECTED REGION END*/
        }
        public void ModificarEvento(WhateverGenNHibernate.EN.Whatever.MapaEN mapa, WhateverGenNHibernate.EN.Whatever.EventoEN evento)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CP.Whatever_Evento_modificarEvento) ENABLED START*/

            IEventoCAD eventoCAD = null;
            EventoCEN  eventoCEN = null;



            try
            {
                SessionInitializeTransaction();
                eventoCAD = new EventoCAD(session);
                eventoCEN = new  EventoCEN(eventoCAD);

                MapaCAD map = new MapaCAD(session);

                MapaEN mapen = evento.Mapa;
                mapen.Latitud  = mapa.Latitud;
                mapen.Longitud = mapa.Longitud;
                mapen.Zoom     = mapa.Zoom;

                eventoCAD.Modify(evento);
                map.Modify(mapen);


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


            /*PROTECTED REGION END*/
        }
Пример #5
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            MapaEN t = obj as MapaEN;

            if (t == null)
            {
                return(false);
            }
            if (Id.Equals(t.Id))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #6
0
        public void EliminarMapa(int p_Evento_OID, int p_mapa_OID)
        {
            try
            {
                SessionInitializeTransaction();
                WhateverGenNHibernate.EN.Whatever.EventoEN eventoEN = null;
                eventoEN = (EventoEN)session.Load(typeof(EventoEN), p_Evento_OID);

                if (eventoEN.Mapa.Id == p_mapa_OID)
                {
                    eventoEN.Mapa = null;
                    WhateverGenNHibernate.EN.Whatever.MapaEN mapaEN = (WhateverGenNHibernate.EN.Whatever.MapaEN)session.Load(typeof(WhateverGenNHibernate.EN.Whatever.MapaEN), p_mapa_OID);
                    mapaEN.Evento = null;
                }
                else
                {
                    throw new ModelException("The identifier " + p_mapa_OID + " in p_mapa_OID you are trying to unrelationer, doesn't exist in EventoEN");
                }

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

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


            finally
            {
                SessionClose();
            }
        }
Пример #7
0
        public void AnadirPaso(WhateverGenNHibernate.EN.Whatever.PasoEN paso, WhateverGenNHibernate.EN.Whatever.MapaEN mapa, WhateverGenNHibernate.EN.Whatever.GymkanaEN gym)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CP.Whatever_Gymkana_anadirPaso) ENABLED START*/

            IGymkanaCAD gymkanaCAD = null;
            GymkanaCEN  gymkanaCEN = null;



            try
            {
                SessionInitializeTransaction();
                gymkanaCAD = new GymkanaCAD(session);
                gymkanaCEN = new  GymkanaCEN(gymkanaCAD);


                PasoCAD paso2 = new PasoCAD(session);
                MapaCP  mapa2 = new MapaCP(session);
                paso.Gymkana = gym;
                int id_paso = paso2.New_(paso);
                mapa2.CrearMapaParaPaso(id_paso, mapa.Latitud, mapa.Longitud, mapa.Zoom);
                gym.NumPasos = gym.NumPasos + 1;

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


            /*PROTECTED REGION END*/
        }
Пример #8
0
        public void UnrelationerMapaPaso(int p_Mapa_OID, int p_paso_OID)
        {
            try
            {
                SessionInitializeTransaction();
                WhateverGenNHibernate.EN.Whatever.MapaEN mapaEN = null;
                mapaEN = (MapaEN)session.Load(typeof(MapaEN), p_Mapa_OID);

                if (mapaEN.Paso.ID == p_paso_OID)
                {
                    mapaEN.Paso = null;
                    WhateverGenNHibernate.EN.Whatever.PasoEN pasoEN = (WhateverGenNHibernate.EN.Whatever.PasoEN)session.Load(typeof(WhateverGenNHibernate.EN.Whatever.PasoEN), p_paso_OID);
                    pasoEN.Mapa = null;
                }
                else
                {
                    throw new ModelException("The identifier " + p_paso_OID + " in p_paso_OID you are trying to unrelationer, doesn't exist in MapaEN");
                }

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

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


            finally
            {
                SessionClose();
            }
        }
Пример #9
0
        public void ModificarPaso(WhateverGenNHibernate.EN.Whatever.PasoEN paso, WhateverGenNHibernate.EN.Whatever.MapaEN mapa)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CP.Whatever_Paso_modificarPaso) ENABLED START*/

            IPasoCAD pasoCAD = null;
            PasoCEN  pasoCEN = null;



            try
            {
                SessionInitializeTransaction();
                pasoCAD = new PasoCAD(session);
                pasoCEN = new  PasoCEN(pasoCAD);


                MapaCAD map = new MapaCAD(session);


                pasoCAD.Modify(paso);
                map.Modify(mapa);

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


            /*PROTECTED REGION END*/
        }
Пример #10
0
 public MapaEN(MapaEN mapa)
 {
     this.init(Id, mapa.Evento, mapa.Paso, mapa.Latitud, mapa.Longitud, mapa.Zoom);
 }
Пример #11
0
        public void ModificarGymkana(WhateverGenNHibernate.EN.Whatever.GymkanaEN gym, WhateverGenNHibernate.EN.Whatever.MapaEN mapa)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CEN.Whatever_Gymkana_modificarGymkana) ENABLED START*/

            GymkanaCAD gymk = new GymkanaCAD();
            MapaCAD    map  = new MapaCAD();

            gymk.Modify(gym);
            map.Modify(mapa);

            /*PROTECTED REGION END*/
        }