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 EditPreferencesForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (dataChanged == true)
     {
         CCFBPrefs.Init();
     }
 }
        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 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);
     }
 }
예제 #6
0
        private void btnSvcSave_Click(object sender, EventArgs e)
        {
            string insertIDs = "";
            string updateIDs = "";

            for (int i = 0; i < dgvCSFP.SelectedRows.Count; i++)
            {
                if (dgvCSFP.SelectedRows[i].Cells["clmDateServed"].Value.ToString() != "")
                {
                    if (MessageBox.Show("CSFP Client " + dgvCSFP.SelectedRows[i].Cells["clmName"].Value.ToString()
                                        + " Already Has A Service For This Period. Would You Like To Update The Service?",
                                        "Service Already Exists For This Period", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
                        == System.Windows.Forms.DialogResult.Yes)
                    {
                        if (updateIDs != "")
                        {
                            updateIDs += ", ";
                        }

                        updateIDs += dgvCSFP.SelectedRows[i].Cells["clmLogID"].Value.ToString();
                    }
                }
                else
                {
                    if (insertIDs != "")
                    {
                        insertIDs += ", ";
                    }

                    insertIDs += dgvCSFP.SelectedRows[i].Cells["clmHHMemID"].Value.ToString();
                }
            }

            openConnection();
            if (insertIDs != "")
            {
                clsCSFPLog.insertNewService(insertIDs, dtpSvcDate.Value, tbLbsCSFP.Text);
            }

            if (updateIDs != "")
            {
                updateExistingService(updateIDs);
            }
            svcDate = dtpSvcDate.Value;
            closeConnection();
            changeGroupBoxVisibility(0);
            refreshdgvCSFP();

            if (Convert.ToInt32(tbLbsCSFP.Text) != CCFBPrefs.CSFPLbsPerService)
            {
                if (MessageBox.Show("Do you want to set " + tbLbsCSFP.Text + " as the default CSFP Service Lbs?",
                                    "Service Lbs Different Than Default", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
                    == DialogResult.Yes)
                {
                    CCFBPrefs.UpdateCSFPServiceLbs(tbLbsCSFP.Text);
                }
            }
        }
 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 tbAlertMinMonthsText_Leave(object sender, EventArgs e)
 {
     if (CCFBPrefs.AlertMinMonthsText != tbAlertMinMonthsText.Text)
     {
         CCFBPrefs.AlertMinMonthsText = tbAlertMinMonthsText.Text;
         CCFBPrefs.SaveValue("AlertMinMonthsText", CCFBPrefs.AlertMinMonthsText);
     }
     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();
 }
예제 #10
0
        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;
            }
        }
예제 #11
0
 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);
         }
     }
 }
예제 #12
0
 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;
         }
     }
 }
예제 #13
0
 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;
         }
     }
 }
예제 #14
0
 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;
     }
 }
예제 #15
0
 private void openTrx()
 {
     try
     {
         int activeRow = int.Parse(lvDailyLog.FocusedItem.Tag.ToString());
         clsHHServiceTrans.setDataRow(activeRow);
         if (CCFBPrefs.TestAllowEditTrxDate(Convert.ToDateTime(clsHHServiceTrans.TrxDate), true) == true)
         {
             ShowEditServiceForm(clsHHServiceTrans.HouseholdID
                                 , clsHHServiceTrans.TrxId
                                 , false);
             clsHHServiceTrans.openForADate(curSvcDisplayDate);
             RefreshSvcPage();
         }
     }
     catch (NullReferenceException ex)
     {
         CCFBGlobal.appendErrorToErrorReport("lvDailyLog", ex.GetBaseException().ToString());
     }
 }
