bool AddFundChangeEventToListView(FundEvent eve) { if (m_currentEventType == "所有" || eve.Type == m_currentEventType) { ListViewItem row = new ListViewItem(); row.Text = (m_fundChangeLV.Items.Count + 1).ToString(); row.SubItems.Add(eve.Account); row.SubItems.Add(eve.Type); row.SubItems.Add(Utility.ConvertDouble(eve.Amount)); if (eve.Type != "刷卡") { row.SubItems.Add("- "); } else { row.SubItems.Add(Utility.ConvertDouble(eve.Charge)); } row.SubItems.Add(eve.DateTime); m_fundChangeLV.Items.Add(row); return(true); } return(false); }
// update and save to file public void AddNewFundEvent(FundEvent eve) { bool newFile = !File.Exists(m_fileName); StreamWriter writer = new StreamWriter(m_fileName, true); if (newFile) { writer.Write("账号名称,资金变动类型,资金变动额度,操作日期时间, 刷卡手续费"); writer.Write("\r\n"); writer.Flush(); } writer.Write(eve.Account); WriteSpliter(writer); writer.Write(eve.Type); WriteSpliter(writer); writer.Write(eve.Amount.ToString()); WriteSpliter(writer); writer.Write(eve.DateTime); WriteSpliter(writer); writer.Write(eve.Charge); writer.Write("\r\n"); writer.Flush(); writer.Close(); }
public void AddFundChangeEvent(FundEvent eve) { m_fundEventDB.AddNewFundEvent(eve); AddFundChangeEventToListView(eve); SaveToAccountCurrentSwingEvents(eve); }
void SaveToAccountCurrentSwingEvents(FundEvent eve) { var account = BillBook.GetInstance().Find(eve.Account); if (account != null && eve.Type == "刷卡") { account.SwingEvents.Add(eve); } }
public void AddNewFundEvent(FundEvent eve) { if (!m_accounts.ContainsKey(eve.Account)) { AddNewAccount(eve.Account); } m_accounts[eve.Account].AddNewFundEvent(eve); }