private void RecordAttempt(int readerId, string key, AuthenticationResult credentials, bool login, bool logout, string action)
        {
            using (var db = new AccessControlDatabase()) {
                db.Execute(@"
					INSERT INTO
						attempt (
							reader_id,
							keycode,
							member_id,
							access_granted,
							login,
							logout,
							action,
							attempt_time
						)
					VALUES	(
						@0,
						@1,
						@2,
						@3,
						@4,
						@5,
						@6,
						NOW()
					);"                    ,
                           readerId,
                           key,
                           credentials?.Id ?? -1,
                           credentials?.AccessGranted ?? false,
                           login,
                           logout,
                           action);
            }
        }
Exemple #2
0
        private void RecordAttempt(string readerId, string key, int memberId, bool granted, bool login, bool logout)
        {
            using (var db = new AccessControlDatabase()) {
                db.Execute(@"
					INSERT INTO
						attempt (
							reader_id,
							keycode,
							member_id,
							access_granted,
							login,
							logout,
							attempt_time
						)
					VALUES	(
						@0,
						@1,
						@2,
						@3,
						@4,
						@5,
						NOW()
					);"                    ,
                           readerId,
                           key,
                           memberId,
                           granted,
                           login,
                           logout);
            }
        }
Exemple #3
0
        private void RecordClientAddress(string id, string address)
        {
            using (var db = new AccessControlDatabase()) {
                db.Execute(@"
					UPDATE
						reader
					SET
						address = @0
					WHERE
						reader_id = @1
					LIMIT 1;"                    ,
                           address,
                           id);
            }
        }
        private void RecordClient(int readerId, string address, string version, string status)
        {
            using (var db = new AccessControlDatabase()) {
                db.Execute(@"
					UPDATE
						reader
					SET
						address = @0,
						version = @1,
						status = @2
					WHERE
						reader_id = @3
					LIMIT 1;"                    ,
                           address,
                           version,
                           status,
                           readerId);
            }
        }