void SetupMappings(ASPxScheduler control)
 {
     ASPxSchedulerStorage storage = control.Storage;
     storage.BeginUpdate();
     try
     {
         ASPxAppointmentMappingInfo appMappings =
         storage.Appointments.Mappings;
         appMappings.AppointmentId = "idControlHorario";
         appMappings.Start = "horaEntrada";
         appMappings.End = "horaSalida";
         appMappings.Subject = "titulo";
         //appMappings.Description = "descripcion";
         //appMappings.Location = "Location";
         //  appMappings.AllDay =  "AllDay" ;
         appMappings.Type = "EventType";
         //appMappings.RecurrenceInfo = "RecurrenceInfo";
         //appMappings.ReminderInfo = "ReminderInfo";
         appMappings.Label = "label";
         //appMappings.Status = "Status";
     }
     finally
     {
         storage.EndUpdate();
     }
 }
        protected override void OnDeactivated()
        {
            ASPxSchedulerListEditor editor = View.Editor as ASPxSchedulerListEditor;

            if (editor != null)
            {
                ASPxScheduler scheduler = ((ASPxSchedulerListEditor)editor).SchedulerControl;
                if (scheduler != null)
                {
                    scheduler.Load -= scheduler_Load;
                }
                base.OnDeactivated();
            }
        }
        protected override void OnViewControlsCreated()
        {
            base.OnViewControlsCreated();
            ASPxSchedulerListEditor editor = View.Editor as ASPxSchedulerListEditor;

            if (editor != null)
            {
                ASPxScheduler scheduler = ((ASPxSchedulerListEditor)editor).SchedulerControl;
                if (scheduler != null)
                {
                    scheduler.Load += scheduler_Load;
                }
            }
        }
    void PrepareChildControls()
    {
        RecurrentAppointmentEditFormTemplateContainer container = (RecurrentAppointmentEditFormTemplateContainer)Parent;
        ASPxScheduler control = container.Control;

        ASPxEditBase[] edits = new ASPxEditBase[] { lblConfirm, rbAction };

        foreach (ASPxEditBase edit in edits)
        {
            edit.ParentSkinOwner = control;
            edit.ParentStyles    = control.Styles.FormEditors;
            edit.ParentImages    = control.Images.FormEditors;
        }

        btnOk.ParentSkinOwner = btnCancel.ParentSkinOwner = control;
    }
    protected void PrepareChildControls()
    {
        AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent;

        scheduler = container.Control;
        if (container.Appointment.Id != null)
        {
            HdnAppId.Value = container.Appointment.Id.ToString();
            HdnType.Value  = container.Appointment.Type.ToString();
        }
        ddlVisit.Value   = container.CustomFields[CustomFieldNames.VISIT_TYPE_ID];
        ddlDoctor.Value  = container.CustomFields[CustomFieldNames.SZ_DOCTOR_ID];
        ddlPatient.Value = container.CustomFields[CustomFieldNames.SZ_PATIENT_ID];
        //AppointmentRecurrenceForm1.EditorsInfo = new EditorsInfo(control, control.Styles.FormEditors, control.Images.FormEditors, control.Styles.Buttons);
        // base.PrepareChildControls();
    }
    protected void ASPxScheduler1_BeforeExecuteCallbackCommand(object sender, SchedulerCallbackCommandEventArgs e)
    {
        ASPxScheduler scheduler = (ASPxScheduler)sender;

        if (Convert.ToDecimal(scheduler.SelectedAppointments[0].CustomFields["Field1"]) > 100m)
        {
            if (e.CommandId == SchedulerCallbackCommandId.MenuAppointment)
            {
                e.Command = new CustomMenuAppointmentCallbackCommand(scheduler);
            }
            if (e.CommandId == SchedulerCallbackCommandId.AppointmentsChange)
            {
                e.Command = new CustomAppointmentsChangeCallbackCommand(scheduler);
            }
        }
    }
 public MyAppointmentFormController(ASPxScheduler control, DevExpress.XtraScheduler.Appointment apt)
     : base(control, apt)
 {
     if (EditedPattern != null && EditedPattern.RecurrenceInfo.Type == RecurrenceType.Weekly)
     {
         int      transition = DetectCrossDayTransition(EditedPattern);
         WeekDays weekDays   = EditedPattern.RecurrenceInfo.WeekDays;
         if (transition < 0)
         {
             EditedPattern.RecurrenceInfo.WeekDays = ShiftWeekDays(weekDays, true);
         }
         else if (transition > 0)
         {
             EditedPattern.RecurrenceInfo.WeekDays = ShiftWeekDays(weekDays, false);
         }
     }
 }
    public static void ProvideRowInsertion(ASPxScheduler control, DataSourceControl dataSource)
    {
        AccessDataSource accessDataSource = dataSource as AccessDataSource;

        if (accessDataSource != null)
        {
            AccessRowInsertionProvider provider = new AccessRowInsertionProvider();
            provider.ProvideRowInsertion(control, accessDataSource);
            return;
        }
        ObjectDataSource objectDataSource = dataSource as ObjectDataSource;

        if (objectDataSource != null)
        {
            ObjectDataSourceRowInsertionProvider provider = new ObjectDataSourceRowInsertionProvider();
            provider.ProvideRowInsertion(control, objectDataSource);
        }
    }
