protected void Page_Load(object sender, EventArgs e)
 {
     SetupMappings();
     ResourceFiller.FillResources(this.ASPxScheduler1.Storage, 3);
     ASPxScheduler1.AppointmentDataSource = appointmentDataSource;
     ASPxScheduler1.DataBind();
 }
Example #2
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));
            }
        }
    private void LoadSchedulerData()
    {
        DataTable dataTable = new DataTable("CarScheduling");

        dataTable.ReadXml(HttpContext.Current.Server.MapPath("~/App_Data/CarScheduling.xml"));
        ASPxScheduler1.AppointmentDataSource = dataTable;
        ASPxScheduler1.DataBind();
    }
Example #4
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();
     }
 }
Example #7
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();
    }
Example #8
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);
        }
    }
Example #9
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;
    }
Example #10
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;
         }
     }
 }
Example #11
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;
    }
Example #12
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();
         }
     }
 }
Example #13
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 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));
        }
    }
Example #16
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();
        }
        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();
        }