protected void Page_Init(object sender, EventArgs e)
        {
            IDateTimeNavigationService service = ASPxScheduler1.GetService(typeof(IDateTimeNavigationService)) as IDateTimeNavigationService;

            ASPxScheduler1.RemoveService(typeof(IDateTimeNavigationService));
            ASPxScheduler1.AddService(typeof(IDateTimeNavigationService), new MyDateTimeNavigationService(ASPxScheduler1, service));
        }
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     CreateTimeRulerFormatStringService();
     ASPxScheduler1.RemoveService(typeof(ITimeRulerFormatStringService));
     ASPxScheduler1.AddService(typeof(ITimeRulerFormatStringService), customTimeRulerFormatStringService);
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     SetupMappings();
     ResourceFiller.FillResources(this.ASPxScheduler1.Storage, 3);
     ASPxScheduler1.AppointmentDataSource = appointmentDataSource;
     ASPxScheduler1.DataBind();
 }
Exemple #4
0
        protected void ASPxCallbackPanel1_Callback(object sender, DevExpress.Web.CallbackEventArgsBase e)
        {
            if (!ASPxCallbackPanel1.IsCallback)
            {
                return;
            }

            string[] parameters = e.Parameter.Split(';');
            if (parameters.Length < 1)
            {
                return;
            }

            string commandName = parameters[0];

            if (commandName == "DeleteAppointmentCommand")
            {
                int value = Convert.ToInt32(parameters[1]);
                ASPxScheduler1.Storage.Appointments.Remove(ASPxScheduler1.Storage.Appointments.GetAppointmentById(value));
                ASPxScheduler1.DataBind();
                AgendaViewControl1.ReloadData();
            }
            else if (commandName == "SwitchViewToAgendaView")
            {
                DateTime selectedIntervalStart = ASPxScheduler1.ActiveView.GetVisibleIntervals().Start;
                DateTime intervalStart         = new DateTime(selectedIntervalStart.Year, selectedIntervalStart.Month, 1);
                AgendaViewControl1.SelectedInterval = new TimeInterval(intervalStart, intervalStart.AddMonths(1));
            }
        }
Exemple #5
0
 protected void ASPxScheduler1_BeforeExecuteCallbackCommand(object sender, SchedulerCallbackCommandEventArgs e)
 {
     if (e.CommandId.Contains("FLTRES"))
     {
         ASPxScheduler1.ApplyChanges(ASPxSchedulerChangeAction.NotifyResourceIntervalChanged);
     }
 }
    private void LoadSchedulerData()
    {
        DataTable dataTable = new DataTable("CarScheduling");

        dataTable.ReadXml(HttpContext.Current.Server.MapPath("~/App_Data/CarScheduling.xml"));
        ASPxScheduler1.AppointmentDataSource = dataTable;
        ASPxScheduler1.DataBind();
    }
Exemple #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SetupMappings();
        DemoUtils.FillResources(Storage, 5);

        ASPxScheduler1.AppointmentDataSource = appointmentDataSource;
        ASPxScheduler1.DataBind();
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     ProvideRowInsertion();
     if (!IsPostBack)
     {
         ASPxScheduler1.DataBind();
     }
 }
 void AttachDataSources()
 {
     ASPxScheduler1.AppointmentDataSource = this.appointmentDataSource;
     ASPxScheduler1.ResourceDataSource    = this.resourceDataSource;
     if (!IsPostBack)
     {
         ASPxScheduler1.DataBind();
     }
 }
Exemple #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DataHelper.SetupMappings(this.ASPxScheduler1);
        ResourceFiller.FillResources(this.ASPxScheduler1.Storage, 3);
        DataHelper.ProvideRowInsertion(ASPxScheduler1, appointmentDataSource);

        ASPxScheduler1.AppointmentDataSource = appointmentDataSource;
        ASPxScheduler1.DataBind();
    }
Exemple #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ResourceFiller.FillResources(ASPxScheduler1.Storage, 3);
        ASPxScheduler1.DataBind();

        if (!IsPostBack)
        {
            ASPxScheduler1.Start = new DateTime(2012, 1, 1);
        }
    }
 void UpdateTimeRulers()
 {
     ASPxScheduler1.BeginUpdate();
     try {
         UpdateClientTimeRuler(ASPxScheduler1.DayView);
         UpdateClientTimeRuler(ASPxScheduler1.WorkWeekView);
     } finally {
         ASPxScheduler1.EndUpdate();
     }
 }
