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

        public void ModifyDefault(TeamEN team)
        {
            try
            {
                SessionInitializeTransaction();
                TeamEN teamEN = (TeamEN)session.Load(typeof(TeamEN), team.Id);

                teamEN.Name = team.Name;


                teamEN.Country = team.Country;



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

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


            finally
            {
                SessionClose();
            }
        }
Exemplo n.º 2
0
        public TeamEN ReadOIDDefault(int id
                                     )
        {
            TeamEN teamEN = null;

            try
            {
                SessionInitializeTransaction();
                teamEN = (TeamEN)session.Get(typeof(TeamEN), id);
                SessionCommit();
            }

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


            finally
            {
                SessionClose();
            }

            return(teamEN);
        }
Exemplo n.º 3
0
        public void DeleteTeam(int id
                               )
        {
            try
            {
                SessionInitializeTransaction();
                TeamEN teamEN = (TeamEN)session.Load(typeof(TeamEN), id);
                session.Delete(teamEN);
                SessionCommit();
            }

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


            finally
            {
                SessionClose();
            }
        }
Exemplo n.º 4
0
        public int NewTeam(TeamEN team)
        {
            try
            {
                SessionInitializeTransaction();

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

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


            finally
            {
                SessionClose();
            }

            return(team.Id);
        }
Exemplo n.º 5
0
        public void ModifyTeam(int p_Team_OID, string p_name, string p_country)
        {
            TeamEN teamEN = null;

            //Initialized TeamEN
            teamEN         = new TeamEN();
            teamEN.Id      = p_Team_OID;
            teamEN.Name    = p_name;
            teamEN.Country = p_country;
            //Call to TeamCAD

            _ITeamCAD.ModifyTeam(teamEN);
        }
Exemplo n.º 6
0
        public int NewTeam(string p_name, string p_country)
        {
            TeamEN teamEN = null;
            int    oid;

            //Initialized TeamEN
            teamEN      = new TeamEN();
            teamEN.Name = p_name;

            teamEN.Country = p_country;

            //Call to TeamCAD

            oid = _ITeamCAD.NewTeam(teamEN);
            return(oid);
        }