예제 #1
0
        /// <summary>
        /// Used in initialization of the HHMemForm(ie Constructor)
        /// </summary>
        /// <param name="clsIn">The Client Class</param>
        /// <param name="frmMainIn">The Main Form-Calling Form</param>
        /// <param name="HHMemID">The Household Member ID</param>
        public HHMemGridForm(Client clsIn, MainForm frmMainIn, int HHMemID)
        {
            InitializeComponent();

            clsClient     = clsIn;
            frmMain       = frmMainIn;
            showColumn[0] = false;
            for (int i = 1; i < showColumn.Length; i++)
            {
                showColumn[i] = true;
            }
            hhMemID = HHMemID;
            UserFields clsUserFields = new UserFields(CCFBGlobal.connectionString);

            clsUserFields.open("HouseholdMembers");

            string userField0 = clsUserFields.GetDataValue("EditLabel", 0).ToString();
            string userField1 = clsUserFields.GetDataValue("EditLabel", 1).ToString();

            if (userField0 == "")
            {
                showColumn[(int)dgvColNames.colUserFlag0] = false;
                chkUserFlag0.Visible = false;
            }
            else
            {
                chkUserFlag0.Text = dgvHHM.Columns["colUserFlag0"].ToolTipText = userField0;
            }

            if (userField1 == "")
            {
                showColumn[(int)dgvColNames.colUserFlag1] = false;
                chkUserFlag1.Visible = false;
            }
            else
            {
                chkUserFlag1.Text = dgvHHM.Columns["colUserFlag1"].ToolTipText = userField1;
            }

            traverseAndAddControlsToCollections(this.Controls);
            setCSFPInfoVisibility();

            CCFBGlobal.InitCombo(cboEdLvl, CCFBGlobal.parmTbl_EducationLevel);
            CCFBGlobal.InitCombo(cboEmploymentStatus, CCFBGlobal.parmTbl_Employment);
            CCFBGlobal.InitCombo(cboMilitaryService, CCFBGlobal.parmTbl_MilitaryService);
            CCFBGlobal.InitCombo(cboDischargeStatus, CCFBGlobal.parmTbl_MilitaryDischarge);
            CCFBGlobal.InitCombo(cboCSFPRoute, CCFBGlobal.parmTbl_CSFPRoutes);

            TestFeatureEnabled(tsbCSFP, (int)dgvColNames.colBegCSFP, (int)dgvColNames.colBegWork, CCFBPrefs.EnableCSFP);
            TestFeatureEnabled(tsbWorksInArea, (int)dgvColNames.colBegWork, (int)dgvColNames.colBegOption, CCFBPrefs.EnableWorksInArea);
            pnlEmployer.Visible = CCFBPrefs.EnableWorksInArea;
            TestFeatureEnabled(tsbOptional, (int)dgvColNames.colBegOption, (int)dgvColNames.colBegMilitary, CCFBPrefs.EnableAdditionalHHMDataTab);
            TestFeatureEnabled(tsbMilitarySvc, (int)dgvColNames.colBegMilitary, (int)dgvColNames.colBegEmployed, CCFBPrefs.EnableAdditionalHHMDataTab);
            TestFeatureEnabled(tsbEmployment, (int)dgvColNames.colBegEmployed, dgvHHM.Columns.Count, CCFBPrefs.EnableAdditionalHHMDataTab);

            pnlHHMFlds.BackColor    = CCFBGlobal.bkColorBaseEdit;
            tpgAdditional.BackColor = CCFBGlobal.bkColorBaseEdit;
            tpgEthnicity.BackColor  = CCFBGlobal.bkColorBaseEdit;
            pnlCSFPInfo.BackColor   = CCFBGlobal.bkColorAltEdit;
            pnlEmployer.BackColor   = CCFBGlobal.bkColorAltEdit;
            if (CCFBPrefs.EnableAdditionalHHMDataTab == true)
            {
                chkSurveyComplete.Visible = true;
                chkSurveyComplete.Checked = clsClient.clsHH.SurveyComplete;
                lblSurveyComplete.Visible = true;
            }
            else
            {
                chkSurveyComplete.Visible = false;
                lblSurveyComplete.Visible = false;
            }

            if (CCFBPrefs.EnableAdditionalHHMDataTab == false && CCFBPrefs.EnableEthnicityHHMTab == false)
            {
                splitContainer3.Panel2.Visible = false;
            }
            else
            {
                splitContainer3.Panel2.Visible = true;
                if (CCFBPrefs.EnableEthnicityHHMTab == false)
                {
                    tabCtrlDemographics.TabPages.RemoveByKey("tpgEthnicity");  //Remove Ethnicity Tab
                }
                if (CCFBPrefs.EnableAdditionalHHMDataTab == false)
                {
                    tabCtrlDemographics.TabPages.RemoveByKey("tpgAdditional");  //Remove Additional Tab
                }
            }


            setupComboxBox(dgvColNames.colCSFPRoute.ToString(), CCFBGlobal.parmTbl_CSFPRoutes);
            setupComboxBox(dgvColNames.colMilSvc.ToString(), CCFBGlobal.parmTbl_MilitaryService);
            setupComboxBox(dgvColNames.colDischargeStatus.ToString(), CCFBGlobal.parmTbl_MilitaryDischarge);
            setupComboxBox(dgvColNames.colEmploymentStatus.ToString(), CCFBGlobal.parmTbl_Employment);
            setupComboxBox(dgvColNames.colEducationLevel.ToString(), CCFBGlobal.parmTbl_EducationLevel);

            try
            {
                tbHouseholdData.Text = "[ " + clsClient.clsHH.ID.ToString() + " ]\r\n"
                                       + clsClient.clsHH.Name.ToString() + "\r\n\r\n"
                                       + clsClient.clsHH.Address.ToString() + "\r\n"
                                       + clsClient.clsHH.City.ToString() + ", "
                                       + clsClient.clsHH.State.ToString() + " "
                                       + clsClient.clsHH.Zipcode.ToString();
            }
            catch { }
            showBasicInfo();
            showCSFP();
            showOptional();
            showWorksInArea();
            showMilitaryService();
            showEmployment();

            loadHHMems(true, hhMemID);
            setViewMode();
            fillForm();
        }