Beispiel #9
0
    void PrepareChildControls()
    {
        GotoDateFormTemplateContainer container = (GotoDateFormTemplateContainer)Parent;
        ASPxScheduler control = container.Control;

        ASPxEditBase[] edits = new ASPxEditBase[] {
            lblDate, edtDate,
            lblView, cbView
        };

        foreach (ASPxEditBase edit in edits)
        {
            edit.ParentSkinOwner = control;
            edit.ParentStyles    = control.Styles.FormEditors;
            edit.ParentImages    = control.Images.FormEditors;
        }

        btnOk.ParentSkinOwner = btnCancel.ParentSkinOwner = control;
    }
Beispiel #10
0
 protected override void OnViewControlsCreated()
 {
     base.OnViewControlsCreated();
     listEditor = View.Editor as ASPxSchedulerListEditor;
     if (listEditor != null)
     {
         ASPxScheduler scheduler = (ASPxScheduler)listEditor.SchedulerControl;
         scheduler.InitAppointmentDisplayText -= scheduler_InitAppointmentDisplayText;
         scheduler.InitAppointmentDisplayText += scheduler_InitAppointmentDisplayText;
         scheduler.OptionsCustomization.AllowAppointmentDrag   = UsedAppointmentType.None;
         scheduler.OptionsCustomization.AllowAppointmentResize = UsedAppointmentType.None;
     }
     // Access and customize the target View control.
     //editor = ((ListView)View).Editor as ASPxSchedulerListEditor;
     //if (editor != null)
     //{
     //    editor.SchedulerControl.AppointmentViewInfoCustomizing += new DevExpress.Web.ASPxScheduler.AppointmentViewInfoCustomizingEventHandler(SchedulerControl_AppointmentViewInfoCustomizing);
     //}
 }
        protected void ASPxScheduler1_BeforeExecuteCallbackCommand(object sender, DevExpress.Web.ASPxScheduler.SchedulerCallbackCommandEventArgs e)
        {
            ASPxScheduler scheduler = (ASPxScheduler)sender;

            if (scheduler.ActiveViewType == SchedulerViewType.Month)
            {
                if (e.CommandId == SchedulerCallbackCommandId.NavigateForward)
                {
                    e.Command = new MyNavigateForwardCallbackCommand((ASPxScheduler)sender);
                }
                else if (e.CommandId == SchedulerCallbackCommandId.NavigateBackward)
                {
                    e.Command = new MyNavigateBackwardCallbackCommand((ASPxScheduler)sender);
                }
            }
            if (e.CommandId == SchedulerCallbackCommandId.SwitchView)
            {
                e.Command = new MySwitchViewCallbackCommand((ASPxScheduler)sender);
            }
        }
