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

        public void ModifyDefault(PlayerEN player)
        {
            try
            {
                SessionInitializeTransaction();
                PlayerEN playerEN = (PlayerEN)session.Load(typeof(PlayerEN), player.Id);



                playerEN.Name = player.Name;


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

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


            finally
            {
                SessionClose();
            }
        }
示例#2
0
        public PlayerEN ReadOIDDefault(int id
                                       )
        {
            PlayerEN playerEN = null;

            try
            {
                SessionInitializeTransaction();
                playerEN = (PlayerEN)session.Get(typeof(PlayerEN), id);
                SessionCommit();
            }

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


            finally
            {
                SessionClose();
            }

            return(playerEN);
        }
示例#3
0
        public void Destroy(int id
                            )
        {
            try
            {
                SessionInitializeTransaction();
                PlayerEN playerEN = (PlayerEN)session.Load(typeof(PlayerEN), id);
                session.Delete(playerEN);
                SessionCommit();
            }

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


            finally
            {
                SessionClose();
            }
        }
示例#4
0
        public int New_(PlayerEN player)
        {
            try
            {
                SessionInitializeTransaction();

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

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


            finally
            {
                SessionClose();
            }

            return(player.Id);
        }
示例#5
0
        public void Modify(int p_Player_OID, string p_name)
        {
            PlayerEN playerEN = null;

            //Initialized PlayerEN
            playerEN      = new PlayerEN();
            playerEN.Id   = p_Player_OID;
            playerEN.Name = p_name;
            //Call to PlayerCAD

            _IPlayerCAD.Modify(playerEN);
        }
示例#6
0
        public int New_(string p_name)
        {
            PlayerEN playerEN = null;
            int      oid;

            //Initialized PlayerEN
            playerEN      = new PlayerEN();
            playerEN.Name = p_name;

            //Call to PlayerCAD

            oid = _IPlayerCAD.New_(playerEN);
            return(oid);
        }