示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }