Changeset 15 for trunk/Modules
- Timestamp:
- Nov 15, 2012, 12:34:33 PM (12 years ago)
- Location:
- trunk/Modules/Attendance
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Attendance/UModuleAttendance.lfm
r12 r15 5 5 VerticalOffset = 238 6 6 Width = 380 7 object ActionList1: TActionList 8 Images = FormMain.ImageList1 9 left = 300 10 top = 104 11 object AReadFromTerminal: TAction 12 Caption = 'Read from terminal' 13 Hint = 'Read new data from terminal' 14 OnExecute = AReadFromTerminalExecute 15 end 16 end 7 17 end -
trunk/Modules/Attendance/UModuleAttendance.pas
r14 r15 7 7 uses 8 8 Classes, SysUtils, FileUtil, UModularSystem, UFormList, UFormEdit, Controls, 9 SpecializedList, Forms ;9 SpecializedList, Forms, ActnList, UDataModel; 10 10 11 11 type 12 13 { TDataModuleAttendance } 14 12 15 TDataModuleAttendance = class(TDataModule) 16 AReadFromTerminal: TAction; 17 ActionList1: TActionList; 18 procedure AReadFromTerminalExecute(Sender: TObject); 13 19 private 14 20 { private declarations } … … 21 27 TModuleAttendance = class(TModule) 22 28 private 23 DataViewLists: TListObject; 24 DataViewForms: TListObject; 29 ModelLog: TDataModel; 30 ViewFormLog: TDataViewForm; 31 ViewListLog: TDataViewList; 32 ModelTerminal: TDataModel; 33 ViewFormTerminal: TDataViewForm; 34 ViewListTerminal: TDataViewList; 35 ModelOperation: TDataModel; 36 ViewFormOperation: TDataViewForm; 37 ViewListOperation: TDataViewList; 38 ModelAttendance: TDataModel; 39 ViewFormAttendance: TDataViewForm; 40 ViewListAttendance: TDataViewList; 41 ModelHoliday: TDataModel; 42 ViewFormHoliday: TDataViewForm; 43 ViewListHoliday: TDataViewList; 44 ModelPassage: TDataModel; 45 ViewFormPassage: TDataViewForm; 46 ViewListPassage: TDataViewList; 47 ModelUser: TDataModel; 48 ViewFormUser: TDataViewForm; 49 ViewListUser: TDataViewList; 25 50 procedure InitModels; 26 51 protected … … 74 99 SLog = 'Log'; 75 100 101 { TDataModuleAttendance } 102 103 procedure TDataModuleAttendance.AReadFromTerminalExecute(Sender: TObject); 104 begin 105 106 end; 107 76 108 77 109 { TModuleAttendance } … … 81 113 NewDataView: TDataViewList; 82 114 NewDataView2: TDataViewForm; 83 begin 84 NewDataView := TDataViewList.Create; 85 with NewDataView do begin 115 NewModel: TDataModel; 116 begin 117 ModelUser := TDataModel.Create; 118 with ModelUser do begin 119 with Items do begin 120 AddItem(SEnabled, 'Enabled', dtBoolean); 121 AddItem(SPersonalId, 'PersonalId', dtString); 122 AddItem(SLogin, 'Login', dtString); 123 AddItem(SPassword, 'Password', dtString); 124 AddItem(SFirstName, 'FirstName', dtString); 125 AddItem(SSecondName, 'SecondName', dtString); 126 AddItem(SCardCode, 'CardCode', dtString); 127 AddItem(SFingerPrint, 'FingerPrint', dtString); 128 AddItem(SNote, 'Note', dtText); 129 end; 130 Name := 'User'; 131 Caption := SUser; 132 end; 133 ViewListUser := TDataViewList.Create; 134 with ViewListUser do begin 86 135 with Columns do begin 87 136 AddItem(SEnabled, 'Enabled', True, 30); … … 99 148 ImageIndex := 9; 100 149 end; 101 DataViewLists.Add(NewDataView); 102 FormMain.RegisterDataViewList(NewDataView); 103 NewDataView2 := TDataViewForm.Create; 104 with NewDataView2 do begin 150 FormMain.RegisterDataViewList(ViewListUser); 151 ViewFormUser := TDataViewForm.Create; 152 with ViewFormUser do begin 105 153 Name := 'User'; 106 154 Caption := SUser; … … 117 165 end; 118 166 end; 119 DataViewForms.Add(NewDataView2); 120 FormMain.RegisterDataViewForm(NewDataView2); 121 122 NewDataView := TDataViewList.Create; 123 with NewDataView do begin 167 FormMain.RegisterDataViewForm(ViewFormUser); 168 169 ViewListPassage := TDataViewList.Create; 170 with ViewListPassage do begin 124 171 with Columns do begin 125 172 AddItem(STime, 'Time', True, 150); … … 132 179 ImageIndex := 12; 133 180 end; 134 DataViewLists.Add(NewDataView); 135 FormMain.RegisterDataViewList(NewDataView); 136 NewDataView2 := TDataViewForm.Create; 137 with NewDataView2 do begin 181 FormMain.RegisterDataViewList(ViewListPassage); 182 ViewFormPassage := TDataViewForm.Create; 183 with ViewFormPassage do begin 138 184 with Items do begin 139 185 AddItem(STime, 'Time', ctDate, True, Bounds(0, 0, 1, 1)); … … 149 195 ImageIndex := 12; 150 196 end; 151 DataViewForms.Add(NewDataView2); 152 FormMain.RegisterDataViewForm(NewDataView2); 153 154 NewDataView := TDataViewList.Create; 155 with NewDataView do begin 197 FormMain.RegisterDataViewForm(ViewFormPassage); 198 199 ViewListAttendance := TDataViewList.Create; 200 with ViewListAttendance do begin 156 201 with Columns do begin 157 202 AddItem(SDate, 'Date', True, 80); … … 164 209 ImageIndex := 14; 165 210 end; 166 DataViewLists.Add(NewDataView); 167 FormMain.RegisterDataViewList(NewDataView); 168 NewDataView2 := TDataViewForm.Create; 169 with NewDataView2 do begin 211 FormMain.RegisterDataViewList(ViewListAttendance); 212 ViewFormAttendance := TDataViewForm.Create; 213 with ViewFormAttendance do begin 170 214 with Items do begin 171 215 AddItem(SUser, 'User', ctReference, True, Bounds(1, 0, 1, 1)); … … 178 222 ImageIndex := 14; 179 223 end; 180 DataViewForms.Add(NewDataView2); 181 FormMain.RegisterDataViewForm(NewDataView2); 182 183 NewDataView := TDataViewList.Create; 184 with NewDataView do begin 224 FormMain.RegisterDataViewForm(ViewFormAttendance); 225 226 ViewListHoliday := TDataViewList.Create; 227 with ViewListHoliday do begin 185 228 with Columns do begin 186 229 AddItem(SEnabled, 'Enabled', True, 30); … … 194 237 ImageIndex := 10; 195 238 end; 196 DataViewLists.Add(NewDataView); 197 FormMain.RegisterDataViewList(NewDataView); 198 199 NewDataView := TDataViewList.Create; 200 with NewDataView do begin 239 FormMain.RegisterDataViewList(ViewListHoliday); 240 ViewFormHoliday := TDataViewForm.Create; 241 with ViewFormHoliday do begin 242 with Items do begin 243 AddItem(SEnabled, 'Enabled', ctCheckBox, True, Bounds(1, 0, 1, 1)); 244 AddItem(SName, 'Name', ctEdit, True, Bounds(3, 0, 1, 1)); 245 AddItem(SDay, 'Day', ctSpinEdit, True, Bounds(1, 1, 1, 1)); 246 AddItem(SMonth, 'Month', ctSpinEdit, True, Bounds(3, 1, 1, 1)); 247 AddItem(SYear, 'Year', ctSpinEdit, True, Bounds(1, 2, 1, 1)); 248 end; 249 Name := 'Holiday'; 250 Caption := SHoliday; 251 ImageIndex := 10; 252 end; 253 FormMain.RegisterDataViewForm(ViewFormHoliday); 254 255 ViewListOperation := TDataViewList.Create; 256 with ViewListOperation do begin 201 257 with Columns do begin 202 258 AddItem(SName, 'Name', True, 100); … … 207 263 ImageIndex := 13; 208 264 end; 209 DataViewLists.Add(NewDataView); 210 FormMain.RegisterDataViewList(NewDataView); 211 212 NewDataView := TDataViewList.Create; 213 with NewDataView do begin 265 FormMain.RegisterDataViewList(ViewListOperation); 266 ViewFormOperation := TDataViewForm.Create; 267 with ViewFormOperation do begin 268 with Items do begin 269 AddItem(SName, 'Name', ctEdit, True, Bounds(1, 0, 1, 1)); 270 AddItem(SKeyNumber, 'KeyId', ctEdit, True, Bounds(3, 0, 1, 1)); 271 end; 272 Name := 'Operation'; 273 Caption := SOperation; 274 ImageIndex := 13; 275 end; 276 FormMain.RegisterDataViewForm(ViewFormOperation); 277 278 ViewListTerminal := TDataViewList.Create; 279 with ViewListTerminal do begin 214 280 with Columns do begin 215 281 AddItem(SName, 'Name', True, 80); … … 224 290 ImageIndex := 8; 225 291 end; 226 DataViewLists.Add(NewDataView); 227 FormMain.RegisterDataViewList(NewDataView); 228 229 NewDataView := TDataViewList.Create; 230 with NewDataView do begin 292 FormMain.RegisterDataViewList(ViewListTerminal); 293 ViewFormTerminal := TDataViewForm.Create; 294 with ViewFormTerminal do begin 295 with Items do begin 296 AddItem(SName, 'Name', ctEdit, True, Bounds(1, 0, 1, 1)); 297 AddItem(SEnabled, 'Enabled', ctCheckBox, True, Bounds(3, 0, 1, 1)); 298 AddItem(SAddress, 'Address', ctEdit, True, Bounds(1, 1, 1, 1)); 299 AddItem(SPort, 'Port', ctSpinEdit, True, Bounds(3, 1, 1, 1)); 300 AddItem(SType, 'Type', ctComboBox, True, Bounds(1, 2, 1, 1)); 301 AddItem(SNote, 'Note', ctMemo, True, Bounds(3, 2, 1, 1)); 302 end; 303 Name := 'Terminal'; 304 Caption := STerminal; 305 ImageIndex := 8; 306 end; 307 FormMain.RegisterDataViewForm(ViewFormTerminal); 308 309 ViewListLog := TDataViewList.Create; 310 with ViewListLog do begin 231 311 with Columns do begin 232 312 AddItem(STime, 'Time', True, 120); … … 238 318 ImageIndex := 11; 239 319 end; 240 DataViewLists.Add(NewDataView); 241 FormMain.RegisterDataViewList(NewDataView); 320 FormMain.RegisterDataViewList(ViewListLog); 321 ViewFormLog := TDataViewForm.Create; 322 with ViewFormLog do begin 323 with Items do begin 324 AddItem(STime, 'Time', ctDateTime, True, Bounds(1, 0, 1, 1)); 325 AddItem(SUser, 'User', ctReference, True, Bounds(3, 0, 1, 1)); 326 AddItem(SText, 'Text', ctEdit, True, Bounds(1, 1, 1, 1)); 327 end; 328 Name := 'Log'; 329 Caption := SLog; 330 ImageIndex := 11; 331 end; 332 FormMain.RegisterDataViewForm(ViewFormLog); 242 333 end; 243 334 … … 247 338 Application.Title := SAttendance; 248 339 FormMain.Caption := SAttendance; 249 DataViewLists := TListObject.Create;250 DataViewForms := TListObject.Create;251 340 DataModuleAttendance := TDataModuleAttendance.Create(FormMain); 252 341 InitModels; … … 257 346 I: Integer; 258 347 begin 259 for I := 0 to DataViewLists.Count - 1 do 260 FormMain.UnregisterDataViewList(TDataViewList(DataViewLists[I])); 261 FreeAndNil(DataViewLists); 262 for I := 0 to DataViewForms.Count - 1 do 263 FormMain.UnregisterDataViewForm(TDataViewForm(DataViewForms[I])); 264 FreeAndNil(DataViewForms); 348 FormMain.UnregisterDataViewList(ViewListUser); 349 FormMain.UnregisterDataViewForm(ViewFormUser); 350 FormMain.UnregisterDataViewList(ViewListAttendance); 351 FormMain.UnregisterDataViewForm(ViewFormAttendance); 352 FormMain.UnregisterDataViewList(ViewListHoliday); 353 FormMain.UnregisterDataViewForm(ViewFormHoliday); 354 FormMain.UnregisterDataViewList(ViewListLog); 355 FormMain.UnregisterDataViewForm(ViewFormLog); 356 FormMain.UnregisterDataViewList(ViewListOperation); 357 FormMain.UnregisterDataViewForm(ViewFormOperation); 358 FormMain.UnregisterDataViewList(ViewListPassage); 359 FormMain.UnregisterDataViewForm(ViewFormPassage); 360 FormMain.UnregisterDataViewList(ViewListTerminal); 361 FormMain.UnregisterDataViewForm(ViewFormTerminal); 265 362 FreeAndNil(DataModuleAttendance); 266 363 inherited DoStop;
Note:
See TracChangeset
for help on using the changeset viewer.