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