예제 #2
0
        /// <summary>
        /// Used in initialization of the HHMemForm(ie Constructor)
        /// </summary>
        /// <param name="clsIn">The Client Class</param>
        /// <param name="frmMainIn">The Main Form-Calling Form</param>
        /// <param name="HHMemID">The Household Member ID</param>
        public HHMemForm(Client clsIn, MainForm frmMainIn, int HHMemID)
        {
            InitializeComponent();

            clsClient = clsIn;
            frmMain   = frmMainIn;

            hhMemID = HHMemID;

            clsUserFields.open("HouseholdMembers");

            string userField0 = clsUserFields.GetDataValue("EditLabel", 0).ToString();
            string userField1 = clsUserFields.GetDataValue("EditLabel", 1).ToString();

            if (userField0 == "")
            {
                chkUserFlag0.Visible = false;
            }
            else
            {
                chkUserFlag0.Text = userField0;
            }

            if (userField1 == "")
            {
                chkUserFlag1.Visible = false;
            }
            else
            {
                chkUserFlag1.Text = userField0;
            }

            CCFBGlobal.InitCombo(cboEdLvl, CCFBGlobal.parmTbl_EducationLevel);
            CCFBGlobal.InitCombo(cboEmploymentStatus, CCFBGlobal.parmTbl_Employment);
            CCFBGlobal.InitCombo(cboMilitaryService, CCFBGlobal.parmTbl_MilitaryService);
            CCFBGlobal.InitCombo(cboDischargeStatus, CCFBGlobal.parmTbl_MilitaryDischarge);
            CCFBGlobal.InitCombo(cboCSFPRoute, CCFBGlobal.parmTbl_CSFPRoutes);
            storedProcComm = new SqlCommand("UpdateHHMembersAdditionalData", conn);
            traverseAndAddControlsToCollections(this.Controls);
            if (CCFBPrefs.EnableAdditionalHHMDataTab == false && CCFBPrefs.EnableEthnicityHHMTab == false)
            {
                panel1.Visible = false;
            }
            else
            {
                panel1.Visible = true;
                if (CCFBPrefs.EnableEthnicityHHMTab == false)
                {
                    tabControl1.TabPages.RemoveByKey("tpEthnicity");  //Remove Ethnicity Tab
                }
                if (CCFBPrefs.EnableAdditionalHHMDataTab == false)
                {
                    tabControl1.TabPages.RemoveByKey("tpAdditional");  //Remove Additional Tab
                }
            }
            setCSFPInfoVisibility();

            pnlEmployer.Visible = CCFBPrefs.EnableWorksInArea;
            if (CCFBPrefs.EnableWorksInArea == true)
            {
                splitContainer2.SplitterDistance = 165;
            }
            else
            {
                splitContainer2.SplitterDistance = 235;
            }

            loadList(HHMemID);
            fillForm();

            try
            {
                tbHouseholdData.Text = "[ " + clsClient.clsHH.ID.ToString() + " ]\r\n"
                                       + clsClient.clsHH.Name.ToString() + "\r\n\r\n"
                                       + clsClient.clsHH.Address.ToString() + "\r\n"
                                       + clsClient.clsHH.City.ToString() + ", "
                                       + clsClient.clsHH.State.ToString() + " "
                                       + clsClient.clsHH.Zipcode.ToString();
            }
            catch { }

            splitContainer2.Panel2.BackColor = CCFBGlobal.bkColorBaseEdit;
            tpAdditional.BackColor           = CCFBGlobal.bkColorBaseEdit;
            tpEthnicity.BackColor            = CCFBGlobal.bkColorBaseEdit;
            chkSurveyComplete.Visible        = false;
            lblSurveyComplete.Visible        = false;
            if (CCFBPrefs.EnableAdditionalHHMDataTab == true)
            {
                chkSurveyComplete.Visible = true;
                chkSurveyComplete.Checked = clsClient.clsHH.SurveyComplete;
                lblSurveyComplete.Visible = true;
            }
        }