Esempio n. 1
0
        public CacaEN ReadOIDDefault(string NIF
                                     )
        {
            CacaEN cacaEN = null;

            try
            {
                SessionInitializeTransaction();
                cacaEN = (CacaEN)session.Get(typeof(CacaEN), NIF);
                SessionCommit();
            }

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


            finally
            {
                SessionClose();
            }

            return(cacaEN);
        }
Esempio n. 2
0
// Modify default (Update all attributes of the class)

        public void ModifyDefault(CacaEN caca)
        {
            try
            {
                SessionInitializeTransaction();
                CacaEN cacaEN = (CacaEN)session.Load(typeof(CacaEN), caca.NIF);

                cacaEN.Nombre = caca.Nombre;


                cacaEN.FNacimiento = caca.FNacimiento;


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

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


            finally
            {
                SessionClose();
            }
        }
Esempio n. 3
0
        public string Crear(CacaEN caca)
        {
            try
            {
                SessionInitializeTransaction();

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

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


            finally
            {
                SessionClose();
            }

            return(caca.NIF);
        }
Esempio n. 4
0
        public string Crear(string p_NIF, string p_nombre, Nullable <DateTime> p_fNacimiento)
        {
            CacaEN cacaEN = null;
            string oid;

            //Initialized CacaEN
            cacaEN     = new CacaEN();
            cacaEN.NIF = p_NIF;

            cacaEN.Nombre = p_nombre;

            cacaEN.FNacimiento = p_fNacimiento;

            //Call to CacaCAD

            oid = _ICacaCAD.Crear(cacaEN);
            return(oid);
        }