Esempio n. 1
0
 public FlightVM()
 {
     service = new FlightService();
     Flights = new ObservableCollection <Flight>();
     ListInit();
 }
Esempio n. 2
0
 public FlightsController(FlightService flightService)
 {
     _flightService = flightService;
 }
 public HomeController(AirportService airS, CommentService CommentS, ReservationService ResS, FlightInfService flightIS, FlightService Fs)
 {
     this.airS     = airS;
     this.ResS     = ResS;
     this.CommentS = CommentS;
     this.Fs       = Fs;
     this.flightIS = flightIS;
 }
Esempio n. 4
0
 public FlightLogic()
 {
     FlightService = new FlightService();
     this.InitializeComponent();
 }
Esempio n. 5
0
 public FlightController()
 {
     this.flightService = new FlightService();
 }
Esempio n. 6
0
 public ManipulateWithDbTests()
 {
     uow           = new UnitOfWork();
     service       = new AircraftService(uow);
     serviceFlight = new FlightService(uow);
 }
 public FlightController(FlightService flightsService)
 {
     this.FlightService = flightsService;
 }
Esempio n. 8
0
 public FlightDestineService(IBusinessmanRepository businessmanRepository, IPidService PidService)
 {
     currentUser          = AuthManager.GetCurrentUser();
     flightDestineService = new FlightService(businessmanRepository, currentUser);
     this.PidService      = PidService;
 }
Esempio n. 9
0
 public FlightController(FlightService fService)
 {
     _fService = fService;
 }
 public FlightViewModel()
 {
     _flightService = new FlightService();
 }
Esempio n. 11
0
        public async Task <IEnumerable <GateViewModel> > GetAllFlights()
        {
            var gates = await FlightService.GetAllFlightsAsync();

            return(gates.Select(g => TheModelFactory.Create(g)));
        }
 FlightController()
 {
     //instantiate fliService class
     fs = new FlightService();
 }
Esempio n. 13
0
 public PurchasablesController(VacationService vService, FlightService fService)
 {
     _vService = vService;
     _fService = fService;
 }
Esempio n. 14
0
 public void OneTimeTearDown()
 {
     System.Diagnostics.Debug.WriteLine("OneTimeTearDown is called");
     sut = null;
 }
Esempio n. 15
0
 public void OneTimeSetUp()
 {
     System.Diagnostics.Debug.WriteLine("OneTimeSetup is called");
     sut = new FlightService();
 }
