本文整理汇总了C#中Bobs.Query类的典型用法代码示例。如果您正苦于以下问题:C# Query类的具体用法?C# Query怎么用?C# Query使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Query类属于Bobs命名空间,在下文中一共展示了Query类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: BindNewPromoters
void BindNewPromoters()
{
if (true)
{
Query q = new Query();
q.QueryCondition = new And(
(ContainerPage.Url[0].Equals("all") ? new Q(Promoter.Columns.ClientSector, Promoter.ClientSectorEnum.Promoter) : new Q(true)),
Promoter.EnabledQ,
new Q(Promoter.Columns.SalesStatus, Promoter.SalesStatusEnum.New),
SalesUsrQ,
new Q(Promoter.Columns.SalesCallCount, 0),
new Or(
new Q(Promoter.Columns.SalesHold, false),
new Q(Promoter.Columns.SalesHold, QueryOperator.IsNull, null)
)
);
q.OrderBy = new OrderBy(Promoter.Columns.DateTimeSignUp, OrderBy.OrderDirection.Ascending);
PromoterSet ps = new PromoterSet(q);
NewPromoterDataGrid.AllowPaging = (ps.Count > NewPromoterDataGrid.PageSize);
NewPromoterDataGrid.DataSource = ps;
NewPromoterDataGrid.DataBind();
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:27,代码来源:SalesNew.ascx.cs
示例2: BindCallBacks
void BindCallBacks()
{
if (true)
{
Query q = new Query();
q.QueryCondition = new And(
(ContainerPage.Url[0].Equals("all") ? new Q(Promoter.Columns.ClientSector, Promoter.ClientSectorEnum.Promoter) : new Q(true)),
Promoter.EnabledQ,
new Q(Promoter.Columns.SalesStatus, Promoter.SalesStatusEnum.New),
SalesUsrQ,
new Or(
new Q(Promoter.Columns.SalesHold, false),
new Q(Promoter.Columns.SalesHold, QueryOperator.IsNull, null)
),
new Q(Promoter.Columns.SalesNextCall, QueryOperator.LessThan, DateTime.Today.AddDays(1)),
new Q(Promoter.Columns.SalesCallCount, QueryOperator.NotEqualTo, 0)
);
q.OrderBy = Promoter.NewIdleOrder;
PromoterSet ps = new PromoterSet(q);
CallBacksDataGrid.AllowPaging = (ps.Count > CallBacksDataGrid.PageSize);
CallBacksDataGrid.DataSource = ps;
CallBacksDataGrid.DataBind();
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:27,代码来源:SalesNew.ascx.cs
示例3: BindOnlineBox
protected void BindOnlineBox()
{
if (Prefs.Current["ShowOnline"].Exists && Prefs.Current["ShowOnline"] == 1)
{
//Show box
OnlineHiddenPanel.Visible = false;
OnlinePanel.Visible = true;
}
else
{
//show link
Query q = new Query();
q.CacheDuration = TimeSpan.FromMinutes(10);
q.QueryCondition = Usr.LoggedInChatQ;
q.ReturnCountOnly = true;
UsrSet us = new UsrSet(q);
if (us.Count <= 1)
{
this.Visible = false;
}
else
{
Bobs.Global.SetMaxUsers(us.Count);
OnlineHiddenLabel.Text = us.Count.ToString() + " user" + (us.Count == 1 ? "" : "s") + " online";
OnlineHiddenPanel.Visible = true;
OnlinePanel.Visible = false;
}
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:31,代码来源:WhosOnline.ascx.cs
示例4: ArticlesDataGrid_Bind
void ArticlesDataGrid_Bind()
{
Query q = new Query();
if (Usr.Current.IsAdmin)
q.QueryCondition = new Or(new Q(Article.Columns.OwnerUsrK, Usr.Current.K), new Q(Article.Columns.Status, Article.StatusEnum.Edit), new Q(Article.Columns.Status, Article.StatusEnum.Enabled));
else if (Usr.Current.IsSuper)
q.QueryCondition = new Or(new Q(Article.Columns.OwnerUsrK, Usr.Current.K), new Q(Article.Columns.Status, Article.StatusEnum.Edit));
else
q.QueryCondition = new Q(Article.Columns.OwnerUsrK, Usr.Current.K);
q.OrderBy = new OrderBy(Article.Columns.AddedDateTime, OrderBy.OrderDirection.Descending);
ArticleSet ars = new ArticleSet(q);
if (ars.Count == 0)
{
NoArticlesDataGridPanel.Visible = true;
ArticlesDataGridPanel.Visible = false;
}
else
{
ArticlesDataGrid.Columns[3].Visible = Usr.Current.IsSuper;
NoArticlesDataGridPanel.Visible = false;
ArticlesDataGridPanel.Visible = true;
ArticlesDataGrid.AllowPaging = (ars.Count > ArticlesDataGrid.PageSize);
ArticlesDataGrid.DataSource = ars;
ArticlesDataGrid.DataBind();
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:30,代码来源:MyArticles.ascx.cs
示例5: GetResults
private void GetResults()
{
Query searchCardTransferQuery = new Query();
List<Q> QueryConditionList = new List<Q>();
searchCardTransferQuery.OrderBy = new OrderBy("dateadd(day, 0, datediff(day, 0, [Transfer].[DateTimeComplete]))");
searchCardTransferQuery.GroupBy = new GroupBy("dateadd(day, 0, datediff(day, 0, [Transfer].[DateTimeComplete]))");
searchCardTransferQuery.ExtraSelectElements.Add("SumAmount", "SUM([Transfer].[Amount])");
searchCardTransferQuery.ExtraSelectElements.Add("CountTransfers", "COUNT([Transfer].[K])");
searchCardTransferQuery.ExtraSelectElements.Add("Date", "dateadd(day, 0, datediff(day, 0, [Transfer].[DateTimeComplete]))");
searchCardTransferQuery.Columns = new ColumnSet();
QueryConditionList.Add(new Q(Bobs.Transfer.Columns.Method, Bobs.Transfer.Methods.Card));
QueryConditionList.Add(new Q(Bobs.Transfer.Columns.Status, Bobs.Transfer.StatusEnum.Success));
if (this.FromDateCal.Date != DateTime.MinValue)
QueryConditionList.Add(new Q(Bobs.Transfer.Columns.DateTimeComplete, QueryOperator.GreaterThanOrEqualTo, this.FromDateCal.Date));
if (this.ToDateCal.Date != DateTime.MinValue)
QueryConditionList.Add(new Q(Bobs.Transfer.Columns.DateTimeComplete, QueryOperator.LessThan, this.ToDateCal.Date.AddDays(1)));
searchCardTransferQuery.QueryCondition = new And(QueryConditionList.ToArray());
TransferSet searchCardTransfers = new TransferSet(searchCardTransferQuery);
this.CardnetAccountGridView.DataSource = searchCardTransfers;
this.CardnetAccountGridView.DataBind();
SumAmounts(searchCardTransfers);
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:30,代码来源:CardProcessingReport.ascx.cs
示例6: SetState
public void SetState()
{
Query q = new Query();
q.OrderBy = MusicType.OrderBy;
MusicTypeSet mts = new MusicTypeSet(q);
foreach (MusicType mt in mts)
{
CheckBox cb = (CheckBox)Cambro.Web.Helpers.SearchControl(Tree, "ItemCb" + mt.K);
cb.Checked = false;
if (mt.Children.Count > 0)
{
HtmlGenericControl children = (HtmlGenericControl)Cambro.Web.Helpers.SearchControl(Tree, "Children" + mt.K);
children.Style["display"] = null;
Label lab = (Label)Cambro.Web.Helpers.SearchControl(Tree, "LabCb" + mt.K);
lab.Style["display"] = "none";
}
}
if (initialMusicTypes != null)
{
foreach (MusicType mt in initialMusicTypes)
{
CheckBox cb = (CheckBox)Cambro.Web.Helpers.SearchControl(Tree, "ItemCb" + mt.K);
cb.Checked = true;
if (mt.Children.Count > 0)
{
HtmlGenericControl children = (HtmlGenericControl)Cambro.Web.Helpers.SearchControl(Tree, "Children" + mt.K);
children.Style["display"] = "none";
Label lab = (Label)Cambro.Web.Helpers.SearchControl(Tree, "LabCb" + mt.K);
lab.Style["display"] = null;
}
}
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:33,代码来源:MusicTypes.ascx.cs
示例7: Page_Load
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
Query q = new Query();
q.QueryCondition = Usr.LoggedInQ;
q.NoLock = true;
q.ReturnCountOnly = true;
UsrSet us = new UsrSet(q);
UsersOnline5MinLabel.Text = (us.Count == 1 ? "is " : "are ") + us.Count.ToString("#,##0") + " user" + (us.Count == 1 ? "" : "s");
Query q30min = new Query();
q30min.QueryCondition = Usr.LoggedIn30MinQ;
q30min.NoLock = true;
q30min.ReturnCountOnly = true;
UsrSet us30min = new UsrSet(q30min);
UsersOnline30MinLabel.Text = us30min.Count.ToString("#,##0");
Bobs.Global gMaxUsers = new Bobs.Global(Bobs.Global.Records.MaxUsers5Min);
MaxUsersOnline5MinLabel.Text = gMaxUsers.ValueInt.ToString("#,##0");
MaxUsersOnline5MinDateLabel.Text = Cambro.Misc.Utility.FriendlyDate(gMaxUsers.ValueDateTime, true, false);
Bobs.Global gMaxUsers30Min = new Bobs.Global(Bobs.Global.Records.MaxUsers30Min);
MaxUsersOnline30MinLabel.Text = gMaxUsers30Min.ValueInt.ToString("#,##0");
Page.DataBind();
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:25,代码来源:Stats.ascx.cs
示例8: DaveIgnore
public void DaveIgnore(object o, System.EventArgs e)
{
Usr Dave = new Usr(4);
Cambro.Web.Helpers.WriteAlertHeader();
Cambro.Web.Helpers.WriteAlert("Selecting...", 1);
Query q = new Query();
if (Vars.DevEnv)
q.TopRecords = 50;
PromoterSet bs = new PromoterSet(q);
for (int count = 0; count < bs.Count; count++)
{
Promoter p = bs[count];
// Do work here!
try
{
Thread t = new Thread(p.QuestionsThreadK);
ThreadUsr tu = t.GetThreadUsr(Dave);
tu.ChangeStatus(ThreadUsr.StatusEnum.Ignore, DateTime.Now, true, true);
if (count % 100 == 0)
Cambro.Web.Helpers.WriteAlert("Done " + count + "/" + bs.Count + " - " + p.UrlName, 2);
}
catch
{
Cambro.Web.Helpers.WriteAlert("Done " + count + "/" + bs.Count + " - EXCEPTION! " + p.UrlName, 3);
}
bs.Kill(count);
}
Cambro.Web.Helpers.WriteAlert("Done!", 4);
Cambro.Web.Helpers.WriteAlertFooter("/admin/promoterpm");
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:35,代码来源:PromoterPm.ascx.cs
示例9: PanelInvite_Load
private void PanelInvite_Load(object sender, System.EventArgs e)
{
if (Mode.Equals(Modes.None))
{
ContainerPage.SetPageTitle(String.Format("Invite {0} to a group...", ThisUsr.NickName));
InviteUsrAnchor.HRef = ThisUsr.Url();
InviteUsrAnchor.InnerText = ThisUsr.NickName;
ThisUsr.MakeRollover(InviteUsrAnchor);
Header.InnerText = String.Format("Invite {0} to a group...", ThisUsr.NickName);
if (!Page.IsPostBack)
{
Query q = new Query();
q.Columns = new ColumnSet(Group.Columns.Name, Group.Columns.K);
q.QueryCondition = Usr.Current.GroupMemberQ;
q.TableElement = Group.UsrMemberJoin;
q.OrderBy = new OrderBy(Group.Columns.Name);
GroupSet gs = new GroupSet(q);
if (gs.Count == 0)
{
ChangePanel(PanelNoGroups);
}
else
{
GroupDropDown.DataSource = gs;
GroupDropDown.DataTextField = "Name";
GroupDropDown.DataValueField = "K";
GroupDropDown.DataBind();
}
}
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:32,代码来源:Invite.ascx.cs
示例10: BindExpired
void BindExpired()
{
List<Q> queryConditionList = new List<Q>();
queryConditionList.Add(Promoter.EnabledQ);
queryConditionList.Add(new Or(new Q(Promoter.Columns.SalesHold, false),
new Q(Promoter.Columns.SalesHold, QueryOperator.IsNull, null)));
queryConditionList.Add(new Q(Promoter.Columns.SalesStatusExpires, QueryOperator.LessThan, DateTime.Now));
queryConditionList.Add(new Or(new Q(Promoter.Columns.SalesNextCall, QueryOperator.LessThan, DateTime.Now),
new Q(Promoter.Columns.SalesNextCall, QueryOperator.IsNull, null)));
queryConditionList.Add(new Q(Promoter.Columns.SalesUsrK, Usr.Current.K));
if(this.SectorFilterDropDownList.SelectedValue != "")
queryConditionList.Add(new Q(Promoter.Columns.ClientSector, Convert.ToInt32(SectorFilterDropDownList.SelectedValue)));
if(this.SalesEstimateFilterDropDownList.SelectedValue != "")
queryConditionList.Add(new Q(Promoter.Columns.SalesEstimate, Convert.ToInt32(SalesEstimateFilterDropDownList.SelectedValue)));
Query q = new Query(new And(queryConditionList.ToArray()));
q.OrderBy = new OrderBy(
new OrderBy(Promoter.Columns.SalesNextCall, OrderBy.OrderDirection.Descending),
new OrderBy(Promoter.Columns.SalesEstimate, OrderBy.OrderDirection.Descending),
new OrderBy(Promoter.Columns.DateTimeSignUp, OrderBy.OrderDirection.Descending));
PromoterSet ps = new PromoterSet(q);
ExpiredDataGrid.AllowPaging = (ps.Count > ExpiredDataGrid.PageSize);
ExpiredDataGrid.DataSource = ps;
ExpiredDataGrid.DataBind();
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:28,代码来源:SalesProactive.ascx.cs
示例11: LoadCurrentEventsWithTickets
private void LoadCurrentEventsWithTickets()
{
Query currentEventsWithTicketsQuery = new Query(new And(new Q(Bobs.TicketRun.Columns.PromoterK, CurrentPromoter.K),
new Q(Bobs.TicketRun.Columns.EndDateTime, QueryOperator.GreaterThanOrEqualTo, DateTime.Today.AddDays(-5)),
new Q(Bobs.TicketRun.Columns.SoldTickets, QueryOperator.GreaterThan, 0)));
currentEventsWithTicketsQuery.TableElement = Bobs.TicketRun.EventJoin;
currentEventsWithTicketsQuery.GroupBy = new GroupBy(new GroupBy(Event.Columns.K), new GroupBy(Event.Columns.DateTime), new GroupBy(Event.Columns.Name));
currentEventsWithTicketsQuery.OrderBy = new OrderBy(Event.Columns.DateTime);
// currentEventsWithTicketsQuery.ExtraSelectElements.Add("TicketsSold", "SUM([TicketRun].[SoldTickets])");
currentEventsWithTicketsQuery.Columns = new ColumnSet(Event.Columns.K, Event.Columns.Name);
EventSet currentEventsWithTickets = new EventSet(currentEventsWithTicketsQuery);
this.NoTicketsP.Visible = false;
if (currentEventsWithTickets.Count == 0)
{
this.NoTicketsP.Visible = true;
this.HasTicketsP.Visible = false;
}
else if (currentEventsWithTickets.Count == 1)
{
// redirect to doorlist popup page
Response.Redirect(currentEventsWithTickets[0].DoorlistUrl);
}
else
{
this.EventDropDownList.Items.Clear();
foreach (Event ticketEvent in currentEventsWithTickets)
{
this.EventDropDownList.Items.Add(new ListItem(ticketEvent.Name, ticketEvent.K.ToString()));
}
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:33,代码来源:Doorlist.ascx.cs
示例12: GetCountOfLogItemForDates
public Dictionary<DateTime, int> GetCountOfLogItemForDates(Log.Items logItemType, List<DateTime> dates)
{
return Caching.Instances.Main.GetWithLocalCaching(
String.Format("GetCountOfLogItemForDates(logItemType={0}, dates={1})", logItemType, string.Join(",", dates.ConvertAll(d => d.ToShortDateString()).ToArray())),
() =>
{
var query = new Query();
query.Columns = new ColumnSet(Log.Columns.Count, Log.Columns.Date);
query.QueryCondition = new And(
new Q(Log.Columns.Item, logItemType),
new Or(
dates.ConvertAll(date => new Q(Log.Columns.Date, date.Date)).ToArray()
)
);
var ls = new LogSet(query);
var results = new Dictionary<DateTime, int>();
foreach (Log l in ls)
{
results.Add(l.Date, l.Count);
}
foreach (DateTime d in dates)
{
if (!results.ContainsKey(d.Date))
{
results.Add(d.Date, 0);
}
}
return results;
},
5.Minutes(),
1.Days()
);
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:33,代码来源:DataDrivenTrafficShape.cs
示例13: TopPlacesPanel_Load
public void TopPlacesPanel_Load(object o, System.EventArgs e)
{
Query q = new Query();
q.QueryCondition = new And(new Q(Place.Columns.CountryK, CurrentCountry.K), new Q(Place.Columns.Enabled, true));
q.OrderBy = new OrderBy(new OrderBy(Place.Columns.TotalEvents, OrderBy.OrderDirection.Descending), new OrderBy(Place.Columns.Population, OrderBy.OrderDirection.Descending));
q.TopRecords = 20;
PlaceSet ps = new PlaceSet(q);
if (ps.Count == 0)
{
TopPlacesPanel.Visible = false;
}
else
{
TopPlacesDataList.ItemTemplate = this.LoadTemplate("/Templates/Places/CountryTopPlacesList.ascx");
TopPlacesDataList.DataSource = ps;
TopPlacesDataList.DataBind();
}
if (ps.Count == 20)
{
TopPlacesAnchor.HRef = CurrentCountry.UrlApp("places");
TopPlacesAnchor.InnerText = TopPlacesAnchor.InnerText.Replace("???", CurrentCountry.FriendlyName);
}
else
TopPlacesAnchorPanel.Visible = false;
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:26,代码来源:HomeContentTop.ascx.cs
示例14: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
CountryDrop.Items.Clear();
CountryDrop.Items.Add(new ListItem("select here...", "0"));
Query qTop = new Query();
qTop.Columns = new ColumnSet(Country.Columns.FriendlyName, Country.Columns.K);
qTop.OrderBy = new OrderBy(Country.Columns.TotalEvents, OrderBy.OrderDirection.Descending);
qTop.QueryCondition = new Q(Country.Columns.Enabled, true);
qTop.TopRecords = 10;
CountrySet csTop = new CountrySet(qTop);
CountryDrop.Items.Add(new ListItem("", "0"));
CountryDrop.Items.Add(new ListItem("- POPULAR COUNTRIES -", "0"));
foreach (Country c in csTop)
CountryDrop.Items.Add(new ListItem(Cambro.Misc.Utility.Snip(c.FriendlyName, 25), c.K.ToString()));
Query qAll = new Query();
qAll.Columns = new ColumnSet(Country.Columns.FriendlyName, Country.Columns.K);
qAll.OrderBy = new OrderBy(Country.Columns.FriendlyName);
qAll.QueryCondition = new Q(Country.Columns.Enabled, true);
CountrySet csAll = new CountrySet(qAll);
CountryDrop.Items.Add(new ListItem("", "0"));
CountryDrop.Items.Add(new ListItem("--- ALL COUNTRIES ---", "0"));
foreach (Country c in csAll)
CountryDrop.Items.Add(new ListItem(Cambro.Misc.Utility.Snip(c.FriendlyName, 25), c.K.ToString()));
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:28,代码来源:DrinkingAge.ascx.cs
示例15: Template
public void Template(object o, System.EventArgs e)
{
Cambro.Web.Helpers.WriteAlertHeader();
Cambro.Web.Helpers.WriteAlert("Selecting xxx...", 1);
Query q = new Query();
//q.QueryCondition=???
CommentSet bs = new CommentSet(q);
for (int count = 0; count < bs.Count; count++)
{
Comment c = bs[count];
try
{
// Do work here!
c.Update();
if (count % 10 == 0)
Cambro.Web.Helpers.WriteAlert("Done " + count + "/" + bs.Count, 2);
}
catch(Exception ex)
{
Cambro.Web.Helpers.WriteAlert("Exception " + count + "/" + bs.Count + " - " + ex.ToString(), 3);
}
bs.Kill(count);
}
Cambro.Web.Helpers.WriteAlert("Done!", 3);
Cambro.Web.Helpers.WriteAlertFooter();
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:32,代码来源:Utility.ascx.cs
示例16: get
UsrEventAttendedSet get(bool forceAllCountries)
{
Q sexQ =
SexTypeFromUrl == SexType.Boys ? new Q(Usr.Columns.IsMale, true) :
SexTypeFromUrl == SexType.Girls ? new Q(Usr.Columns.IsMale, false) :
new Q(true);
Q countryQ = new Q(true);
if (!forceAllCountries && LocationTypeFromUrl == LocationType.Country)
countryQ = new Q(Place.Columns.CountryK, CountryFromUrl.K);
Query q = new Query();
q.TableElement = new Join(new Join(Event.UsrAttendedJoin, Venue.Columns.K, Event.Columns.VenueK), Place.Columns.K, Venue.Columns.PlaceK);
q.QueryCondition = new And(
new Q(Usr.Columns.IsSkeleton, false),
new Q(Usr.Columns.ExDirectory, false),
new Q(Usr.Columns.PhotosMeCount, QueryOperator.GreaterThan, 0),
sexQ,
countryQ,
Event.FutureEventsQueryCondition,
new Q(Event.Columns.DateTime, QueryOperator.LessThan, DateTime.Today.AddDays(7)));
q.OrderBy = new OrderBy(Usr.Columns.K);
q.Columns = new ColumnSet(UsrEventAttended.Columns.UsrK);
q.CacheDuration = new TimeSpan(1, 0, 0);
return new UsrEventAttendedSet(q);
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:28,代码来源:Out.ascx.cs
示例17: GetTags
internal List<KeyValuePair<ILinkable, int>> GetTags(int numberOfItems)
{
Random r = new Random();
return Caching.Instances.Main.GetWithLocalCaching(new NamespacedCacheKey(CacheKeyPrefix.TagCloudData, new CacheKey(CacheKeyPrefix.TagCloudVersion), r.Next(10).ToString(), numberOfItems.ToString()),
() =>
{
List<int> tagKs = GetTagKs(numberOfItems);
Query getTags = new Query(new And(new Q(new Column(Tag.Columns.K), tagKs.ToArray())));
getTags.TableElement = new Join(new TableElement(Bobs.TablesEnum.TagPhoto), Tag.Columns.K, TagPhoto.Columns.TagK);
getTags.Columns = new ColumnSet(Tag.Columns.TagText, Tag.Columns.ShowInTagCloud, Tag.Columns.K, Tag.Columns.Blocked, Tag.Columns.BlockedByUsrK, Tag.Columns.BlockedDateTime);
getTags.ExtraSelectElements.Add("Frequency", "CAST(CEILING(LOG(COUNT(" + new Column(TagPhoto.Columns.TagK).InternalSqlName + "))+1) AS INT)");
getTags.GroupBy = new GroupBy(new GroupBy(Tag.Columns.K), new GroupBy(Tag.Columns.TagText), new GroupBy(Tag.Columns.Blocked), new GroupBy(Tag.Columns.BlockedByUsrK), new GroupBy(Tag.Columns.BlockedDateTime), new GroupBy(Tag.Columns.ShowInTagCloud));
getTags.OrderBy = new OrderBy(Tag.Columns.TagText, OrderBy.OrderDirection.Ascending);
List<Tag> tags = new TagSet(getTags).ToList();
return tags.ToList().ConvertAll(t => new KeyValuePair<ILinkable, int>(t, (int)t.ExtraSelectElements["Frequency"]));
},
new TimeSpan(0, 0, 30),
new TimeSpan(1, 0, 0)
);
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:26,代码来源:TagCloudService.cs
示例18: BindPromoters
void BindPromoters()
{
Query q = new Query();
q.QueryCondition = new And(
Promoter.EnabledQ,
new Or(
new Q(Promoter.Columns.SalesHold, false),
new Q(Promoter.Columns.SalesHold, QueryOperator.IsNull, null)
),
new Or(
new Q(Promoter.Columns.SalesNextCall, QueryOperator.LessThan, DateTime.Today.AddDays(1)),
new Q(Promoter.Columns.SalesNextCall, QueryOperator.IsNull, null)
),
new Q(Promoter.Columns.LetterStatus, Promoter.LetterStatusEnum.Posted),
new StringQueryCondition("(SELECT COUNT(*) FROM [SalesCall] WHERE [SalesCall].[PromoterK]=[Promoter].[K] AND [SalesCall].[IsCall]=1)=0")
);
q.OrderBy = new OrderBy(
new OrderBy(Promoter.Columns.FutureEvents, OrderBy.OrderDirection.Descending),
new OrderBy(Promoter.Columns.SalesNextCall, OrderBy.OrderDirection.Ascending),
new OrderBy(Promoter.Columns.DateTimeSignUp, OrderBy.OrderDirection.Ascending));
PromoterSet ps = new PromoterSet(q);
PromoterDataGrid.AllowPaging = (ps.Count > PromoterDataGrid.PageSize);
PromoterDataGrid.DataSource = ps;
PromoterDataGrid.DataBind();
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:28,代码来源:SalesLetterFollowUp.ascx.cs
示例19: ProcessGalleriesThatHaveFinishedUploading
static void ProcessGalleriesThatHaveFinishedUploading()
{
Query q = new Query();
q.QueryCondition = new And(
new Q(Gallery.Columns.RunFinishedUploadingTask, false),
new Q(Gallery.Columns.LastLiveDateTime, QueryOperator.LessThan, DateTime.Now.AddMinutes(-20)),
new Q(Gallery.Columns.LivePhotos, QueryOperator.GreaterThan, 0));
GallerySet gs = new GallerySet(q);
foreach (Gallery g in gs)
{
g.RunFinishedUploadingTask = true;
g.Update();
if (g.Owner.FacebookConnected && g.Owner.FacebookStoryUploadPhoto)
{
try
{
FacebookPost.CreatePhotoUpload(g.Owner, g);
}
catch { }
}
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:25,代码来源:Program.cs
示例20: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
{
StringBuilder sbDjs = new StringBuilder();
Query q1 = new Query();
q1.OrderBy = new OrderBy(OrderBy.OrderDirection.Random);
MixmagGreatestDjSet djs = new MixmagGreatestDjSet(q1);
HtmlRenderer h = new HtmlRenderer();
h.RenderFlashTagsRaw = true;
foreach (MixmagGreatestDj dj in djs)
{
sbDjs.Append("<h2 style=\"margin-top: 35px; margin-bottom: -5px;\">" + dj.Name + "</h2>");
sbDjs.Append("<div style=\"height: 100px; clear:both; margin-bottom: 20px;\">");
{
sbDjs.Append("<div style=\"height: 100px; width: 100px; float: left; margin-right: 10px;\"><a href=\"/" + dj.UrlName + "\"><img src=\"" + dj.ImageUrl + "\" width=\"100\" height=\"100\" /></a></div>");
//sbDjs.Append("<div style=\"height: 100px; width: 150px; float: right; margin-left: 10px; \">" + h.GetFlash("djvid" + dj.K.ToString(), 100, 150, false, "load", "http://www.youtube.com/v/" + dj.YoutubeId + "&rel=1") + "</div>");
sbDjs.Append("<p>" + dj.Description + "<br /><a href=\"/" + dj.UrlName + "\"><b>Vote for " + dj.Name + "</b></a></p>");
}
sbDjs.Append("</div>");
//sbDjs.Append("<div style=\"clear: both;\"></div>");
}
DjsPh.Controls.Add(new LiteralControl(sbDjs.ToString()));
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:29,代码来源:Default.aspx.cs
注:本文中的Bobs.Query类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论