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); } }
private void rdobUseFamList_CheckedChanged(object sender, EventArgs e) { if (rdobAlways.Checked == true) { CCFBPrefs.UseFamilyList = CCFBPrefs.UseFamilyListCode.Always; CCFBPrefs.SaveValue("UseFamilyList", "2"); } else if (rdobNormally.Checked == true) { CCFBPrefs.UseFamilyList = CCFBPrefs.UseFamilyListCode.Normally; CCFBPrefs.SaveValue("UseFamilyList", "0"); } else if (rdobSometimes.Checked == true) { CCFBPrefs.UseFamilyList = CCFBPrefs.UseFamilyListCode.Sometimes; CCFBPrefs.SaveValue("UseFamilyList", "1"); } else if (rdobNever.Checked == true) { CCFBPrefs.UseFamilyList = CCFBPrefs.UseFamilyListCode.Never; CCFBPrefs.SaveValue("UseFamilyList", "3"); } dataChanged = true; }
private void cboSvcMnuTyp_SelectionChangeCommitted(object sender, EventArgs e) { if (cboSvcMnuTyp.Focused == true) { CCFBPrefs.ServiceMenuType = cboSvcMnuTyp.SelectedIndex; CCFBPrefs.SaveValue("ServiceMenuType", CCFBPrefs.ServiceMenuType); } }
private void cboFMIDType_SelectionChangeCommitted(object sender, EventArgs e) { if (cboFMIDType.Focused == true) { CCFBPrefs.DefaultFMIDType = Convert.ToInt32(cboFMIDType.SelectedValue); CCFBPrefs.SaveValue("DefaultFMIDType", CCFBPrefs.DefaultFMIDType); } }
private void tbAlertMinMonthsText_Leave(object sender, EventArgs e) { if (CCFBPrefs.AlertMinMonthsText != tbAlertMinMonthsText.Text) { CCFBPrefs.AlertMinMonthsText = tbAlertMinMonthsText.Text; CCFBPrefs.SaveValue("AlertMinMonthsText", CCFBPrefs.AlertMinMonthsText); } clearToolTip(); }
private void nudAlertMinimumMonths_Leave(object sender, EventArgs e) { if (nudAlertMinimumMonths.Value != CCFBPrefs.AlertMinimumMonths) { CCFBPrefs.AlertMinimumMonths = Convert.ToInt32(nudAlertMinimumMonths.Value); CCFBPrefs.SaveValue("AlertMinimumMonths", nudAlertMinimumMonths.Value.ToString()); } clearToolTip(); }
private void nudAlertWeekSvc_Leave(object sender, EventArgs e) { if (nudAlertWeekSvc.Value != CCFBPrefs.AlertWeekSvc) { CCFBPrefs.AlertWeekSvc = Convert.ToInt32(nudAlertWeekSvc.Value); CCFBPrefs.SaveValue("AlertWeekSvc", nudAlertWeekSvc.Value.ToString()); } clearToolTip(); }
private void rdoViewBy_CheckedChanged(object sender, EventArgs e) { RadioButton rdo = (RadioButton)sender; if (rdo.Checked == true) { CCFBPrefs.SaveValue(grpViewGRBy.Tag.ToString(), Convert.ToBoolean(rdo.Tag)); dataChanged = true; } }
private void rdoOverRide_CheckedChanged(object sender, EventArgs e) { if (bNormalMode == true) { RadioButton rdo = (RadioButton)sender; if (rdo.Checked == true) { CCFBPrefs.OverRideLevel = Convert.ToInt32(rdo.Tag); CCFBPrefs.SaveValue("OverRideLevel", CCFBPrefs.OverRideLevel); } } }
private void textboxes_Leave(object sender, EventArgs e) { if (normalMode == true) { TextBox tb = (TextBox)sender; if (oriTextValue != tb.Text) { CCFBPrefs.SaveValue(tb.Tag.ToString(), tb.Text); dataChanged = true; } } }
private void checkBoxes_CheckedChanged(object sender, EventArgs e) { if (bNormalMode == true) { CheckBox chk = (CheckBox)sender; if (oriBoolValue != chk.Checked) { CCFBPrefs.SaveValue(chk.Tag.ToString(), chk.Checked); oriBoolValue = chk.Checked; dataChanged = true; } } }
private void tbDefaultZipcode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (clsZipcodes.getCity(tbDefaultZipcode.Text) == true) { tbDefaultCity.Text = clsZipcodes.City.ToUpper(); CCFBPrefs.SaveValue(tbDefaultCity.Tag.ToString(), tbDefaultCity.Text); tbDefaultState.Text = clsZipcodes.State.ToUpper(); CCFBPrefs.SaveValue(tbDefaultState.Tag.ToString(), tbDefaultState.Text); dataChanged = true; } e.Handled = 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; } } }
private void tbDonor_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Return) { TextBox tb = (TextBox)sender; int donorid = 0; if (tb.Text != "") { try { donorid = Convert.ToInt32(tb.Text); Donors clsDonors = new Donors(CCFBGlobal.connectionString); clsDonors.openWhere(" Where Id = " + donorid.ToString()); if (clsDonors.RowCount > 0) { if (clsDonors.ID == donorid) { filllblDonor(tb.Tag.ToString(), clsDonors.Name); CCFBPrefs.SaveValue(tb.Tag.ToString(), donorid.ToString()); dataChanged = true; } } else { donorid = 0; } } catch (FormatException ex) { MessageBox.Show("Invalid number entered.\r\nThis will be ignored"); } } if (donorid == 0) { filllblDonor(tb.Tag.ToString(), ""); } } }
private string getFolderPath(TextBox tb) { string oriPath = tb.Text.Trim(); try { //Set default extension of the savefile dialog folderBrowserDialog1.Description = "Save Path for Monthly Reports"; //If no value exists in registry for default save location if (oriPath == "") { folderBrowserDialog1.SelectedPath = Path.GetDirectoryName(Application.ExecutablePath); } else { folderBrowserDialog1.SelectedPath = Path.GetDirectoryName(oriPath); } //saveFileDialog1.Filter = "SQL Backup Files (*.bak)|*.bak"; DialogResult dr = folderBrowserDialog1.ShowDialog(); //If user confirmed save if (dr == System.Windows.Forms.DialogResult.OK) { if (oriPath != folderBrowserDialog1.SelectedPath) { oriPath = folderBrowserDialog1.SelectedPath; CCFBPrefs.SaveValue(tb.Tag.ToString(), oriPath); dataChanged = true; } } } catch (Exception ex) { CCFBGlobal.appendErrorToErrorReport("", ex.GetBaseException().ToString()); } return(oriPath); }
private void tbAgencyNumber_Leave(object sender, EventArgs e) { CCFBPrefs.AgencyNumber = tbAgencyNumber.Text; CCFBPrefs.SaveValue(tbAgencyNumber.Tag.ToString(), tbAgencyNumber.Text); }
private void cboFiscalStartMonth_SelectionChangeCommitted(object sender, EventArgs e) { CCFBPrefs.SaveValue("FiscalYearStartMonth", ((parmType)cboFiscalStartMonth.SelectedItem).UID); }