public MainWindow()
        {
            InitializeComponent();

            tableAdapterAppointments.Fill(dataSet.CarScheduling);
            tableAdapterResources.Fill(dataSet.Cars);

            schedulerControl1.Storage.ResourceStorage.DataSource    = dataSet.Cars;
            schedulerControl1.Storage.AppointmentStorage.DataSource = dataSet.CarScheduling;

            if (schedulerControl1.Storage.AppointmentStorage.Count > 0)
            {
                schedulerControl1.Start = schedulerControl1.Storage.AppointmentStorage[0].Start;
            }

            schedulerControl1.Storage.AppointmentsInserted +=
                new PersistentObjectsEventHandler(Storage_AppointmentsModified);
            schedulerControl1.Storage.AppointmentsChanged +=
                new PersistentObjectsEventHandler(Storage_AppointmentsModified);
            schedulerControl1.Storage.AppointmentsDeleted +=
                new PersistentObjectsEventHandler(Storage_AppointmentsModified);

            tableAdapterAppointments.Adapter.RowUpdated +=
                new System.Data.OleDb.OleDbRowUpdatedEventHandler(adapter_RowUpdated);
        }
        public MainWindow()
        {
            InitializeComponent();

            // Bind the scheduler to data.
            CarsDBDataSet dataSet = new CarsDBDataSet();

            scheduler.Storage.AppointmentStorage.DataSource = dataSet.CarScheduling;
            CarsDBDataSetTableAdapters.CarSchedulingTableAdapter tableAdapter =
                new CarsDBDataSetTableAdapters.CarSchedulingTableAdapter();
            tableAdapter.Fill(dataSet.CarScheduling);

            scheduler.Storage.ResourceStorage.DataSource = dataSet.Cars;
            CarsDBDataSetTableAdapters.CarsTableAdapter carsAdapter =
                new CarsDBDataSetTableAdapters.CarsTableAdapter();
            carsAdapter.Fill(dataSet.Cars);

            // Set the scheduler start date.
            scheduler.Start = new System.DateTime(2010, 7, 15, 0, 0, 0, 0);

            // Specify the time inteval and start day of week used by the print adapter to create a report.
            printAdapter.TimeInterval =
                new TimeInterval(new DateTime(2010, 7, 15), new DateTime(2010, 7, 30));
            printAdapter.FirstDayOfWeek = FirstDayOfWeek.Wednesday;

            // Specify required printing settings to be passed
            // to the SchedulerPrintHelper.ShowPrintPreview method that is called on a button click.
            printingSettings.ReportInstance        = new XtraSchedulerReport();
            printingSettings.SchedulerPrintAdapter = printAdapter;
            printingSettings.ReportTemplatePath    = "WeeklyStyle.schrepx";
        }
示例#3
0
        public MainWindow()
        {
            InitializeComponent();

            schedulerControl1.Storage.AppointmentStorage.ResourceSharing = true;
            schedulerControl1.ActiveViewType = DevExpress.XtraScheduler.SchedulerViewType.Week;

            tableAdapterResources.Fill(dataSet.Cars);
            tableAdapterAppointments.Fill(dataSet.CarScheduling);

            schedulerControl1.Storage.ResourceStorage.DataSource    = dataSet.Cars;
            schedulerControl1.Storage.AppointmentStorage.DataSource = dataSet.CarScheduling;

            schedulerControl1.Start = schedulerControl1.Storage.AppointmentStorage[0].Start;

            schedulerControl1.Storage.AppointmentsInserted +=
                new PersistentObjectsEventHandler(Storage_AppointmentsModified);
            schedulerControl1.Storage.AppointmentsChanged +=
                new PersistentObjectsEventHandler(Storage_AppointmentsModified);
            schedulerControl1.Storage.AppointmentsDeleted +=
                new PersistentObjectsEventHandler(Storage_AppointmentsModified);

            tableAdapterAppointments.Adapter.RowUpdated +=
                new System.Data.SqlClient.SqlRowUpdatedEventHandler(Adapter_RowUpdated);
        }
        public MainWindow()
        {
            InitializeComponent();

            tableAdapterAppointments.Fill(dataSet.CarScheduling);
            tableAdapterResources.Fill(dataSet.Cars);

            schedulerControl1.Storage.ResourceStorage.DataSource    = dataSet.Cars;
            schedulerControl1.Storage.AppointmentStorage.DataSource = dataSet.CarScheduling;

            if (schedulerControl1.Storage.AppointmentStorage.Count > 0)
            {
                schedulerControl1.Start = schedulerControl1.Storage.AppointmentStorage[0].Start;
            }

            schedulerControl1.Storage.AppointmentsInserted += Storage_AppointmentsModified;
            schedulerControl1.Storage.AppointmentsChanged  += Storage_AppointmentsModified;
            schedulerControl1.Storage.AppointmentsDeleted  += Storage_AppointmentsModified;

            tableAdapterAppointments.Adapter.RowUpdated += adapter_RowUpdated;

            if (schedulerControl1.Storage.AppointmentStorage.Count > 0)
            {
                schedulerControl1.Start = schedulerControl1.Storage.AppointmentStorage[0].Start;
            }
        }