Beispiel #12
0
        //protected void ASPxScheduler1_AppointmentInserted(object sender, PersistentObjectsEventArgs e)
        //{
        //    SetAppointmentId(sender, e);
        //}
        //protected void appointmentsDataSource_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
        //{
        //    this.lastInsertedAppointmentId = e.ReturnValue;
        //}
        //void SetAppointmentId(object sender, PersistentObjectsEventArgs e)
        //{
        //    ASPxSchedulerStorage storage = (ASPxSchedulerStorage)sender;
        //    Appointment apt = (Appointment)e.Objects[0];
        //    storage.SetAppointmentId(apt, this.lastInsertedAppointmentId);
        //}
        public static void FillResources(ASPxScheduler control, int count)
        {
            ASPxSchedulerStorage storage = control.Storage;
            string[] Resources = new string[] { "Traning Room A", "Traning Room B", "Traning Romm C", "Traning Room D", "Traning Room E", "Traning Romm F" };
               int[] ResourceID = new int[] { 1, 2, 3, 4, 5, 6 };

            ResourceCollection resources = storage.Resources.Items;
            storage.BeginUpdate();
            try
            {
                int cnt = Math.Min(count, Resources.Length);
                for (int i = 1; i <= cnt; i++)
                {
                    resources.Add(new DevExpress.XtraScheduler.Resource(i, Resources[i - 1]));
                }
            }
            finally
            {
                storage.EndUpdate();
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        this.ASPxScheduler1 = new ASPxScheduler();
        // Enhance performance by switching navbuttons calculations off.
        this.ASPxScheduler1.ActiveView.NavigationButtonVisibility = NavigationButtonVisibility.Never;
        // Use invisible scheduler control.
        ASPxScheduler1.Visible = false;

        ASPxAppointmentStorage appointments = ASPxScheduler1.Storage.Appointments;

        appointments.Mappings.AppointmentId  = "ID";
        appointments.Mappings.Description    = "Description";
        appointments.Mappings.End            = "EndTime";
        appointments.Mappings.RecurrenceInfo = "RecurrenceInfo";
        appointments.Mappings.Start          = "StartTime";
        appointments.Mappings.Subject        = "Subject";
        appointments.Mappings.Type           = "EventType";

        ASPxScheduler1.AppointmentDataSource = ObjectDataSource1;
        ASPxScheduler1.DataBind();
    }
Beispiel #14
0
        private void Scheduler_DataBound(object sender, EventArgs e)
        {
            ASPxSchedulerListEditor listEditor = (ASPxSchedulerListEditor)this.View.Editor;
            ASPxScheduler           scheduler  = listEditor.SchedulerControl;
            List <object>           value      = SchedulerControllerResourceManager.Resources.Value;

            if (SchedulerControllerResourceManager.ActiveViewType.Value != SchedulerViewType.Agenda)
            {
                if (value.Count == 0 && scheduler.Storage.Resources.Items.Count >= 1)
                {
                    WorkflowResource workflowResource = this.CurrentObjectSpace.GetObjects <WorkflowResource>(CriteriaOperator.Parse("ObjectOid == ?", SecuritySystem.CurrentUserId.ToString())).FirstOrDefault();

                    for (int i = 0; i < scheduler.Storage.Resources.Items.Count; i++)
                    {
                        DevExpress.XtraScheduler.Resource res = scheduler.Storage.Resources.Items[i];

                        if (res.Caption.Contains(workflowResource.Description))
                        {
                            value.Add(res.Id);
                            break;
                        }
                    }
                }

                scheduler.SetVisibleResources(value);
            }
            else
            {
                value = new List <object>();

                for (int i = 0; i < scheduler.Storage.Resources.Items.Count; i++)
                {
                    DevExpress.XtraScheduler.Resource res = scheduler.Storage.Resources.Items[i];

                    value.Add(res.Id);
                }

                scheduler.SetVisibleResources(value);
            }
        }
    private static void SetupDefaultMappingsSiteMode(ASPxScheduler control)
    {
        ASPxSchedulerStorage storage = control.Storage;

        storage.BeginUpdate();
        try {
            ASPxAppointmentMappingInfo appointmentMappings = storage.Appointments.Mappings;
            appointmentMappings.AppointmentId = "Id";
            appointmentMappings.Start         = "StartTime";
            appointmentMappings.End           = "EndTime";
            appointmentMappings.Subject       = "Subject";
            appointmentMappings.AllDay        = "AllDay";
            appointmentMappings.Description   = "Description";
            appointmentMappings.Label         = "Label";
            appointmentMappings.Location      = "Location";
            appointmentMappings.Status        = "Status";
            appointmentMappings.Type          = "EventType";
        }
        finally {
            storage.EndUpdate();
        }
    }
Beispiel #16
0
    public static void SetupMappings(ASPxScheduler control)
    {
        ASPxSchedulerStorage       storage  = control.Storage;
        ASPxAppointmentMappingInfo mappings = storage.Appointments.Mappings;

        storage.BeginUpdate();
        try {
            mappings.AppointmentId  = "Id";
            mappings.Start          = "StartTime";
            mappings.End            = "EndTime";
            mappings.Subject        = "Subject";
            mappings.AllDay         = "AllDay";
            mappings.Description    = "Description";
            mappings.Label          = "Label";
            mappings.Location       = "Location";
            mappings.RecurrenceInfo = "RecurrenceInfo";
            mappings.ReminderInfo   = "ReminderInfo";
            mappings.ResourceId     = "OwnerId";
            mappings.Status         = "Status";
            mappings.Type           = "EventType";
        }
        finally {
            storage.EndUpdate();
        }

        ASPxAppointmentCustomFieldMappingCollection customMappings = storage.Appointments.CustomFieldMappings;

        customMappings.BeginUpdate();
        try {
            customMappings.Add(new AppointmentCustomFieldMapping("Price", "Price"));
            customMappings.Add(new AppointmentCustomFieldMapping("ContactInfo", "ContactInfo"));
        }
        finally {
            customMappings.EndUpdate();
        }
    }
Beispiel #17
0
 public DashboardCustomMenuAppointmentCallbackCommand(ASPxScheduler control)
     : base(control)
 {
 }
Beispiel #18
0
 public MyAppointmentFormTemplateContainer(ASPxScheduler control)
     : base(control)
 {
 }
Beispiel #19
0
 public void ProvideRowInsertion(ASPxScheduler control, ObjectDataSource dataSource)
 {
     control.AppointmentsInserted         += control_AppointmentsInserted;
     control.AppointmentCollectionCleared += control_AppointmentCollectionCleared;
     dataSource.Inserted += dataSource_Inserted;
 }
 protected override void PrepareControls(ASPxScheduler scheduler)
 {
     lblInfo.ParentSkinOwner     = scheduler;
     lblInterval.ParentSkinOwner = scheduler;
 }
 public MyNavigateBackwardCallbackCommand(ASPxScheduler control)
     : base(control)
 {
 }
Beispiel #22
0
 public CustomInsertAppointmentCommand(ASPxScheduler scheduler)
     : base(scheduler)
 {
 }
Beispiel #23
0
    public static void BindData(ASPxScheduler navbar, DevExpress.Xpo.Session s, string objectname, string filter = "", params object[] parameter)
    {
        try
        {

            DynamicDataTableClassInfo classInfo = dynamicClasses[objectname];

            if (classInfo != null)
            {
                XPServerCollectionSource ds = new XPServerCollectionSource(s, dynamicClasses[objectname], CriteriaOperator.Parse(filter, parameter));
                navbar.DataSource = ds;
            }
            else
                throw new Exception(string.Format("Đối tượng {0} không tìm thấy trong database. Nếu không có dữ liệu hiển thị thì XPOProfiles để xem điều kiện lọc đúng chưa", objectname));
        }
        catch (Exception ex)
        {
            SiAuto.Main.LogColored(Color.Red, "Loi BindData:" + ex.ToString());
            throw ex;
        }
    }
 public void AttachTo(ASPxScheduler control)
 {
     control.ResourceDataSource    = this.ResourceDataSource;
     control.AppointmentDataSource = this.AppointmentDataSource;
     control.DataBind();
 }
 public static void SetupCustomEventsMappings(ASPxScheduler control)
 {
     SetupDefaultMappingsSiteMode(control);
 }
        void scheduler_Load(object sender, EventArgs e)
        {
            ASPxScheduler scheduler = sender as ASPxScheduler;

            scheduler.Templates.HorizontalResourceHeaderTemplate = new MyHorizontalResourceHeaderTemplate();
        }
 public static void ApplyDefaults(Page page, ASPxScheduler scheduler)
 {
     if (page.IsPostBack)
         return;
     ApplyDefaultsCore(scheduler);
 }
 static void ApplyDefaultsCore(ASPxScheduler scheduler)
 {
     scheduler.Start = BaseDate;
     scheduler.ResourceNavigator.Visibility = ResourceNavigatorVisibility.Never;
     //scheduler.ResourceNavigator.EnableIncreaseDecrease = false;
     scheduler.ActiveView.GroupType = SchedulerGroupType.None;
 }
 public CustomMenuViewCallbackCommand(ASPxScheduler control)
     : base(control) {
 }
Beispiel #30
0
 public MyAppointmentFormController(ASPxScheduler control, Appointment apt)
     : base(control, apt)
 {
 }
Beispiel #31
0
        private static void SetupDefaultMappingsSiteMode(ASPxScheduler control)
        {
            ASPxSchedulerStorage storage = control.Storage;
            storage.BeginUpdate();
            try
            {
                //ASPxResourceMappingInfo resourceMappings = storage.Resources.Mappings;
                //resourceMappings.ResourceId = "OwnerId";
                //resourceMappings.Caption = "Caption";

                ASPxAppointmentMappingInfo appointmentMappings = storage.Appointments.Mappings;
                appointmentMappings.AppointmentId = "Id";
                appointmentMappings.Start = "StartTime";
                appointmentMappings.End = "EndTime";
                appointmentMappings.Subject = "Subject";
                appointmentMappings.AllDay = "AllDay";
                appointmentMappings.Description = "Description";
                appointmentMappings.Label = "Label";
                appointmentMappings.Location = "Location";
                appointmentMappings.RecurrenceInfo = "RecurrenceInfo";
                appointmentMappings.ReminderInfo = "ReminderInfo";
               // appointmentMappings.ResourceId = "OwnerId";
                appointmentMappings.Status = "Status";
                appointmentMappings.Type = "EventType";
            }
            finally
            {
                storage.EndUpdate();
            }
        }
Beispiel #32
0
 public CustomAppointmentSaveCallbackCommand(ASPxScheduler control) : base(control)
 {
 }
Beispiel #33
0
 public CustomUpdateAppointmentCommand(ASPxScheduler scheduler)
     : base(scheduler)
 {
 }
 public void ProvideRowInsertion(ASPxScheduler control, ObjectDataSource dataSource)
 {
     control.AppointmentInserting += new PersistentObjectCancelEventHandler(ControlOnAppointmentInserting);
 }
 public MySwitchViewCallbackCommand(ASPxScheduler control)
     : base(control)
 {
 }
Beispiel #36
0
 public void ProvideRowInsertion(ASPxScheduler control, ObjectDataSource dataSource)
 {
     control.AppointmentsInserted += new PersistentObjectsEventHandler(control_AppointmentsInserted);
     dataSource.Inserted          += new ObjectDataSourceStatusEventHandler(dataSource_Inserted);
 }
Beispiel #37
0
 public CustomNavigateForwardCallbackCommand(ASPxScheduler control)
     : base(control)
 {
 }
 public CustomMenuAppointmentCallbackCommand(ASPxScheduler control)
     : base(control) {
 }
 public CreateAppointmentCallbackCommand(ASPxScheduler control)
     : base(control)
 {
 }