Esempio n. 1
0
        private void UpdateStatus()
        {
            if ((Changed) & (!Silent))
            {
                MileCardStatusList mcsList = new MileCardStatusList();
                mcsList.Load();

                Predicate <MileCardStatus> pred = mcs =>
                {
                    return((mcs.AviaCompanyID == AviaCompanyID)
                           & (mcs.AviaCompanyUnionID == AviaCompanyUnionID)
                           & (mcs.MinVal < MilesCount)
                           & ((mcs.MaxVal == 0) | (mcs.MaxVal > MilesCount)));
                };

                MileCardStatus mcs0 = mcsList.Find(pred);

                if (mcs0 != null)
                {
                    mileCardStatus.ID = mcs0.ID;
                }
                else
                {
                    mileCardStatus.ID = -1;
                }
                mileCardStatus.Load();
            }
        }
Esempio n. 2
0
        public MileCard(PersonGeneral personOwner)
        {
            ID      = -1;
            Changed = false;
            Silent  = false;

            this.personOwner = personOwner;
            personResponded  = null;

            aviacompany      = new AviaCompany();
            aviacompanyunion = new AviaCompanyUnion();
            mileCardStatus   = new MileCardStatus();
        }