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); } }
private void SetLvItemProfit(EagleString.ProfitResult pr) { int len = lv2.Items.Count; for (int i = len - 1; i >= 0; --i) { ListViewItem lvi2 = lv2.Items[i]; string flight = lvi2.SubItems[2].Text; //不见航班号,下一条 if (string.IsNullOrEmpty(flight)) { continue; } //不是直飞的航段,城市对不立,下一条 if (ls_av[0].CityPair != (lvi2.SubItems[3].Text + lvi2.SubItems[4].Text)) { continue; } ListViewItem templvi = new ListViewItem(""); for (int j = 0; j < 7; j++) { templvi.SubItems.Add(""); } try { for (int j = 8; j < lvi2.SubItems.Count; j++) { try { if (string.IsNullOrEmpty(lvi2.SubItems[j].Text.Trim())) { templvi.SubItems.Add(""); } else { char bunk = lvi2.SubItems[j].Text[0]; templvi.SubItems.Add(pr.ProfitWithFlightAndBunk(flight, bunk)); } } catch { templvi.SubItems.Add(""); } } } catch { } ListViewItem templvi2 = new ListViewItem(); for (int j = 1; j < templvi.SubItems.Count; j++) { templvi2.SubItems.Add(templvi.SubItems[j].Text); } lv.Items.Insert(i + 1, templvi); lv2.Items.Insert(i + 1, templvi2); } lv.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); lv2.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); }
public static void BlackWindowPolicy(RichTextBox rtb, EagleString.AvResult ar, EagleString.ProfitResult pr) { }