예제 #16
0
 private void logIn()
 {
     if (cboUsers.SelectedIndex >= 0 || cboUsers.Text != "")
     {
         for (int i = 0; i < clsUsers.RowCount; i++)
         {
             if (clsUsers.DSet.Tables[0].Rows[i]["UserName"].ToString().ToUpper() ==
                 cboUsers.Text.ToUpper())
             {
                 if (tbPassword.Text.ToUpper() ==
                     clsUsers.DSet.Tables[0].Rows[i]["Password"].ToString().ToUpper())
                 {
                     CCFBGlobal.currentUser_Name            = clsUsers.DSet.Tables[0].Rows[i]["UserName"].ToString();
                     CCFBGlobal.currentUser_PermissionLevel =
                         getPermissionsInt(clsUsers.DSet.Tables[0].Rows[i].Field <string>("UserRole"));
                     CCFBGlobal.pcName = System.Windows.Forms.SystemInformation.ComputerName;
                     saveToRegistry();
                     writeToDSNValues();
                     CCFBPrefs.Init();
                     CCFBGlobal.LoadTypes();
                     MainForm frmMain = new MainForm(this);
                     this.Visible       = false;
                     this.ShowInTaskbar = false;
                     frmMain.ShowDialog();
                     break;
                 }
                 else
                 {
                     MessageBox.Show("The Password Does Not Match For This User");
                     tbPassword.Text = "";
                     tbPassword.Focus();
                     Application.DoEvents();
                 }
             }
         }
     }
     else
     {
         MessageBox.Show("Please Select A User");
     }
 }
예제 #17
0
        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;
                }
            }
        }
예제 #18
0
 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(), "");
         }
     }
 }
예제 #19
0
        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);
        }
예제 #20
0
        private void logIn(string userName, string pwd)
        {
            if (userName.Length > 0)
            {
                this.Enabled  = false;
                btnCancel.Tag = "login";
                for (int i = 0; i < clsUsers.RowCount; i++)
                {
                    if (cancelLogIn == false)
                    {
                        if (clsUsers.DSet.Tables[0].Rows[i]["UserName"].ToString().ToUpper() == userName)
                        {
                            if (pwd == clsUsers.DSet.Tables[0].Rows[i]["Password"].ToString().ToUpper())
                            {
                                CCFBGlobal.currentUser_Name            = clsUsers.DSet.Tables[0].Rows[i]["UserName"].ToString();
                                CCFBGlobal.currentUser_PermissionLevel =
                                    getPermissionsInt(clsUsers.DSet.Tables[0].Rows[i].Field <string>("UserRole"));
                                CCFBGlobal.pcName     = System.Windows.Forms.SystemInformation.ComputerName;
                                CCFBGlobal.dbUserName = CCFBGlobal.currentUser_Name + "/" + CCFBGlobal.pcName;
                                saveToRegistry();
                                writeToDSNValues();
                                CultureInfo cultureTest = new CultureInfo(CultureInfo.CurrentCulture.LCID, true);
                                if (cultureTest.DateTimeFormat.ShortDatePattern != CCFBGlobal.DefaultShortDateFmt || cultureTest.DateTimeFormat.ShortTimePattern != CCFBGlobal.DefaultShortTimeFmt)
                                {
                                    cultureTest.DateTimeFormat.ShortDatePattern = CCFBGlobal.DefaultShortDateFmt;
                                    cultureTest.DateTimeFormat.ShortTimePattern = CCFBGlobal.DefaultShortTimeFmt;
                                    Application.CurrentCulture = cultureTest;
                                }

                                //CCFBPrefs.Init();
                                CCFBGlobal.LoadTypes();

                                CCFBGlobal.getRegTemplatePath();
                                this.Visible       = false;
                                this.Enabled       = true;
                                this.ShowInTaskbar = false;
                            #if FASTTRACK
                                FastTrackForm formMain = new FastTrackForm(this);
                            #endif
                            #if CCFB
                                CCFBPrefs.Init();
                                formMain = new MainForm(this);
                            #endif
                            #if CUSTSQL
                                formMain = new SelectTables();
                            #endif
                                formMain.ShowDialog();
                                resetForm();
                                break;
                            }
                            else
                            {
                                MessageBox.Show("The Password Does Not Match For This User");
                                tbPassword.Text = "";
                                this.Enabled    = true;
                                tbPassword.Focus();
                                Application.DoEvents();
                            }
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Please Select A User");
            }
            btnCancel.Tag = "";
        }
예제 #21
0
 private void cboFiscalStartMonth_SelectionChangeCommitted(object sender, EventArgs e)
 {
     CCFBPrefs.SaveValue("FiscalYearStartMonth", ((parmType)cboFiscalStartMonth.SelectedItem).UID);
 }
예제 #22
0
 private void tbAgencyNumber_Leave(object sender, EventArgs e)
 {
     CCFBPrefs.AgencyNumber = tbAgencyNumber.Text;
     CCFBPrefs.SaveValue(tbAgencyNumber.Tag.ToString(), tbAgencyNumber.Text);
 }