// Modify default (Update all attributes of the class) public void ModifyDefault(CorrectScoreEN correctScore) { try { SessionInitializeTransaction(); CorrectScoreEN correctScoreEN = (CorrectScoreEN)session.Load(typeof(CorrectScoreEN), correctScore.Id); correctScoreEN.HomeScore = correctScore.HomeScore; correctScoreEN.AwayScore = correctScore.AwayScore; session.Update(correctScoreEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PickadosGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PickadosGenNHibernate.Exceptions.DataLayerException("Error in CorrectScoreCAD.", ex); } finally { SessionClose(); } }
public CorrectScoreEN ReadOIDDefault(int id ) { CorrectScoreEN correctScoreEN = null; try { SessionInitializeTransaction(); correctScoreEN = (CorrectScoreEN)session.Get(typeof(CorrectScoreEN), id); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PickadosGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PickadosGenNHibernate.Exceptions.DataLayerException("Error in CorrectScoreCAD.", ex); } finally { SessionClose(); } return(correctScoreEN); }
public void DeleteCorrectScore(int id ) { try { SessionInitializeTransaction(); CorrectScoreEN correctScoreEN = (CorrectScoreEN)session.Load(typeof(CorrectScoreEN), id); session.Delete(correctScoreEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PickadosGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PickadosGenNHibernate.Exceptions.DataLayerException("Error in CorrectScoreCAD.", ex); } finally { SessionClose(); } }
public int NewCorrectScore(CorrectScoreEN correctScore) { try { SessionInitializeTransaction(); if (correctScore.Event_rel != null) { // Argumento OID y no colección. correctScore.Event_rel = (PickadosGenNHibernate.EN.Pickados.Event_EN)session.Load(typeof(PickadosGenNHibernate.EN.Pickados.Event_EN), correctScore.Event_rel.Id); correctScore.Event_rel.Pick_rel .Add(correctScore); } session.Save(correctScore); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PickadosGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PickadosGenNHibernate.Exceptions.DataLayerException("Error in CorrectScoreCAD.", ex); } finally { SessionClose(); } return(correctScore.Id); }
public int NewCorrectScore(double p_odd, string p_description, PickadosGenNHibernate.Enumerated.Pickados.PickResultEnum p_pickResult, string p_bookie, int p_event_rel, int p_homeScore, int p_awayScore) { CorrectScoreEN correctScoreEN = null; int oid; //Initialized CorrectScoreEN correctScoreEN = new CorrectScoreEN(); correctScoreEN.Odd = p_odd; correctScoreEN.Description = p_description; correctScoreEN.PickResult = p_pickResult; correctScoreEN.Bookie = p_bookie; if (p_event_rel != -1) { // El argumento p_event_rel -> Property event_rel es oid = false // Lista de oids id correctScoreEN.Event_rel = new PickadosGenNHibernate.EN.Pickados.Event_EN(); correctScoreEN.Event_rel.Id = p_event_rel; } correctScoreEN.HomeScore = p_homeScore; correctScoreEN.AwayScore = p_awayScore; //Call to CorrectScoreCAD oid = _ICorrectScoreCAD.NewCorrectScore(correctScoreEN); return(oid); }
public void ModifyCorrectScore(int p_CorrectScore_OID, double p_odd, string p_description, PickadosGenNHibernate.Enumerated.Pickados.PickResultEnum p_pickResult, string p_bookie, int p_homeScore, int p_awayScore) { CorrectScoreEN correctScoreEN = null; //Initialized CorrectScoreEN correctScoreEN = new CorrectScoreEN(); correctScoreEN.Id = p_CorrectScore_OID; correctScoreEN.Odd = p_odd; correctScoreEN.Description = p_description; correctScoreEN.PickResult = p_pickResult; correctScoreEN.Bookie = p_bookie; correctScoreEN.HomeScore = p_homeScore; correctScoreEN.AwayScore = p_awayScore; //Call to CorrectScoreCAD _ICorrectScoreCAD.ModifyCorrectScore(correctScoreEN); }