/// <summary> /// Constructor for the FoodDonations Form /// </summary> public FoodDonationsForm() { InitializeComponent(); spltctrlDailyLog.Visible = true; spltctrlEdit.Visible = false; //clsParmDonationType.openAll(); //Open all parm data for Donations clsDonors.openWhere(""); //Opens all Donors //clsParmFoodClass.openAll(); //Opens all Food Classes for Donations frmEditDonors = new EditDonorForm(CCFBGlobal.connectionString, true); //cboDisplayType.SelectedIndex = 0; cboDisplayType.SelectedIndex = Convert.ToInt32(Registry.GetValue(CCFBGlobal.registryKeyCurrentUser, constDisplayType, 0)); fillCombos(); //Fills the combo boxes for Donation Type and Class dtDonationDate.Value = DateTime.Today; //Adds each text bos to the collection for easy use later foreach (TextBox tb in spltctrlEdit.Panel1.Controls.OfType <TextBox>()) { tbList.Add(tb); } if (donationDates.Count == 0) { setupDatesToDisplay(); } tbName.BackColor = Color.White; tbDonorID.BackColor = Color.White; cboDonorPeriod.SelectedIndex = 2; bNormalMode = true; }
private void btnDonor_Click(object sender, EventArgs e) { EditDonorForm frmTmp = new EditDonorForm(CCFBGlobal.connectionString, true); DialogResult dr = frmTmp.ShowDialog(this); if (dr == DialogResult.Yes) { int newDonorId = frmTmp.SelectedId; string newDonorName = frmTmp.SelectedName; frmTmp.Close(); frmTmp.Dispose(); Button btn = (Button)sender; string tagVal = btn.Tag.ToString(); foreach (TextBox tb in tpDonorPercent.Controls.OfType <TextBox>()) { if (tb.Tag.ToString() == tagVal) { tb.Text = newDonorId.ToString(); CCFBPrefs.SaveValue(tagVal, newDonorId.ToString()); dataChanged = true; break; } } filllblDonor(tagVal, newDonorName); } }
/// <summary> /// Constructor for the FoodDonations Form /// </summary> public CashDonationsForm() { InitializeComponent(); gbDnrHist.SetBounds(0, 0, 1000, Height - 25); gbDailyLog.SetBounds(0, 0, 1000, Height - 25); gbLogEntry.SetBounds(5, 0, 744, 256); gbDnrHist.Visible = false; gbDailyLog.Visible = true; gbLogEntry.Visible = false; //clsParmDonationType.openAll(); //Open all parm data for Donations clsDonors.openWhere(""); //Opens all Donors //clsParmFoodClass.openAll(); //Opens all Food Classes for Donations frmEditDonors = new EditDonorForm(CCFBGlobal.connectionString, true); LoadcboYear(); cboReportMonth.SelectedIndex = DateTime.Today.Month - 1; //Adds each text bos to the collection for easy use later foreach (TextBox tb in gbLogEntry.Controls.OfType <TextBox>()) { tbList.Add(tb); } tbName.BackColor = Color.White; tbDonorID.BackColor = Color.White; cboDonorPeriod.SelectedIndex = 2; bNormalMode = true; }
/// <summary> /// Constructor for the FoodDonations Form /// </summary> public CashDonationsForm() { InitializeComponent(); spltcontLog.Visible = true; spltcontEdit.Visible = false; //clsParmDonationType.openAll(); //Open all parm data for Donations clsDonors.openWhere(""); //Opens all Donors //clsParmFoodClass.openAll(); //Opens all Food Classes for Donations frmEditDonors = new EditDonorForm(CCFBGlobal.connectionString, true); LoadcboYear(); cboReportMonth.SelectedIndex = DateTime.Today.Month - 1; //Adds each text boxes to the collection for easy use later foreach (TextBox tb in spltcontEdit.Panel1.Controls.OfType <TextBox>()) { tbList.Add(tb); } pnlEntryDate.SetBounds(pnlPeriod.Left, pnlPeriod.Top, pnlPeriod.Width, pnlPeriod.Height); cboDisplayType.SelectedIndex = 1; tbName.BackColor = Color.White; tbDonorID.BackColor = Color.White; cboDonorPeriod.SelectedIndex = 2; bNormalMode = true; }
private void btnDonor_Click(object sender, EventArgs e) { EditDonorForm frmTmp = new EditDonorForm(CCFBGlobal.connectionString, true); frmTmp.ShowDialog(this); int newDonorId = frmTmp.SelectedId; string newDonorName = frmTmp.SelectedName; frmTmp.Close(); frmTmp.Dispose(); Button btn = (Button)sender; string tagVal = btn.Tag.ToString(); foreach (TextBox tb in grpbxDonors.Controls.OfType <TextBox>()) { if (tb.Tag.ToString() == tagVal) { tb.Text = newDonorId.ToString(); CCFBPrefs.SaveValue(tagVal, newDonorId.ToString()); dataChanged = true; break; } } foreach (Label lbl in grpbxDonors.Controls.OfType <Label>()) { if (lbl.Tag.ToString() == tagVal) { if (newDonorName == "") { lbl.Text = "....."; } else { lbl.Text = newDonorName; } break; } } }
/// <summary> /// Constructor for the FoodDonations Form /// </summary> public FoodDonationsForm() { InitializeComponent(); gbDnrHist.SetBounds(0, 0, 1000, Height - 25); gbDailyLog.SetBounds(0, 0, 1000, Height - 25); gbLogEntry.SetBounds(5, 0, 744, 256); gbDnrHist.Visible = false; gbDailyLog.Visible = true; gbLogEntry.Visible = false; //clsParmDonationType.openAll(); //Open all parm data for Donations clsDonors.openWhere(""); //Opens all Donors //clsParmFoodClass.openAll(); //Opens all Food Classes for Donations frmEditDonors = new EditDonorForm(CCFBGlobal.connectionString, true); //Gets all distinct Donation Dates in Database clsFoodDonations.openDistinctDonationDates(); //Fills the combo boxes for Donation Type and Class fillCombos(); //Fills a collection with the ditinct Donation Dates fillDonationDates(); //Loads the Donation Log For the current date in the ListView loadDonationLogList(); //Adds each text bos to the collection for easy use later foreach (TextBox tb in gbLogEntry.Controls.OfType <TextBox>()) { tbList.Add(tb); } tbName.BackColor = Color.White; tbDonorID.BackColor = Color.White; cboDonorPeriod.SelectedIndex = 2; bNormalMode = true; }