public static Person FindPersonByPunishment(this DBset <Punishment> dBset, int UserId) { Person _person = new Person(); foreach (Person person in DBcontext.People.GetAll()) { if (person.Id == UserId) { _person = person; } } return(_person); }
public static Punishment GetPunishmentBetweenRange(this DBset <Punishment> dBset, DateTime startDate, DateTime endDate) { Punishment _punishment = new Punishment(); foreach (Punishment punishment in DBcontext.Punishments.GetAll()) { if (punishment.PunishDate > startDate && punishment.PunishDate < endDate) { _punishment = punishment; } } return(_punishment); }
public override void UpdateItem(Flight item) { Flight f = DBset.Find(item.ID); if (f != null) { f.AirplaneID = item.AirplaneID; f.StartCityID = item.StartCityID; f.FinishCityID = item.FinishCityID; f.Time = item.Time; } base.UpdateItem(f); }