Ejemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            DireccionEN t = obj as DireccionEN;

            if (t == null)
            {
                return(false);
            }
            if (Id.Equals(t.Id))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        public void DesvincularDireccion(int p_Restaurante_OID, int p_direccion_OID)
        {
            try
            {
                SessionInitializeTransaction();
                LePapeoGenNHibernate.EN.LePapeo.RestauranteEN restauranteEN = null;
                restauranteEN = (RestauranteEN)session.Load(typeof(RestauranteEN), p_Restaurante_OID);

                if (restauranteEN.Direccion.Id == p_direccion_OID)
                {
                    restauranteEN.Direccion = null;
                    LePapeoGenNHibernate.EN.LePapeo.DireccionEN direccionEN = (LePapeoGenNHibernate.EN.LePapeo.DireccionEN)session.Load(typeof(LePapeoGenNHibernate.EN.LePapeo.DireccionEN), p_direccion_OID);
                    direccionEN.Restaurante = null;
                }
                else
                {
                    throw new ModelException("The identifier " + p_direccion_OID + " in p_direccion_OID you are trying to unrelationer, doesn't exist in RestauranteEN");
                }

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

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


            finally
            {
                SessionClose();
            }
        }
Ejemplo n.º 3
0
 public DireccionEN(DireccionEN direccion)
 {
     this.init(Id, direccion.Cod_pos, direccion.Calle, direccion.Restaurante, direccion.Registrado, direccion.Numero, direccion.Pos_x, direccion.Pos_y, direccion.Ciudad);
 }