Ejemplo n.º 1
0
        public void AnyadirPremio(int p_Premio_OID, string p_asistente_OID)
        {
            DSMGenNHibernate.EN.DSM.PremioEN premioEN = null;
            try
            {
                SessionInitializeTransaction();
                premioEN           = (PremioEN)session.Load(typeof(PremioEN), p_Premio_OID);
                premioEN.Asistente = (DSMGenNHibernate.EN.DSM.AsistenteEN)session.Load(typeof(DSMGenNHibernate.EN.DSM.AsistenteEN), p_asistente_OID);

                premioEN.Asistente.Premio.Add(premioEN);



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

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


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

            if (t == null)
            {
                return(false);
            }
            if (Id.Equals(t.Id))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
 public PremioEN(PremioEN premio)
 {
     this.init(Id, premio.Descripcion, premio.Evento, premio.Nombre, premio.Asistente, premio.Grupo);
 }