Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
What am I doing wrong, ...
This wont work.
e.Query.Where("BookingCategory = 'Child'");
or this..
e.Query.Where("BookingCategory = @0","'Child'");
(Column name is "BookingCategory")
Comment author was deleted
In which event are you doing this?
public class EventHandlerscs4 : ApplicationEventHandler { protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { UIOMatic.Controllers.PetaPocoObjectController.BuildingQuery += PetaPocoObjectController_BuildingQuery; }
void PetaPocoObjectController_BuildingQuery(object sender, UIOMatic.QueryEventArgs e) { if (e.CurrentType == typeof(tcAdminTodaysChildActivity)) { var DateNow = DateTime.Now; var theDate = Convert.ToDateTime(DateNow.ToString("yyyy-MM-dd")); e.Query.Where("HotelSiteRootId = @0 AND BookingCategory = 'Child' AND DATEPART(yy, ActivityStartTime) = " + theDate.Year + " AND DATEPART(mm, ActivityStartTime) = " + theDate.Month + "AND DATEPART(dd, ActivityStartTime) = " + theDate.Day + "", UmbracoContext.Current.Security.CurrentUser.StartContentId); } } }
So the other filters work? Or they all fail?
The other filters work fine, both HotelSiteRootId (int) and Date (DateTime).
Hmm don't see why it shouldn't work, are you sure the correct code is getting executed?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
SQL
What am I doing wrong, ...
This wont work.
e.Query.Where("BookingCategory = 'Child'");
or this..
e.Query.Where("BookingCategory = @0","'Child'");
(Column name is "BookingCategory")
Comment author was deleted
In which event are you doing this?
public class EventHandlerscs4 : ApplicationEventHandler { protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { UIOMatic.Controllers.PetaPocoObjectController.BuildingQuery += PetaPocoObjectController_BuildingQuery; }
Comment author was deleted
So the other filters work? Or they all fail?
The other filters work fine, both HotelSiteRootId (int) and Date (DateTime).
Comment author was deleted
Hmm don't see why it shouldn't work, are you sure the correct code is getting executed?
is working on a reply...