我已经开发了 Telerik Radscheduler,因为我已经编写了如下代码,我想禁用/启用事件的 perticuler 时隙,在此禁用工作正常但启用不工作我不明白为什么它不是启用允许插入。请帮助我在需要更改以解决此问题的地方...
protected void RadScheduler1_TimeSlotCreated1(object sender, TimeSlotCreatedEventArgs e)
{
//Getting Business hour time
mybusinesscalendarEntities objEntity = new mybusinesscalendarEntities();
var Result = from bhours in objEntity.businesshours where bhours.BusinessId == businessid select bhours;
if (Result.Count() > 0)
{
var Hours = (from bhours in objEntity.businesshours where bhours.BusinessId == businessid select bhours).First();
//Get particular day businee hour timings and disable the time slot
string Day = System.DateTime.Today.DayOfWeek.ToString();
if (Day == "Monday")
{
string WorkDay = Hours.MondayFromTime.Value.ToShortTimeString();
string WorkDayStart = WorkDay.Remove(WorkDay.Length - 2, 2);
string WorkDayEnd = Hours.MondayToTime.Value.ToShortTimeString();
string WorkDayEndTime = WorkDayEnd.Remove(WorkDayEnd.Length - 2, 2);
if ((e.TimeSlot.Start.TimeOfDay < TimeSpan.Parse(WorkDayStart.Trim())) || (e.TimeSlot.Start.TimeOfDay > TimeSpan.Parse(WorkDayEndTime.Trim())))
{
e.TimeSlot.CssClass = "Disabled";
RadScheduler1.ReadOnly = true;
}
else
{
RadScheduler1.ReadOnly = false;
RadScheduler1.AllowInsert = true;
RadScheduler1.AllowEdit = true;
RadScheduler1.AllowDelete = true;
}