| 1 |
lars |
1 |
|
|
|
2 |
<table class="categorylist">
|
|
|
3 |
<tr>
|
|
|
4 |
<th>Category Name</th>
|
|
|
5 |
<th>Abbreviation</th>
|
|
|
6 |
<th>Estimate Duration</th>
|
|
|
7 |
<th></th>
|
|
|
8 |
</tr>
|
|
|
9 |
<com:TDataList ID="categories"
|
|
|
10 |
RepeatLayout="Raw"
|
|
|
11 |
DataKeyField="ID"
|
|
|
12 |
OnEditCommand="editCategoryItem"
|
|
|
13 |
OnCancelCommand="refreshCategoryList"
|
|
|
14 |
OnUpdateCommand="updateCategoryItem"
|
|
|
15 |
OnDeleteCommand="deleteCategoryItem">
|
|
|
16 |
|
|
|
17 |
<prop:ItemTemplate>
|
|
|
18 |
<tr>
|
|
|
19 |
<td class="categoryName"><%# h($this->DataItem->Name) %></td>
|
|
|
20 |
<td class="abbrev"><%# h($this->DataItem->Abbreviation) %></td>
|
|
|
21 |
<td class="duration"><%# h($this->DataItem->EstimateDuration) %></td>
|
|
|
22 |
<td class="edit">
|
|
|
23 |
<com:TButton Text="Edit" CommandName="edit"/>
|
|
|
24 |
<com:TButton Text="Delete" CommandName="delete"
|
|
|
25 |
Attributes.onclick="if(!confirm('Are you sure?')) return false;" />
|
|
|
26 |
</td>
|
|
|
27 |
</tr>
|
|
|
28 |
</prop:ItemTemplate>
|
|
|
29 |
|
|
|
30 |
<prop:EditItemTemplate>
|
|
|
31 |
<tr>
|
|
|
32 |
<td class="categoryName">
|
|
|
33 |
<com:TTextBox ID="name" Text=<%# $this->DataItem->Name %> />
|
|
|
34 |
<span class="required">*</span>
|
|
|
35 |
<com:TRequiredFieldValidator
|
|
|
36 |
ControlToValidate="name"
|
|
|
37 |
Display="None"
|
|
|
38 |
CssClass="validator"
|
|
|
39 |
ControlCssClass="required-input"
|
|
|
40 |
ValidationGroup="category-update"
|
|
|
41 |
ErrorMessage="Please enter the category name." />
|
|
|
42 |
</td>
|
|
|
43 |
<td class="abbrev">
|
|
|
44 |
<com:TTextBox ID="abbrev" Text=<%# $this->DataItem->Abbreviation %> />
|
|
|
45 |
<span class="required">*</span>
|
|
|
46 |
<com:TRequiredFieldValidator
|
|
|
47 |
ControlToValidate="abbrev"
|
|
|
48 |
Display="None"
|
|
|
49 |
CssClass="validator"
|
|
|
50 |
ValidationGroup="category-update"
|
|
|
51 |
ControlCssClass="required-input"
|
|
|
52 |
ErrorMessage="Please enter an abbreviation." />
|
|
|
53 |
<com:TRegularExpressionValidator
|
|
|
54 |
ControlToValidate="abbrev"
|
|
|
55 |
Display="None"
|
|
|
56 |
CssClass="validator"
|
|
|
57 |
ValidationGroup="category-update"
|
|
|
58 |
ControlCssClass="required-input1"
|
|
|
59 |
RegularExpression="[a-zA-Z0-9]*"
|
|
|
60 |
ErrorMessage="Abbreviation must be alphanumeric." />
|
|
|
61 |
</td>
|
|
|
62 |
<td class="duration">
|
|
|
63 |
<com:TTextBox ID="duration" Text=<%# $this->DataItem->EstimateDuration %> />
|
|
|
64 |
<span class="required">*</span>
|
|
|
65 |
<com:TRequiredFieldValidator
|
|
|
66 |
ControlToValidate="duration"
|
|
|
67 |
Display="None"
|
|
|
68 |
CssClass="validator"
|
|
|
69 |
ValidationGroup="category-update"
|
|
|
70 |
ControlCssClass="required-input"
|
|
|
71 |
ErrorMessage="Please enter a duration." />
|
|
|
72 |
<com:TRangeValidator
|
|
|
73 |
ControlToValidate="duration"
|
|
|
74 |
DataType="Float"
|
|
|
75 |
MinValue="0"
|
|
|
76 |
MaxValue="9999"
|
|
|
77 |
CssClass="validator"
|
|
|
78 |
Display="None"
|
|
|
79 |
ValidationGroup="category-update"
|
|
|
80 |
ControlCssClass="required-input1"
|
|
|
81 |
ErrorMessage="Duration must be between 0 and 9999." />
|
|
|
82 |
</td>
|
|
|
83 |
<td class="edit">
|
|
|
84 |
<com:TButton Text="Save" CommandName="update" ValidationGroup="category-update"/>
|
|
|
85 |
<com:TButton Text="Cancel" CommandName="cancel" />
|
|
|
86 |
</td>
|
|
|
87 |
</tr>
|
|
|
88 |
</prop:EditItemTemplate>
|
|
|
89 |
|
|
|
90 |
</com:TDataList>
|
|
|
91 |
<tr>
|
|
|
92 |
<td class="categoryName">
|
|
|
93 |
<com:TTextBox ID="categoryName" />
|
|
|
94 |
<com:TRequiredFieldValidator
|
|
|
95 |
ControlToValidate="categoryName"
|
|
|
96 |
Display="None"
|
|
|
97 |
CssClass="validator"
|
|
|
98 |
ValidationGroup="category-add"
|
|
|
99 |
ControlCssClass="required-input"
|
|
|
100 |
ErrorMessage="Please enter the category name." />
|
|
|
101 |
</td>
|
|
|
102 |
|
|
|
103 |
<td class="abbrev">
|
|
|
104 |
<com:TTextBox ID="abbrev" />
|
|
|
105 |
<com:TRequiredFieldValidator
|
|
|
106 |
ControlToValidate="abbrev"
|
|
|
107 |
Display="None"
|
|
|
108 |
CssClass="validator"
|
|
|
109 |
ValidationGroup="category-add"
|
|
|
110 |
ControlCssClass="required-input"
|
|
|
111 |
ErrorMessage="Please enter an abbreviation." />
|
|
|
112 |
<com:TRegularExpressionValidator
|
|
|
113 |
ControlToValidate="abbrev"
|
|
|
114 |
Display="None"
|
|
|
115 |
CssClass="validator"
|
|
|
116 |
ValidationGroup="category-add"
|
|
|
117 |
RegularExpression="[a-zA-Z0-9]*"
|
|
|
118 |
ControlCssClass="required-input1"
|
|
|
119 |
ErrorMessage="Abbreviation must be alphanumeric." />
|
|
|
120 |
</td>
|
|
|
121 |
|
|
|
122 |
<td class="duration">
|
|
|
123 |
<com:TTextBox ID="duration" />
|
|
|
124 |
<com:TRequiredFieldValidator
|
|
|
125 |
ControlToValidate="duration"
|
|
|
126 |
Display="None"
|
|
|
127 |
CssClass="validator"
|
|
|
128 |
ValidationGroup="category-add"
|
|
|
129 |
ControlCssClass="required-input"
|
|
|
130 |
ErrorMessage="Please enter a duration." />
|
|
|
131 |
<com:TRangeValidator
|
|
|
132 |
ControlToValidate="duration"
|
|
|
133 |
DataType="Float"
|
|
|
134 |
MinValue="0"
|
|
|
135 |
MaxValue="9999"
|
|
|
136 |
CssClass="validator"
|
|
|
137 |
Display="None"
|
|
|
138 |
ValidationGroup="category-add"
|
|
|
139 |
ControlCssClass="required-input1"
|
|
|
140 |
ErrorMessage="Duration must be between 0 and 9999." />
|
|
|
141 |
</td>
|
|
|
142 |
<td class="edit">
|
|
|
143 |
<com:TButton Text="Add Category" OnClick="addCategory_clicked" ValidationGroup="category-add" />
|
|
|
144 |
</td>
|
|
|
145 |
</tr>
|
|
|
146 |
</table>
|
|
|
147 |
<com:TValidationSummary
|
|
|
148 |
AutoUpdate="false"
|
|
|
149 |
ValidationGroup="category-add" />
|
|
|
150 |
<com:TValidationSummary
|
|
|
151 |
AutoUpdate="false"
|
|
|
152 |
ValidationGroup="category-update" />
|