//*************************************************************
        //Training Query Screen
        //   Filtered by Battalion/Shift/Unit
        //   Primary/Secondary/Specific Traing Codes
        //   Employee Name (like statement)
        //
        //*************************************************************


        public void RefreshEmployeeList()
        {
            PTSProject.clsTraining TrainCL = Container.Resolve <clsTraining>();
            int    iPrimary   = 0;
            int    lSecondary = 0;
            int    lSpecific  = 0;
            string sUnit      = "";
            byte   sFlag      = 0;

            if (ViewModel.FirstTime)
            {
                return;
            }
            if (ViewModel.SkipLogic)
            {
                return;
            }

            int CurrRow = 0;

            ViewModel.sprReport.MaxRows = 500000;

            string sStartDate = DateTime.Parse(ViewModel.dtStart.Text).ToString("M/d/yyyy");
            string sEndDate   = DateTime.Parse(ViewModel.dtEnd.Text).AddDays(1).ToString("M/d/yyyy");

            ViewModel.sHeadingFilter = "Displaying ";

            if (ViewModel.optPM.Checked)
            {
                ViewModel.sHeadingFilter = ViewModel.sHeadingFilter + "Paramedic ";
            }

            string sName    = modGlobal.Clean(Strings.Replace(ViewModel.txtNameSearch.Text, "'", "''", 1, -1, CompareMethod.Binary));
            string sComment = modGlobal.Clean(Strings.Replace(ViewModel.txtCommentSearch.Text, "'", "''", 1, -1, CompareMethod.Binary));

            if (ViewModel.OptYes.Checked)
            {
                sFlag = 1;
                ViewModel.sHeadingFilter = ViewModel.sHeadingFilter + "Training Attended; ";
            }
            else
            {
                sFlag = 0;
                ViewModel.sHeadingFilter = ViewModel.sHeadingFilter + "Training Not Attended; ";
            }


            if (ViewModel.CurrBatt != "")
            {
                if (ViewModel.CurrShift != "")
                {
                    ViewModel.sHeadingFilter = ViewModel.sHeadingFilter + "for Batt\\Shift= " + ViewModel.CurrBatt + "\\" + ViewModel.CurrShift + "; ";
                }
            }
            else if (ViewModel.CurrShift != "")
            {
                ViewModel.sHeadingFilter = ViewModel.sHeadingFilter + "for Shift= " + ViewModel.CurrShift + "; ";
            }

            if (ViewModel.cboUnit.ListIndex == -1)
            {
                sUnit = "";
            }
            else
            {
                sUnit = modGlobal.Clean(ViewModel.cboUnit.Text);
                ViewModel.sHeadingFilter = ViewModel.sHeadingFilter + "Unit = " + ViewModel.cboUnit.Text + "; ";
            }
            ViewModel.sHeadingFilter = ViewModel.sHeadingFilter + "from " + sStartDate + " To " + sEndDate + "; ";

            if (ViewModel.cboPrimary.ListIndex == -1)
            {
                iPrimary = 0;
            }
            else
            {
                //UPGRADE_ISSUE: (2064) LpADOLib.fpComboAdo property cboPrimary.ItemData was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx
                iPrimary = ViewModel.cboPrimary.ItemData(ViewModel.cboPrimary.ListIndex);
                ViewModel.sHeadingFilter = ViewModel.sHeadingFilter + ViewModel.cboPrimary.Text + "; ";
            }

            if (ViewModel.cboSecondary.ListIndex == -1)
            {
                lSecondary = 0;
            }
            else
            {
                //UPGRADE_ISSUE: (2064) LpADOLib.fpComboAdo property cboSecondary.ItemData was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx
                lSecondary = ViewModel.cboSecondary.ItemData(ViewModel.cboSecondary.ListIndex);
                ViewModel.sHeadingFilter = ViewModel.sHeadingFilter + ViewModel.cboSecondary.Text + "; ";
            }

            if (ViewModel.lstSpecific.SelectedIndex == -1)
            {
                lSpecific = 0;
            }
            else
            {
                for (int i = 0; i <= ViewModel.lstSpecific.Items.Count - 1; i++)
                {
                    if (ViewModel.lstSpecific.SelectedIndices.Contains(i))
                    {
                        //UPGRADE_ISSUE: (2064) LpADOLib.fpListAdo property lstSpecific.ItemData was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx
                        lSpecific = ViewModel.lstSpecific.ItemData(i);
                        ViewModel.sHeadingFilter = ViewModel.sHeadingFilter + ViewModel.cboSecondary.Text + "; ";
                    }
                }
            }


            //UPGRADE_ISSUE: (2064) FPSpreadADO.fpSpread method sprReport.ClearRange was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx
            ViewModel.sprReport.ClearRange(1, 1, ViewModel.sprReport.MaxCols, ViewModel.sprReport.MaxRows, false);

            if (ViewModel.optPM.Checked)
            {
                if (TrainCL.GetPMTrainingQueryFiltered(sStartDate, sEndDate, iPrimary, lSecondary, lSpecific, ViewModel.CurrShift, sUnit, ViewModel.CurrBatt, sName, sComment, sFlag) != 0)
                {
                    //continue
                }
                else
                {
                    ViewManager.ShowMessage("There were no records returned.  Try changing the filters.", "New PTS Training Query", UpgradeHelpers.Helpers.BoxButtons.OK);
                    return;
                }
            }
            else if (modGlobal.Shared.gSecurity == "ADM")
            {
                if (TrainCL.GetTrainingQueryFiltered(sStartDate, sEndDate, iPrimary, lSecondary, lSpecific, ViewModel.CurrShift, sUnit, ViewModel.CurrBatt, sName, sComment, sFlag) != 0)
                {
                    //continue
                }
                else
                {
                    ViewManager.ShowMessage("There were no records returned.  Try changing the filters.", "New PTS Training Query", UpgradeHelpers.Helpers.BoxButtons.OK);
                    return;
                }
            }
            else
            {
                if (TrainCL.GetTrainingQueryFilteredForField(sStartDate, sEndDate, iPrimary, lSecondary, lSpecific, ViewModel.CurrShift, sUnit, ViewModel.CurrBatt, sName, sComment, sFlag) != 0)
                {
                    //continue
                }
                else
                {
                    ViewManager.ShowMessage("There were no records returned.  Try changing the filters.", "New PTS Training Query", UpgradeHelpers.Helpers.BoxButtons.OK);
                    return;
                }
            }

            while (!TrainCL.TrainingRecord.EOF)
            {
                CurrRow++;
                ViewModel.sprReport.Row  = CurrRow;
                ViewModel.sprReport.Col  = 1;
                ViewModel.sprReport.Text = modGlobal.Clean(TrainCL.TrainingRecord["name_full"]);
                ViewModel.sprReport.Col  = 2;
                ViewModel.sprReport.Text = modGlobal.Clean(TrainCL.TrainingRecord["shift_code"]);
                ViewModel.sprReport.Col  = 3;
                ViewModel.sprReport.Text = modGlobal.Clean(TrainCL.TrainingRecord["unit_code"]);
                ViewModel.sprReport.Col  = 4;
                ViewModel.sprReport.Text = modGlobal.Clean(TrainCL.TrainingRecord["battalion_code"]);
                ViewModel.sprReport.Col  = 5;
                ViewModel.sprReport.Text = modGlobal.Clean(TrainCL.TrainingRecord["primary_code"]);
                ViewModel.sprReport.Col  = 6;
                ViewModel.sprReport.Text = modGlobal.Clean(TrainCL.TrainingRecord["secondary_code"]);
                ViewModel.sprReport.Col  = 7;
                ViewModel.sprReport.Text = modGlobal.Clean(TrainCL.TrainingRecord["specific_code"]);

                //comment
                if (modGlobal.Clean(TrainCL.TrainingRecord["comments"]) != "")
                {
                    ViewModel.sprReport.TextTip           = FarPoint.ViewModels.TextTipPolicy.Floating;
                    ViewModel.sprReport.Col               = 7;
                    ViewModel.sprReport.CellNoteIndicator = true;
                    //UPGRADE_ISSUE: (2064) FPSpreadADO.fpSpread property sprReport.CellNote was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx
                    ViewModel.sprReport.CellNote = modGlobal.Clean(TrainCL.TrainingRecord["comments"]);
                }
                ViewModel.sprReport.Col = 8;
                if (modGlobal.Clean(TrainCL.TrainingRecord["training_date"]) == "")
                {
                    ViewModel.sprReport.Text = "";
                }
                else if (Convert.ToDateTime(TrainCL.TrainingRecord["training_date"]).ToString("M/d/yyyy") == "1/1/1900")
                {
                    ViewModel.sprReport.Text = "";
                }
                else
                {
                    ViewModel.sprReport.Text = Convert.ToDateTime(TrainCL.TrainingRecord["training_date"]).ToString("M/d/yyyy");
                }

                //comment
                if (modGlobal.Clean(TrainCL.TrainingRecord["FlagComment"]) != "")
                {
                    ViewModel.sprReport.TextTip           = FarPoint.ViewModels.TextTipPolicy.Floating;
                    ViewModel.sprReport.Col               = 8;
                    ViewModel.sprReport.CellNoteIndicator = true;
                    //UPGRADE_ISSUE: (2064) FPSpreadADO.fpSpread property sprReport.CellNote was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx
                    ViewModel.sprReport.CellNote = modGlobal.Clean(TrainCL.TrainingRecord["FlagComment"]);
                }
                ViewModel.sprReport.Col = 9;
                if (modGlobal.Clean(TrainCL.TrainingRecord["training_hours"]) == "")
                {
                    ViewModel.sprReport.Text = "";
                }
                else if (modGlobal.Clean(TrainCL.TrainingRecord["training_hours"]) == "0")
                {
                    ViewModel.sprReport.Text = "";
                }
                else
                {
                    //UPGRADE_WARNING: (1068) GetVal() of type Variant is being forced to string. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                    ViewModel.sprReport.Text = Convert.ToString(modGlobal.GetVal(TrainCL.TrainingRecord["training_hours"]));
                }

                if (modGlobal.Clean(TrainCL.TrainingRecord["pass_fail"]) == "F")
                {
                    ViewModel.sprReport.Col       = 1;
                    ViewModel.sprReport.Col2      = ViewModel.sprReport.MaxCols;
                    ViewModel.sprReport.Row       = CurrRow;
                    ViewModel.sprReport.Row2      = CurrRow;
                    ViewModel.sprReport.BlockMode = true;
                    ViewModel.sprReport.BlockMode = false;
                }
                else
                {
                    ViewModel.sprReport.Col       = 1;
                    ViewModel.sprReport.Col2      = ViewModel.sprReport.MaxCols;
                    ViewModel.sprReport.Row       = CurrRow;
                    ViewModel.sprReport.Row2      = CurrRow;
                    ViewModel.sprReport.BlockMode = true;
                    ViewModel.sprReport.BlockMode = false;
                }

                TrainCL.TrainingRecord.MoveNext();
            }
            ;
            ViewModel.lbCount.Text      = "Total Count: " + ViewModel.sprReport.DataRowCnt.ToString();
            ViewModel.sprReport.MaxRows = ViewModel.sprReport.DataRowCnt;
        }