Example #1
0
        public int DoSearch(string searchCriteria, string searchForType)
        {
            appDB.EFileSearchDataTable dt;
            switch (searchForType)
            {
            case OfficerPrefsBE.qsiCaseFileNumber:
                dt = AtMng.FileSearchByICASE(searchCriteria);
                break;

            case OfficerPrefsBE.qsSIN:
                dt = AtMng.FileSearchBySIN(searchCriteria);
                break;

            case OfficerPrefsBE.qsOfficeFileNumber:
                dt = AtMng.FileSearchByOfficeFileNum(searchCriteria);
                break;

            case OfficerPrefsBE.qsLastName:
                dt = AtMng.FileSearchByLastName(searchCriteria);
                break;

            case OfficerPrefsBE.qsFileNumber:
                dt = AtMng.FileSearchByFileNumber(searchCriteria);
                break;

            case OfficerPrefsBE.qsFullFileNumber:
                dt = AtMng.FileSearchByFullFileNumber(searchCriteria);
                break;

            case "qsFileName":
            case OfficerPrefsBE.qsFileNameEng:
            case OfficerPrefsBE.qsFileNameFre:
                dt = AtMng.FileSearchByKeyword(searchCriteria);
                break;

            case OfficerPrefsBE.qsFullFileName:
                dt = AtMng.FileSearchByFullFileName(searchCriteria);
                break;

            default:
                dt = null;
                break;
            }
            System.Diagnostics.Trace.WriteLine("search", "bind");

            Bs.DataSource = dt;

            Bs.MoveFirst();

            return(dt.Rows.Count);
        }