public CriminalRecord(string characterId, string arrestingOfficerId, Crime crime, bool activecrime) { CharacterId = characterId; OfficerName = arrestingOfficerId; Crime = crime; DateTime = DateTime.Now; ActiveCrime = activecrime; }
public static void InsertCrime(string type, string name, int jailTime, int fine) { var crime = new Crime(type, name, jailTime, fine) { Id = DatabaseManager.GetNextId("crimes") }; crime.Insert(); Crimes.Add(crime); }
public static void UpdateCrimes() { foreach (var crime in DatabaseManager.CrimeTable.Find(FilterDefinition <Crime> .Empty).ToList()) { var filter = Builders <Crime> .Filter.Eq("Id", crime.Id); DatabaseManager.CrimeTable.DeleteOne(filter); } foreach (var setCrime in Crimes) { var InsertCrime = new Crime(setCrime.Type, setCrime.Name, setCrime.JailTime, setCrime.Fine) { Id = DatabaseManager.GetNextId("crimes") }; InsertCrime.Insert(); } }