/// <summary> /// Loads the Donor log listView with the donoations for the /// Selected donor /// </summary> private void loadDonorLogList() { double totLbs = 0; int totCnt = 0; lvDonorHistory.Items.Clear(); Application.DoEvents(); ListViewItem lvItm; string donorWhereClause = " WHERE DonorID=" + donorID.ToString(); switch (cboDonorPeriod.SelectedIndex) { case 0: donorWhereClause += CCFBGlobal.SQLDateRangeCurMonth(); break; case 1: donorWhereClause += CCFBGlobal.SQLDateRangePrevMonth(); break; case 2: donorWhereClause += CCFBGlobal.SQLDateRangeLast90Days(); break; case 3: donorWhereClause += CCFBGlobal.SQLDateRangeCurYear(); break; case 4: donorWhereClause += CCFBGlobal.SQLDateRangePrevYear(); break; case 5: break; default: donorWhereClause += DateRangeCustom(); break; } clsFDHist.openWhere(donorWhereClause); for (int i = 0; i < clsFDHist.RowCount; i++) { clsFDHist.setDataRow(i); lvItm = new ListViewItem((i + 1).ToString()); lvItm.SubItems.Add(CCFBGlobal.LongNameFromId(CCFBGlobal.parmTbl_Donation, clsFDHist.DonationType)); lvItm.SubItems.Add(clsFDHist.TrxDate.ToShortDateString()); lvItm.SubItems.Add(String.Format("{0:0,0}", clsFDHist.Pounds)); lvItm.SubItems.Add(clsFDHist.Notes); lvItm.SubItems.Add(CCFBGlobal.LongNameFromId(CCFBGlobal.parmTbl_FoodClass, clsFDHist.FoodClass)); lvItm.SubItems.Add(clsFDHist.FoodCode); lvItm.SubItems.Add(clsFDHist.TrxID.ToString()); lvDonorHistory.Items.Add(lvItm); totCnt++; totLbs += clsFDHist.Pounds; } tbDonorCnt.Text = CCFBGlobal.formatNumberWithCommas(totCnt); tbDonorLbs.Text = String.Format("{0:0,0}", totLbs); }
/// <summary> /// Loads the Donor log listView with the donoations for the /// Selected donor /// </summary> private void loadDonorLogList() { decimal totDollars = 0; int totCnt = 0; lvDonorHistory.Items.Clear(); Application.DoEvents(); ListViewItem lvItm; string donorWhereClause = " WHERE DonorID=" + donorID.ToString(); switch (cboDonorPeriod.SelectedIndex) { case 0: donorWhereClause += CCFBGlobal.SQLDateRangeCurMonth(); break; case 1: donorWhereClause += CCFBGlobal.SQLDateRangePrevMonth(); break; case 2: donorWhereClause += CCFBGlobal.SQLDateRangeLast90Days(); break; case 3: donorWhereClause += CCFBGlobal.SQLDateRangeCurYear(); break; case 4: donorWhereClause += CCFBGlobal.SQLDateRangePrevYear(); break; case 5: break; default: donorWhereClause += DateRangeCustom(); break; } clsCashDonations.openWhere(donorWhereClause); for (int i = 0; i < clsCashDonations.RowCount; i++) { clsCashDonations.setDataRow(i); lvItm = new ListViewItem((i + 1).ToString()); lvItm.SubItems.Add(clsCashDonations.TrxDate.ToShortDateString()); lvItm.SubItems.Add(String.Format("{0:0,0.00}", clsCashDonations.DollarValue)); lvItm.SubItems.Add(clsCashDonations.Notes); lvItm.SubItems.Add(clsCashDonations.TrxID.ToString()); lvDonorHistory.Items.Add(lvItm); totCnt++; totDollars += clsCashDonations.DollarValue; } tbDonorCnt.Text = CCFBGlobal.formatNumberWithCommas(totCnt); tbTotalDonorDollars.Text = String.Format("{0:0,0.00}", totDollars); }