private void InitAircraftModelRestriction(string szReqTail, string szReqModel, string szReqICAO, string szcc) { if (!String.IsNullOrEmpty(szReqTail) || !String.IsNullOrEmpty(szReqModel) || !String.IsNullOrEmpty(szReqICAO)) { UserAircraft ua = new UserAircraft(Restriction.UserName); Collection <Aircraft> lstac = new Collection <Aircraft>(); HashSet <int> lstmm = new HashSet <int>(); foreach (Aircraft ac in ua.GetAircraftForUser()) { if (ac.DisplayTailnumber.CompareCurrentCultureIgnoreCase(szReqTail) == 0) { lstac.Add(ac); } MakeModel mm = MakeModel.GetModel(ac.ModelID); if (!lstmm.Contains(mm.MakeModelID) && ((!String.IsNullOrEmpty(szReqModel) && mm.Model.CompareCurrentCultureIgnoreCase(szReqModel) == 0) || (!String.IsNullOrEmpty(szReqICAO) && mm.FamilyName.CompareCurrentCultureIgnoreCase(szReqICAO) == 0))) { lstmm.Add(mm.MakeModelID); } } if (lstac.Count > 0) { Restriction.AirportList.Clear(); Restriction.AddAircraft(lstac); } if (lstmm.Count > 0) { Restriction.MakeList.Clear(); Restriction.AddModels(lstmm); } } if (!String.IsNullOrEmpty(szcc)) { foreach (CategoryClass cc in CategoryClass.CategoryClasses()) { if (cc.CatClass.CompareCurrentCultureIgnoreCase(szcc) == 0) { Restriction.AddCatClass(cc); } } } }