/// <summary> /// 计算每个航段的价格及返点 /// </summary> public static void CalPnrsPrices(RtResult rtres, LoginInfo li, ref int [] sFare, ref int [] sBuild, ref int [] sFuel, ref double[] sGain, ref int [] sFareY, ref int totalEtdz) { int total = 0; CalPnrsTotalPrice(rtres, li.b2b.webservice, ref totalEtdz, ref sFare, ref sBuild, ref sFuel, ref sFareY); EagleWebService.kernalFunc kf = new EagleWebService.kernalFunc(li.b2b.webservice); EagleString.ProfitResult profitResult; for (int i = 0; i < rtres.SEGMENG.Length; ++i) { profitResult = new ProfitResult( kf.GetPolicies( li.b2b.username, rtres.FLIGHTS[i], rtres.FLIGHTDATES[i].ToShortDateString(), rtres.CITYPAIRS[i] )); string profit = profitResult.ProfitWithFlightAndBunk(rtres.FLIGHTS[i], rtres.BUNKS[i]); try { sGain[i] = double.Parse(profit.Replace("%", "")); } catch { sGain[i] = 0; } } }
private void SetLvProfit() { List <string> flight = new List <string>(); for (int i = 0; i < ls_av.Count; ++i) { flight.AddRange(ls_av[i].Flights); } if (flight.Count == 0) { return; } EagleWebService.kernalFunc fc = new EagleWebService.kernalFunc(m_li.b2b.webservice); string policy = fc.GetPolicies(m_li.b2b.username , string.Join(",", flight.ToArray()) , ls_av[0].FlightDate_DT.ToShortDateString() , ls_av[0].CityPair); EagleString.ProfitResult pr = new EagleString.ProfitResult(policy); if (lv.InvokeRequired) { deleg4SetProfit deleg = SetLvItemProfit; lv.Invoke(deleg, new object[] { pr }); } else { SetLvItemProfit(pr); } }
/// <summary> /// 将返点信息显示在LV_Lowest中 /// </summary> /// <param name="lv"></param> /// <param name="wsaddr"></param> /// <param name="username"></param> /// <param name="dt"></param> /// <param name="cp"></param> private static void ProfitSet_LV_Lowest(ListView lv, string wsaddr, string username, string dt, string cp) { try { EagleWebService.kernalFunc fc = new EagleWebService.kernalFunc(wsaddr); string profitstring = ""; string flightnos = ""; for (int i = 0; i < lv.Items.Count; ++i) { if (i != 0) { flightnos += ","; } flightnos += lv.Items[i].SubItems[1].Text; } profitstring = fc.GetPolicies(username, flightnos, dt, cp); if (lv.InvokeRequired) { if (dg_profit == null) { dg_profit = new deleg4Profit(ProfitSet_LV_Lowest); } lv.Invoke(dg_profit, new object[] { lv, profitstring }); } else { ProfitSet_LV_Lowest(lv, profitstring); } } catch (Exception ex) { EagleString.EagleFileIO.LogWrite("EagleExtension:ProfitSet_LV_Lowest1:" + ex.Message); } }