Ejemplo n.º 1
0
// Modify default (Update all attributes of the class)

        public void ModifyDefault(FooterEN footer)
        {
            try
            {
                SessionInitializeTransaction();
                FooterEN footerEN = (FooterEN)session.Load(typeof(FooterEN), footer.Id_footer);

                footerEN.Enlace = footer.Enlace;


                footerEN.Descripcion = footer.Descripcion;

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

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


            finally
            {
                SessionClose();
            }
        }
Ejemplo n.º 2
0
        public FooterEN ReadOIDDefault(int id_footer
                                       )
        {
            FooterEN footerEN = null;

            try
            {
                SessionInitializeTransaction();
                footerEN = (FooterEN)session.Get(typeof(FooterEN), id_footer);
                SessionCommit();
            }

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


            finally
            {
                SessionClose();
            }

            return(footerEN);
        }
Ejemplo n.º 3
0
        public void Destroy(int id_footer
                            )
        {
            try
            {
                SessionInitializeTransaction();
                FooterEN footerEN = (FooterEN)session.Load(typeof(FooterEN), id_footer);
                session.Delete(footerEN);
                SessionCommit();
            }

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


            finally
            {
                SessionClose();
            }
        }
Ejemplo n.º 4
0
        public int New_(FooterEN footer)
        {
            try
            {
                SessionInitializeTransaction();

                session.Save(footer);
                SessionCommit();
            }

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


            finally
            {
                SessionClose();
            }

            return(footer.Id_footer);
        }
Ejemplo n.º 5
0
        public void Modify(int p_Footer_OID, string p_enlace, string p_descripcion)
        {
            FooterEN footerEN = null;

            //Initialized FooterEN
            footerEN             = new FooterEN();
            footerEN.Id_footer   = p_Footer_OID;
            footerEN.Enlace      = p_enlace;
            footerEN.Descripcion = p_descripcion;
            //Call to FooterCAD

            _IFooterCAD.Modify(footerEN);
        }
Ejemplo n.º 6
0
        public int New_(string p_enlace, string p_descripcion)
        {
            FooterEN footerEN = null;
            int      oid;

            //Initialized FooterEN
            footerEN        = new FooterEN();
            footerEN.Enlace = p_enlace;

            footerEN.Descripcion = p_descripcion;

            //Call to FooterCAD

            oid = _IFooterCAD.New_(footerEN);
            return(oid);
        }