//Sin e: GetByID //Con e: TipsterEN public TipsterEN GetByID(int id ) { TipsterEN tipsterEN = null; try { SessionInitializeTransaction(); tipsterEN = (TipsterEN)session.Get(typeof(TipsterEN), id); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PickadosGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PickadosGenNHibernate.Exceptions.DataLayerException("Error in TipsterCAD.", ex); } finally { SessionClose(); } return(tipsterEN); }
// Modify default (Update all attributes of the class) public void ModifyDefault(TipsterEN tipster) { try { SessionInitializeTransaction(); TipsterEN tipsterEN = (TipsterEN)session.Load(typeof(TipsterEN), tipster.Id); tipsterEN.Premium = tipster.Premium; tipsterEN.Subscription_fee = tipster.Subscription_fee; session.Update(tipsterEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PickadosGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PickadosGenNHibernate.Exceptions.DataLayerException("Error in TipsterCAD.", ex); } finally { SessionClose(); } }
public void DeleteTipster(int id ) { try { SessionInitializeTransaction(); TipsterEN tipsterEN = (TipsterEN)session.Load(typeof(TipsterEN), id); session.Delete(tipsterEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PickadosGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PickadosGenNHibernate.Exceptions.DataLayerException("Error in TipsterCAD.", ex); } finally { SessionClose(); } }
public int NewTipster(TipsterEN tipster) { try { SessionInitializeTransaction(); session.Save(tipster); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is PickadosGenNHibernate.Exceptions.ModelException) { throw ex; } throw new PickadosGenNHibernate.Exceptions.DataLayerException("Error in TipsterCAD.", ex); } finally { SessionClose(); } return(tipster.Id); }
public int NewTipster(TimeSpan p_createdAt, TimeSpan p_modifiedAt, string p_alias, string p_email, String p_password, bool p_premium, double p_subscription_fee) { TipsterEN tipsterEN = null; int oid; //Initialized TipsterEN tipsterEN = new TipsterEN(); tipsterEN.CreatedAt = p_createdAt; tipsterEN.ModifiedAt = p_modifiedAt; tipsterEN.Alias = p_alias; tipsterEN.Email = p_email; tipsterEN.Password = Utils.Util.GetEncondeMD5(p_password); tipsterEN.Premium = p_premium; tipsterEN.Subscription_fee = p_subscription_fee; //Call to TipsterCAD oid = _ITipsterCAD.NewTipster(tipsterEN); return(oid); }
public TipsterEN GetByID(int id ) { TipsterEN tipsterEN = null; tipsterEN = _ITipsterCAD.GetByID(id); return(tipsterEN); }
public void ModifyTipster(int p_Tipster_OID, TimeSpan p_createdAt, TimeSpan p_modifiedAt, string p_alias, string p_email, String p_password, bool p_premium, double p_subscription_fee) { TipsterEN tipsterEN = null; //Initialized TipsterEN tipsterEN = new TipsterEN(); tipsterEN.Id = p_Tipster_OID; tipsterEN.CreatedAt = p_createdAt; tipsterEN.ModifiedAt = p_modifiedAt; tipsterEN.Alias = p_alias; tipsterEN.Email = p_email; tipsterEN.Password = Utils.Util.GetEncondeMD5(p_password); tipsterEN.Premium = p_premium; tipsterEN.Subscription_fee = p_subscription_fee; //Call to TipsterCAD _ITipsterCAD.ModifyTipster(tipsterEN); }