Exemple #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SetupMappings();
        ResourceFiller.FillResources(this.ASPxScheduler1.Storage, 3);

        ASPxScheduler1.AppointmentDataSource = appointmentDataSource;
        ASPxScheduler1.Storage.Appointments.AutoRetrieveId = true;
        ASPxScheduler1.DataBind();

        ASPxScheduler1.GroupType = SchedulerGroupType.Resource;
    }
Exemple #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SetupMappings();
        ResourceFiller.FillResources(this.ASPxScheduler1.Storage, 3);

        ASPxScheduler1.AppointmentDataSource = appointmentDataSource;
        ASPxScheduler1.DataBind();

        ASPxScheduler1.Start     = DateTime.Today;
        ASPxScheduler1.GroupType = SchedulerGroupType.Resource;
    }
Exemple #15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ASPxScheduler1.DataBind();
     if (!IsPostBack)
     {
         if (ASPxScheduler1.Storage.Appointments.Count > 0)
         {
             ASPxScheduler1.Start = ASPxScheduler1.Storage.Appointments[0].Start;
         }
     }
 }
Exemple #16
0
 protected void ASPxScheduler1_AfterExecuteCallbackCommand(object sender, SchedulerCallbackCommandEventArgs e)
 {
     if (e.CommandId == SchedulerCallbackCommandId.AppointmentSave)
     {
         if (AgendaViewControl1.Active)
         {
             ASPxScheduler1.JSProperties["cpAppointmentSaved"] = true;
             ASPxScheduler1.DataBind();
             AgendaViewControl1.ReloadData();
         }
     }
 }
Exemple #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SetupMappings();
        ResourceFiller.FillResources(this.ASPxScheduler1.Storage, 3);

        ASPxScheduler1.AppointmentDataSource = appointmentDataSource;
        ASPxScheduler1.DataBind();

        ASPxScheduler1.GroupType = SchedulerGroupType.Resource;

        ASPxListBox1.Border.BorderStyle = BorderStyle.None;
    }
    void PopulateDataSources()
    {
        XPCollection <XPResource> res = new XPCollection <XPResource>(unitOfWork);

        res.Load();
        ASPxScheduler1.Storage.Resources.Clear();
        if (res.Count == 0)
        {
            PopulateDataSourcesCore();
        }
        CommitChanges();
        ASPxScheduler1.DataBind();
    }
 protected void ApplyStatusOption()
 {
     ASPxScheduler1.BeginUpdate();
     try
     {
         AppointmentDisplayOptions options = ASPxScheduler1.ActiveView.GetAppointmentDisplayOptions();
         options.StatusDisplayType = (AppointmentStatusDisplayType)cbStatus.Value;
     }
     finally
     {
         ASPxScheduler1.EndUpdate();
     }
     ASPxScheduler1.ApplyChanges(ASPxSchedulerChangeAction.RenderAppointments);
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        SetupMappings();
        ResourceFiller.FillResources(Storage, 3);

        ASPxScheduler1.AppointmentDataSource = appointmentDataSource;
        ASPxScheduler1.DataBind();

        if (!IsPostBack)
        {
            ASPxScheduler1.Services.Selection.SelectedInterval = new TimeInterval(
                ASPxScheduler1.Start.Date.AddHours(1),
                ASPxScheduler1.Start.Date.AddHours(2));
        }
    }
Exemple #21
0
        protected void Page_Init(object sender, EventArgs e)
        {
            AgendaViewControl1.OwnerScheduler = ASPxScheduler1;
            if (!IsPostBack)
            {
                DataHelper helper = new DataHelper(ASPxScheduler1);
                Session["ResourcesStorage"]   = helper.Resources;
                Session["AppointmentStorage"] = helper.Appointments;
            }
            ASPxScheduler1.JSProperties["cpAgendaViewActive"] = AgendaViewControl1.Active;
            ASPxScheduler1.JSProperties["cpAppointmentSaved"] = false;

            InitResourcesMappings();
            InitAppointmentsMappings();
            ASPxScheduler1.DataBind();
        }
