Changeset 25 for trunk/Modules/Attendance
- Timestamp:
- Nov 19, 2012, 2:08:02 PM (12 years ago)
- Location:
- trunk/Modules/Attendance
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Attendance/UAttendance.pas
r14 r25 44 44 TUserPassage = class 45 45 Id: Integer; 46 Terminal: TTerminal;47 User: TUser;46 Terminal: Integer; //TTerminal; 47 User: Integer; //TUser; 48 48 Time: TDateTime; 49 Operation: TOperation;49 Operation: Integer; //TOperation; 50 50 end; 51 51 -
trunk/Modules/Attendance/UModuleAttendance.pas
r24 r25 7 7 uses 8 8 Classes, SysUtils, FileUtil, UModularSystem, UFormList, UFormEdit, Controls, 9 SpecializedList, Forms, ActnList, Menus, UDataModel, Dialogs, SpecializedDictionary; 9 SpecializedList, Forms, ActnList, Menus, UDataModel, Dialogs, 10 SpecializedDictionary, USqlDatabase; 10 11 11 12 type … … 102 103 SHoliday = 'Holiday'; 103 104 SLog = 'Log'; 104 SUsersRead = 'User read: %s'; 105 SUsersRead = 'User read: '; 106 SLogCount = 'Log count: '; 105 107 106 108 { TDataModuleAttendance } … … 112 114 UserCount: Integer; 113 115 UserRec: TUser; 116 Passage: TUserPassage; 117 PassageCount: Integer; 114 118 Data: TDictionaryStringString; 115 119 I: Integer; … … 118 122 UserRec := nil; 119 123 AccessControler := nil; 124 Passage := nil; 120 125 try 121 126 VirtualAccessControler := TVirtualTerminalBF630.Create; … … 123 128 VirtualAccessControler.Active := True; 124 129 130 Data := TDictionaryStringString.Create; 131 125 132 AccessControler := TTerminalBF630.Create; 126 133 AccessControler.Active := True; 127 134 UserCount := AccessControler.GetUserCount; 128 129 UserRec := TUser.Create; 130 Data := TDictionaryStringString.Create;135 //ShowMessage(SUsersRead + IntToStr(UserCount)); 136 137 (*UserRec := TUser.Create; 131 138 for I := 0 to UserCount - 1 do begin 132 139 Data.Clear; … … 135 142 Data.Add('SecondName', UserRec.SecondName); 136 143 Core.Database.Insert('User', Data); 137 end; 138 ShowMessage(SUsersRead + IntToStr(UserCount)); 144 end; *) 145 146 PassageCount := AccessControler.GetPassageCount; 147 //ShowMessage(SLogCount + IntToStr(PassageCount)); 148 149 Passage := TUserPassage.Create; 150 for I := 0 to PassageCount - 1 do begin 151 Data.Clear; 152 AccessControler.GetPassage(I, Passage); 153 Data.Add('Terminal', IntToStr(Passage.Terminal)); 154 Data.Add('Operation', IntToStr(Passage.Operation)); 155 Data.Add('Time', DateTimeToSQL(Passage.Time)); 156 Data.Add('User', IntToStr(Passage.User)); 157 Core.Database.Insert('Passage', Data); 158 end; 159 139 160 finally 140 161 if Assigned(Data) then Data.Free; 141 162 if Assigned(UserRec) then UserRec.Free; 163 if Assigned(Passage) then Passage.Free; 142 164 if Assigned(AccessControler) then AccessControler.Free; 143 165 VirtualAccessControler.Free;
Note:
See TracChangeset
for help on using the changeset viewer.