public ShoutCollection FetchAll() { ShoutCollection coll = new ShoutCollection(); Query qry = new Query(Shout.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }
public static ShoutCollection GetDeltaShouts(int hostID, string username, int? chatID, int lastReceivedShoutID) { //TODO: GJ: PERFORMANCE: we should check a token in the cache before retreiving the full list. // This would remove the need to retreive a full page of shouts from the cache just to check the newest ID ShoutCollection deltaShouts = new ShoutCollection(); ShoutCollection latestShouts = GetLatestShouts(hostID, username, chatID); if (latestShouts.Count > 0 && latestShouts[0].ShoutID > lastReceivedShoutID) { foreach (Shout shout in latestShouts) { if (shout.ShoutID > lastReceivedShoutID) deltaShouts.Add(shout); } } return deltaShouts; }
public static ShoutCollection GetPage(int hostID, int? toUserID, int? chatID, int pageIndex, int pageSize) { Query query = new Query(Shout.Schema).WHERE(Shout.Columns.HostID, hostID).ORDER_BY(Shout.Columns.CreatedOn, "DESC"); if (toUserID.HasValue) query = query.WHERE(Shout.Columns.ToUserID, toUserID.Value); else query = query.WHERE(Shout.Columns.ToUserID, Comparison.Is, null); if (chatID.HasValue) query = query.WHERE(Shout.Columns.ChatID, chatID.Value); else query = query.WHERE(Shout.Columns.ChatID, Comparison.Is, null); query.PageIndex = pageIndex; query.PageSize = pageSize; ShoutCollection shouts = new ShoutCollection(); shouts.Load(query.ExecuteReader()); return shouts; }
public void DataBind(ShoutCollection shouts) { this._shouts = shouts; }
public ShoutList(ShoutCollection shouts) { this.DataBind(shouts); }
public ShoutCollection FetchByQuery(Query qry) { ShoutCollection coll = new ShoutCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }
public ShoutCollection FetchByID(object ShoutID) { ShoutCollection coll = new ShoutCollection().Where("ShoutID", ShoutID).Load(); return coll; }
public void DataBind(ShoutCollection shouts, int toUserID) { this.DataBind(shouts); this._toUserID = toUserID; }
public void DataBind(ShoutCollection shouts) { _shouts = shouts; this.ShoutList.DataBind(_shouts); }