Esempio n. 1
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*/
        }
Esempio n. 2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            PasoEN t = obj as PasoEN;

            if (t == null)
            {
                return(false);
            }
            if (ID.Equals(t.ID))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        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*/
        }
Esempio n. 4
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();
            }
        }
        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*/
        }
Esempio n. 6
0
 public PasoEN(PasoEN paso)
 {
     this.init(ID, paso.Descripcion, paso.Gymkana, paso.Mapa);
 }