Esempio n. 16
0
        /// <summary>
        /// 获取IBE数据
        /// </summary>
        /// <param name="FromCode"></param>
        /// <param name="ToCode"></param>
        /// <param name="FlyDate"></param>
        /// <returns></returns>
        public AVHData GetAvh(string FromCode, string ToCode, DateTime FlyDate, string carrayCode)
        {
            AVHData ibeData = new AVHData();
            //记录日志
            StringBuilder sbLog = new StringBuilder();

            sbLog.Append("参数:\r\nFromCode=" + FromCode + "\r\n ToCode=" + ToCode + "\r\n FlyDate=" + FlyDate.ToString("yyyy-MM-dd HH:mm:ss") + (carrayCode != null ? carrayCode : ""));
            try
            {
                ibeData.IbeData    = new List <IBERow>();
                ibeData.QueryParam = new QueryParam()
                {
                    FromCode = FromCode,
                    ToCode   = ToCode,
                    FlyDate  = FlyDate.ToString("yyy-MM-dd"),
                    FlyTime  = "00:00:00"
                };
                string strData = string.Empty;
                if (useProxyQuery == 0)
                {
                    IBEService.WebService1SoapClient ibe = new IBEService.WebService1SoapClient();
                    strData = ibe.getIBEAVData(ibeData.QueryParam.FromCode, ibeData.QueryParam.ToCode, ibeData.QueryParam.FlyDate, ibeData.QueryParam.FlyTime);
                }
                else if (useProxyQuery == 1)
                {
                    FlightService flightService = ObjectFactory.GetInstance <FlightService>();
                    strData = flightService.GetAV(this.QueryParam.Code, ibeData.QueryParam.FromCode, ibeData.QueryParam.ToCode, carrayCode, ibeData.QueryParam.FlyDate, "0000");
                }
                ibeData.AVHString = strData;
                if (!strData.Contains("NoRoutingException"))
                {
                    string[] IbeArray = strData.Split(new string[] { "^" }, StringSplitOptions.RemoveEmptyEntries);
                    if (IbeArray != null && IbeArray.Length > 0)
                    {
                        string[] strRow = null;
                        foreach (string row in IbeArray)
                        {
                            strRow = row.ToUpper().Split(',');
                            if (strRow.Length >= 15)
                            {
                                IBERow ibeRow = new IBERow();
                                try
                                {
                                    //检测日期格式是否正确
                                    DateTime.Parse(strRow[0]);
                                }
                                catch
                                {
                                    strRow[0] = ibeData.QueryParam.FlyDate;
                                }
                                ibeRow.FlyDate     = strRow[0];
                                ibeRow.StartTime   = strRow[1];
                                ibeRow.EndTime     = strRow[2];
                                ibeRow.CarrierCode = strRow[3].Trim(new char[] { '*' });
                                //过滤航空公司
                                if (!string.IsNullOrEmpty(carrayCode))
                                {
                                    if (ibeRow.CarrierCode != carrayCode.ToUpper())
                                    {
                                        continue;
                                    }
                                }
                                ibeRow.FlightNo = strRow[4].Trim(new char[] { '*' });
                                if (!string.IsNullOrEmpty(strRow[5]) && strRow[5].Split('*')[0].Trim() != "")
                                {
                                    string          strSeat = strRow[5].Split('*')[0].Trim();
                                    string          pattern = "((?<Seat>[0-9A-Z])(?<SeatSymbol>[0-9A-Z]))";
                                    MatchCollection mchs    = Regex.Matches(strSeat, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
                                    ibeRow.IBESeat = new List <IbeSeat>();
                                    foreach (Match item in mchs)
                                    {
                                        if (item.Success)
                                        {
                                            IbeSeat ibeseat = new IbeSeat();
                                            ibeseat.Seat       = item.Groups["Seat"].Value.Trim();
                                            ibeseat.SeatSymbol = item.Groups["SeatSymbol"].Value.Trim();
                                            if (ibeseat.SeatSymbol == "A")
                                            {
                                                ibeseat.SeatCount = ">9";
                                            }
                                            else if (char.IsNumber(ibeseat.SeatSymbol[0]))
                                            {
                                                ibeseat.SeatCount = ibeseat.SeatSymbol;
                                            }
                                            else
                                            {
                                                ibeseat.SeatCount = "0";
                                            }
                                            //过滤没有位置的舱位
                                            int mSeatCount = 0;
                                            int.TryParse(ibeseat.SeatCount.Replace(">", ""), out mSeatCount);
                                            if (mSeatCount > 0)
                                            {
                                                ibeseat = SetDefaultData(ibeseat);
                                                //去重
                                                if (!ibeRow.IBESeat.Exists(p => p.Seat == ibeseat.Seat))
                                                {
                                                    ibeRow.IBESeat.Add(ibeseat);
                                                }
                                            }
                                        }
                                    }
                                }
                                ibeRow.FromCode           = strRow[6];
                                ibeRow.ToCode             = strRow[7];
                                ibeRow.AirModel           = strRow[8];
                                ibeRow.IsStop             = strRow[9].Trim() == "1" ? true : false;
                                ibeRow.IsMeals            = strRow[10].Trim() == "1" ? true : false;
                                ibeRow.IsElectronicTicket = strRow[11].Trim() == "1" ? true : false;
                                ibeRow.IsShareFlight      = (strRow[12].Trim().ToLower() == "1" || strRow[12].Trim().ToLower() == "true") ? true : false;
                                //处理子舱位
                                ibeRow.ChildSeat = strRow[13].Trim();
                                if (!string.IsNullOrEmpty(ibeRow.ChildSeat))
                                {
                                    string          pattern = "((?<Seat>[0-9A-Z]1)(?<SeatSymbol>[0-9A-Z]))";
                                    MatchCollection mchs    = Regex.Matches(ibeRow.ChildSeat, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
                                    if (ibeRow.IBESeat == null)
                                    {
                                        ibeRow.IBESeat = new List <IbeSeat>();
                                    }
                                    foreach (Match item in mchs)
                                    {
                                        if (item.Success)
                                        {
                                            IbeSeat ibeseat = new IbeSeat();
                                            ibeseat.Seat       = item.Groups["Seat"].Value.Trim();
                                            ibeseat.SeatSymbol = item.Groups["SeatSymbol"].Value.Trim();
                                            if (ibeseat.SeatSymbol == "A")
                                            {
                                                ibeseat.SeatCount = ">9";
                                            }
                                            else if (char.IsNumber(ibeseat.SeatSymbol[0]))
                                            {
                                                ibeseat.SeatCount = ibeseat.SeatSymbol;
                                            }
                                            else
                                            {
                                                ibeseat.SeatCount = "0";
                                            }
                                            //过滤没有位置的舱位
                                            int mSeatCount = 0;
                                            int.TryParse(ibeseat.SeatCount.Replace(">", ""), out mSeatCount);
                                            if (mSeatCount > 0)
                                            {
                                                ibeseat = SetDefaultData(ibeseat);
                                                //去重
                                                if (!ibeRow.IBESeat.Exists(p => p.Seat == ibeseat.Seat))
                                                {
                                                    ibeRow.IBESeat.Add(ibeseat);
                                                }
                                            }
                                        }
                                    }
                                }
                                string strFromCityT1 = strRow[14].Trim();
                                if (strFromCityT1.Length == 2)
                                {
                                    strFromCityT1 = strFromCityT1.Substring(0, 1);
                                }
                                else if (strFromCityT1.Length == 3)
                                {
                                    if (strFromCityT1.StartsWith("D"))
                                    {
                                        strFromCityT1 = strFromCityT1.Substring(0, 1);
                                    }
                                    else
                                    {
                                        strFromCityT1 = strFromCityT1.Substring(0, 2);
                                    }
                                }
                                else
                                {
                                    if ((strFromCityT1.Length >= 2))
                                    {
                                        strFromCityT1 = strFromCityT1.Substring(0, 2);
                                    }
                                }
                                ibeRow.FromCityT1 = getHZL(ibeRow.FromCode, ibeRow.CarrierCode, strFromCityT1);

                                string strToCityT1 = strRow[14].Trim();
                                if (strToCityT1.Length == 2)
                                {
                                    strToCityT1 = strToCityT1.Substring(1, 1);
                                }
                                else if (strToCityT1.Length == 3)
                                {
                                    if (strToCityT1.StartsWith("D"))
                                    {
                                        strToCityT1 = strToCityT1.Substring(1, 2);
                                    }
                                    else
                                    {
                                        strToCityT1 = strToCityT1.Substring(2, 1);
                                    }
                                }
                                else
                                {
                                    if ((strToCityT1.Length >= 4))
                                    {
                                        strToCityT1 = strToCityT1.Substring(2, 2);
                                    }
                                }
                                ibeRow.ToCityT1 = getHZL(ibeRow.ToCode, ibeRow.CarrierCode, strToCityT1);

                                if (ibeRow.IsShareFlight)
                                {
                                    if (IsOpenShareflght)//过滤共享航班
                                    {
                                        //过去完后添加集合
                                        ibeData.IbeData.Add(ibeRow);
                                    }
                                }
                                else
                                {
                                    //添加集合
                                    ibeData.IbeData.Add(ibeRow);
                                }
                            }
                        }
                    }
                }
                else
                {
                    sbLog.Append("IBE异常信息:" + strData + "\r\n");
                }
            }
            catch (Exception ex)
            {
                sbLog.Append("异常信息:" + ex.Message + "\r\n");
                //记录日志
                log.WriteLog("GetAvh", sbLog.ToString());
            }
            return(ibeData);
        }