Exemple #22
0
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        CreateAppointmentFormatStringService();
        CreateTimeRulerFormatStringService();
        CreateHeaderCaptionService();
        CreateHeaderToolTipService();


        ASPxScheduler1.RemoveService(typeof(IAppointmentFormatStringService));
        ASPxScheduler1.AddService(typeof(IAppointmentFormatStringService), customAppointmentFormatStringService);

        ASPxScheduler1.RemoveService(typeof(ITimeRulerFormatStringService));
        ASPxScheduler1.AddService(typeof(ITimeRulerFormatStringService), customTimeRulerFormatStringService);

        ASPxScheduler1.RemoveService(typeof(IHeaderCaptionService));
        ASPxScheduler1.AddService(typeof(IHeaderCaptionService), customHeaderCaptionService);

        ASPxScheduler1.RemoveService(typeof(IHeaderToolTipService));
        ASPxScheduler1.AddService(typeof(IHeaderToolTipService), customHeaderToolTipService);
    }
Exemple #23
0
 void ApplyUserRestrictions()
 {
     ASPxScheduler1.BeginUpdate();
     try
     {
         SchedulerOptionsCustomization options = ASPxScheduler1.OptionsCustomization;
         options.AllowAppointmentConflicts            = chkAllowConflicts.Checked ? AppointmentConflictsMode.Allowed : AppointmentConflictsMode.Forbidden;
         options.AllowAppointmentCopy                 = ToUsedAppointmentType(chkAllowCopy);
         options.AllowAppointmentCreate               = ToUsedAppointmentType(chkAllowCreate);
         options.AllowAppointmentDelete               = ToUsedAppointmentType(chkAllowDelete);
         options.AllowAppointmentDrag                 = ToUsedAppointmentType(chkAllowDrag);
         options.AllowAppointmentDragBetweenResources = ToUsedAppointmentType(chkAllowDragBetweenResources);
         options.AllowAppointmentEdit                 = ToUsedAppointmentType(chkAllowEdit);
         options.AllowInplaceEditor          = ToUsedAppointmentType(chkAllowInplaceEditor);
         options.AllowAppointmentMultiSelect = chkAllowMultiSelect.Checked;
         options.AllowAppointmentResize      = ToUsedAppointmentType(chkAllowResize);
     }
     finally
     {
         ASPxScheduler1.EndUpdate();
     }
     ASPxScheduler1.ApplyChanges(ASPxSchedulerChangeAction.RenderViewMenu);
 }
Exemple #24
0
 public void CreateHeaderToolTipService()
 {
     this.prevHeaderToolTipService   = (IHeaderToolTipService)ASPxScheduler1.GetService(typeof(IHeaderToolTipService));
     this.customHeaderToolTipService = new CustomHeaderToolTipService(prevHeaderToolTipService);
 }
Exemple #25
0
 public void CreateTimeRulerFormatStringService()
 {
     this.prevTimeRulerFormatStringService   = (ITimeRulerFormatStringService)ASPxScheduler1.GetService(typeof(ITimeRulerFormatStringService));
     this.customTimeRulerFormatStringService = new CustomTimeRulerFormatStringService(prevTimeRulerFormatStringService);
 }
Exemple #26
0
 public void CreateAppointmentFormatStringService()
 {
     this.prevAppointmentFormatStringService   = (IAppointmentFormatStringService)ASPxScheduler1.GetService(typeof(IAppointmentFormatStringService));
     this.customAppointmentFormatStringService = new CustomAppointmentFormatStringService(prevAppointmentFormatStringService);
 }
