コード例 #1
0
        public void DesvincularHorarioSemana(int p_Restaurante_OID, int p_horarioSemana_OID)
        {
            LePapeoGenNHibernate.EN.LePapeo.RestauranteEN restauranteEN = null;
            try
            {
                SessionInitializeTransaction();
                restauranteEN = (RestauranteEN)session.Load(typeof(RestauranteEN), p_Restaurante_OID);
                restauranteEN.HorarioSemana = (LePapeoGenNHibernate.EN.LePapeo.HorarioSemanaEN)session.Load(typeof(LePapeoGenNHibernate.EN.LePapeo.HorarioSemanaEN), p_horarioSemana_OID);

                restauranteEN.HorarioSemana.Restaurante.Add(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();
            }
        }
コード例 #2
0
        public void AgregarDireccion(int p_Restaurante_OID, int p_direccion_OID)
        {
            LePapeoGenNHibernate.EN.LePapeo.RestauranteEN restauranteEN = null;
            try
            {
                SessionInitializeTransaction();
                restauranteEN           = (RestauranteEN)session.Load(typeof(RestauranteEN), p_Restaurante_OID);
                restauranteEN.Direccion = (LePapeoGenNHibernate.EN.LePapeo.DireccionEN)session.Load(typeof(LePapeoGenNHibernate.EN.LePapeo.DireccionEN), p_direccion_OID);

                restauranteEN.Direccion.Restaurante = 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();
            }
        }
コード例 #3
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            RestauranteEN t = obj as RestauranteEN;

            if (t == null)
            {
                return(false);
            }
            if (Id.Equals(t.Id))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #4
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();
            }
        }
コード例 #5
0
 public RestauranteEN(RestauranteEN restaurante)
 {
     this.init(Id, restaurante.Nombre, restaurante.Fecha_apertura, restaurante.Reserva_0, restaurante.Opinion_0, restaurante.HorarioSemana, restaurante.Direccion, restaurante.TipoCocina, restaurante.Max_comen, restaurante.Current_comen, restaurante.Precio_medio, restaurante.Descripcion, restaurante.Menu, restaurante.Email, restaurante.Pass, restaurante.Notificacion, restaurante.Fecha_inscripcion);
 }