This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
/
RecurrentAppointmentDeleteForm.ascx.cs
89 lines (86 loc) · 5.18 KB
/
RecurrentAppointmentDeleteForm.ascx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
{************************************************************************************}
{ }
{ DO NOT MODIFY THIS FILE! }
{ }
{ It will be overwritten without prompting when a new version becomes }
{ available. All your changes will be lost. }
{ }
{ This file contains the default template and is required for the form }
{ rendering. Improper modifications may result in incorrect behavior of }
{ the appointment form. }
{ }
{ In order to create and use your own custom template, perform the following }
{ steps: }
{ 1. Save a copy of this file with a different name in another location. }
{ 2. Specify the file location as the }
{ 'OptionsForms.RecurrentAppointmentDeleteFormTemplateUrl' }
{ property of the ASPxScheduler control. }
{ 3. If you need to display and process additional controls, you }
{ should accomplish steps 4-6; otherwise, go to step 7. }
{ 4. Create a class, derived from the }
{ RecurrentAppointmentDeleteFormTemplateContainer, }
{ containing additional properties which correspond to your controls. }
{ This class definition can be located within a class file in the App_Code }
{ folder. }
{ 5. Replace RecurrentAppointmentDeleteFormTemplateContainer references in the }
{ template page with the name of the class you've created in step 4. }
{ 6. Handle the RecurrentAppointmentDeleteFormShowing event to create an }
{ instance of the template container class, defined in step 5, and specify }
{ it as the destination container instead of the default one. }
{ 7. Modify the overall appearance of the page and its layout. }
{ }
{************************************************************************************}
*/
using System;
using DevExpress.Web.ASPxScheduler;
using DevExpress.Web;
using DevExpress.Web.ASPxScheduler.Localization;
public partial class RecurrentAppointmentDeleteForm : SchedulerFormControl {
protected override void OnLoad(EventArgs e) {
base.OnLoad(e);
Localize();
}
public override void DataBind() {
base.DataBind();
RecurrentAppointmentDeleteFormTemplateContainer container = (RecurrentAppointmentDeleteFormTemplateContainer)Parent;
rbAction.SelectedIndex = 0;
Localize(container);
ImageProperties imageProperties = container.Control.Images.GetWarningImage(this.Page);
AssignImageProperties(imgWarning, imageProperties);
btnOk.ClientSideEvents.Click = container.ApplyHandler;
btnCancel.ClientSideEvents.Click = container.CancelHandler;
}
void Localize() {
btnOk.Text = ASPxSchedulerLocalizer.GetString(ASPxSchedulerStringId.Form_ButtonOk);
btnCancel.Text = ASPxSchedulerLocalizer.GetString(ASPxSchedulerStringId.Form_ButtonCancel);
if (rbAction.Items.Count == 2) {
ListEditItem seriesItem = rbAction.Items[0];
seriesItem.Text = ASPxSchedulerLocalizer.GetString(ASPxSchedulerStringId.Form_Series);
ListEditItem occurrenceItem = rbAction.Items[1];
occurrenceItem.Text = ASPxSchedulerLocalizer.GetString(ASPxSchedulerStringId.Form_Occurrence);
}
}
void Localize(RecurrentAppointmentDeleteFormTemplateContainer container) {
string formatString = ASPxSchedulerLocalizer.GetString(ASPxSchedulerStringId.Form_ConfirmDelete);
lblConfirm.Text = String.Format(formatString, container.Appointment.Subject);
}
void AssignImageProperties(ASPxImage image, ImageProperties imageProperties) {
image.ImageUrl = EmptyImageProperties.GetGlobalEmptyImage(this.Page).Url;
image.CssClass = imageProperties.SpriteProperties.CssClass;
image.Width = imageProperties.Width;
image.Height = imageProperties.Height;
image.SpriteLeft = imageProperties.SpriteProperties.Left;
image.SpriteTop = imageProperties.SpriteProperties.Top;
}
protected override ASPxEditBase[] GetChildEditors() {
ASPxEditBase[] edits = new ASPxEditBase[] { lblConfirm, rbAction };
return edits;
}
protected override ASPxButton[] GetChildButtons() {
ASPxButton[] buttons = new ASPxButton[] {
btnOk, btnCancel
};
return buttons;
}
}