Exemple #1
0
// Modify default (Update all attributes of the class)

        public void ModifyDefault(PromotorEN promotor)
        {
            try
            {
                SessionInitializeTransaction();
                PromotorEN promotorEN = (PromotorEN)session.Load(typeof(PromotorEN), promotor.Email);

                promotorEN.CIF = promotor.CIF;

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

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


            finally
            {
                SessionClose();
            }
        }
Exemple #2
0
        public PromotorEN ReadOIDDefault(string Email
                                         )
        {
            PromotorEN promotorEN = null;

            try
            {
                SessionInitializeTransaction();
                promotorEN = (PromotorEN)session.Get(typeof(PromotorEN), Email);
                SessionCommit();
            }

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


            finally
            {
                SessionClose();
            }

            return(promotorEN);
        }
Exemple #3
0
        public string CrearUsuarioProm(PromotorEN promotor)
        {
            try
            {
                SessionInitializeTransaction();

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

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


            finally
            {
                SessionClose();
            }

            return(promotor.Email);
        }
Exemple #4
0
        public PromotorEN ReadOID(string Email
                                  )
        {
            PromotorEN promotorEN = null;

            promotorEN = _IPromotorCAD.ReadOID(Email);
            return(promotorEN);
        }
Exemple #5
0
        public string CrearUsuarioProm(string p_Email, String p_Password, bool p_Bloqueado, string p_CIF)
        {
            PromotorEN promotorEN = null;
            string     oid;

            //Initialized PromotorEN
            promotorEN       = new PromotorEN();
            promotorEN.Email = p_Email;

            promotorEN.Password = Utils.Util.GetEncondeMD5(p_Password);

            promotorEN.Bloqueado = p_Bloqueado;

            promotorEN.CIF = p_CIF;

            //Call to PromotorCAD

            oid = _IPromotorCAD.CrearUsuarioProm(promotorEN);
            return(oid);
        }