// 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(); } }
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); }
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(); } }
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); }
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); }
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); }