Exemple #27
0
 protected void ASPxScheduler1_VisibleIntervalChanged(object sender, EventArgs e)
 {
     ASPxScheduler1.ApplyChanges(ASPxSchedulerChangeAction.RenderViewMenu);
 }
        private void BindSchedular()
        {
            Session currentSession = ((XPObjectSpace)object_Space).Session;
            // dummy ds
            var ds  = object_Space.GetObjects <LeavePlanner>().Where(r => r.RequestStatus == RequestStatus.Approved).Select(r => new { Oid = 0, AllDay = 1, Description = "", EndTime = new DateTime(1800, 1, 1), Label = "", Location = "", recurrenceinfo = 0, reminderinfo = 0, firmId = 1, StartTime = new DateTime(1800, 1, 1), Status = "", Subject = "", EvenType = "", Employee = r.Employee }).ToList().Take(1);
            var ds1 = ds;
            var ds2 = ds;
            var ds3 = ds;
            var ds4 = ds;
            var ds5 = ds;
            var ds6 = ds;

            if (chkPlannedLeaveApprove.Checked)
            {
                ds1 = object_Space.GetObjects <LeavePlanner>().Where(r => r.RequestStatus == RequestStatus.Approved).Select(r => new { Oid = (r.Employee != null?r.Employee.Oid:0), AllDay = 1, Description = (r.Employee != null ? r.Employee.FullNameEn:""), EndTime = r.EndDate, Label = "", Location = "", recurrenceinfo = 0, reminderinfo = 0, firmId = 1, StartTime = (r.StartDate.ToString("hh:mm") == "00:00"?r.StartDate.AddMinutes(59).AddHours(23):r.StartDate), Status = "", Subject = (r.Employee != null ? r.Employee.FullNameEn:""), EvenType = "", Employee = r.Employee });
            }
            if (chkPlannedLeaveUnApprove.Checked)
            {
                ds2 = object_Space.GetObjects <LeavePlanner>().Where(r => r.RequestStatus != RequestStatus.Approved).Select(r => new { Oid = (r.Employee != null ? r.Employee.Oid : 0), AllDay = 1, Description = (r.Employee != null ? r.Employee.FullNameEn : ""), EndTime = r.EndDate, Label = "", Location = "", recurrenceinfo = 0, reminderinfo = 0, firmId = 1, StartTime = (r.StartDate.ToString("hh:mm") == "00:00" ? r.StartDate.AddMinutes(59).AddHours(23) : r.StartDate), Status = "", Subject = (r.Employee != null ? r.Employee.FullNameEn : ""), EvenType = "", Employee = r.Employee });
            }
            if (chkLeaveApprove.Checked)
            {
                ds3 = object_Space.GetObjects <LeaveRequest>().Where(r => r.RequestStatus == RequestStatus.Approved).Select(r => new { Oid = (r.Employee != null ? r.Employee.Oid : 0), AllDay = 1, Description = (r.Employee != null ? r.Employee.FullNameEn : ""), EndTime = r.EndDate, Label = "", Location = "", recurrenceinfo = 0, reminderinfo = 0, firmId = 1, StartTime = (r.StartDate.ToString("hh:mm") == "00:00" ? r.StartDate.AddMinutes(59).AddHours(23) : r.StartDate), Status = "", Subject = (r.Employee != null ? r.Employee.FullNameEn : ""), EvenType = "", Employee = r.Employee });
            }
            if (chkLeaveUnapproved.Checked)
            {
                ds4 = object_Space.GetObjects <LeaveRequest>().Where(r => r.RequestStatus != RequestStatus.Approved).Select(r => new { Oid = (r.Employee != null ? r.Employee.Oid : 0), AllDay = 1, Description = (r.Employee != null ? r.Employee.FullNameEn : ""), EndTime = r.EndDate, Label = "", Location = "", recurrenceinfo = 0, reminderinfo = 0, firmId = 1, StartTime = (r.StartDate.ToString("hh:mm") == "00:00" ? r.StartDate.AddMinutes(59).AddHours(23) : r.StartDate), Status = "", Subject = (r.Employee != null ? r.Employee.FullNameEn : ""), EvenType = "", Employee = r.Employee });
            }
            if (chkLeaveApprove.Checked)
            {
                ds5 = object_Space.GetObjects <LeaveAmendmentRequest>().Where(r => r.RequestStatus == RequestStatus.Approved).Select(r => new { Oid = (r.Employee != null ? r.Employee.Oid : 0), AllDay = 1, Description = (r.Employee != null ? r.Employee.FullNameEn : ""), EndTime = r.EndDate, Label = "", Location = "", recurrenceinfo = 0, reminderinfo = 0, firmId = 1, StartTime = (r.StartDate.ToString("hh:mm") == "00:00" ? r.StartDate.AddMinutes(59).AddHours(23) : r.StartDate), Status = "", Subject = (r.Employee != null ? r.Employee.FullNameEn : ""), EvenType = "", Employee = r.Employee });
            }
            if (chkLeaveUnapproved.Checked)
            {
                ds6 = object_Space.GetObjects <LeaveAmendmentRequest>().Where(r => r.RequestStatus != RequestStatus.Approved).Select(r => new { Oid = (r.Employee != null ? r.Employee.Oid : 0), AllDay = 1, Description = (r.Employee != null ? r.Employee.FullNameEn : ""), EndTime = r.EndDate, Label = "", Location = "", recurrenceinfo = 0, reminderinfo = 0, firmId = 1, StartTime = (r.StartDate.ToString("hh:mm") == "00:00" ? r.StartDate.AddMinutes(59).AddHours(23) : r.StartDate), Status = "", Subject = (r.Employee != null ? r.Employee.FullNameEn : ""), EvenType = "", Employee = r.Employee });
            }
            //String sqlAppointment = "SELECT leave.Oid,0 as AllDay,emp.FullNameEn as Description, (CAST(EndDate as Datetime) + CAST(EndTime as Time)) as EndTime, '' as Label, '' as Location,0 as recurrenceinfo,0 as reminderinfo, 1 as firmId,(CAST(StartDate as Datetime) + CAST(StartTime as Time)) as StartTime,'' as Status,emp.FullNameEn as Subject,'' as EvenType  FROM [EmployeeAbsence] leave inner join [Employee] emp on leave.Employee = emp.Oid";
            //if (cmbEmployee.Text != "" || cmbDepartment.Text != "")
            //    sqlAppointment += " where ";
            //if (cmbEmployee.Text != "")
            //    sqlAppointment += " emp.FullNameEn='"+ cmbEmployee.Text + "' ";
            //if (cmbDepartment.Text != "")
            //    sqlAppointment += " emp.FullNameEn='" + cmbDepartment.Text + "' ";
            //XPDataView xpDataView1 = new XPDataView();
            //xpDataView1.AddProperty("Oid", typeof(int));
            //xpDataView1.AddProperty("AllDay", typeof(string));
            //xpDataView1.AddProperty("Description", typeof(string));
            //xpDataView1.AddProperty("EndTime", typeof(DateTime));
            //xpDataView1.AddProperty("Label", typeof(string));
            //xpDataView1.AddProperty("Location", typeof(string));
            //xpDataView1.AddProperty("recurrenceinfo", typeof(int));
            //xpDataView1.AddProperty("reminderinfo", typeof(int));
            //xpDataView1.AddProperty("firmId", typeof(int));
            //xpDataView1.AddProperty("StartTime", typeof(DateTime));
            //xpDataView1.AddProperty("Status", typeof(string));
            //xpDataView1.AddProperty("Subject", typeof(string));
            //xpDataView1.AddProperty("EvenType", typeof(string));
            //xpDataView1.LoadData(currentSession.ExecuteQuery(sqlAppointment));
            //ASPxScheduler1.AppointmentDataSource = xpDataView1;
            ds = ds.Union(ds1).Union(ds2).Union(ds3).Union(ds4).Union(ds5).Union(ds6);
            if (cmbEmployee.Text != "" && cmbEmployee.Text != null)
            {
                ds = ds.Where(x => (x.Employee != null?x.Employee.FullNameEn:"") == cmbEmployee.Text);
            }
            if (cmbDepartment.Text != "" && cmbDepartment.Text != null)
            {
                ds = ds.Where(x => (x.Employee != null ? (x.Employee.CurrentDepartment != null ? x.Employee.CurrentDepartment.NameEn :""):"") == cmbDepartment.Text);
            }
            ASPxScheduler1.AppointmentDataSource = ds;
            XPDataView xpDataView2 = new XPDataView();
            String     sqlResource = "SELECT 1 as Id, 'Test' as Model";

            xpDataView2.AddProperty("Id", typeof(string));
            xpDataView2.AddProperty("Model", typeof(string));
            xpDataView2.LoadData(currentSession.ExecuteQuery(sqlResource));
            ASPxScheduler1.ResourceDataSource = xpDataView2;
            ASPxScheduler1.DataBind();
        }