public CompanySearchViewModel CompanySearch(CompanySearchInputModel inputModel) { CompanySearchViewModel viewModel = new CompanySearchViewModel(); // Draw parameter needs to be returned to the datatable so we can determin if we need // to store the record count. viewModel.Draw = inputModel.Draw; TalentSearch talentSearch = new TalentSearch(); Mapper.CreateMap <CompanySearchInputModel, DECompanySearch>(); talentSearch.CompanySearch = Mapper.Map <DECompanySearch>(inputModel); Mapper.CreateMap <CompanySearchInputModel, DECompany>(); talentSearch.CompanySearch.Company = Mapper.Map <DECompany>(inputModel); talentSearch.Settings = Environment.Settings.DESettings; ErrorObj err = talentSearch.PerformCompanySearch(); CompanySearchLists SearchResults = new CompanySearchLists(); SearchResults.Errors = Data.PopulateErrorObject(err, talentSearch.ResultDataSet, talentSearch.Settings, null); if (!SearchResults.Errors.HasError) { SearchResults.Companies = Data.PopulateObjectListFromTable <CompanySearch.Company>(talentSearch.ResultDataSet.Tables["SearchResults"]); // Populate the datatablelist in the base view model with our lists viewModel.DataTableList = new List <CompanySearchLists>(); viewModel.DataTableList.Add(SearchResults); viewModel.RecordsFiltered = (int)talentSearch.ResultDataSet.Tables["StatusResults"].Rows[0]["RecordsReturned"]; viewModel.RecordsTotal = SearchResults.Companies.Count; } return(viewModel); }
// PopulateCustomerSearchViewModelObjectLists - CustomerSearch public CustomerSearchViewModel CustomerSearch(CustomerSearchInputModel inputModel) { CustomerSearchViewModel viewModel = new CustomerSearchViewModel(); // Draw parameter needs to be returned to the datatable so we can determin if we need // to store the record count. inputModel.Source = "W"; viewModel.Draw = inputModel.Draw; TalentSearch talentSearch = new TalentSearch(); Mapper.CreateMap <CustomerSearchInputModel, DECustomerSearch>(); talentSearch.CustomerSearch = Mapper.Map <DECustomerSearch>(inputModel); Mapper.CreateMap <CustomerSearchInputModel, DECustomer>(); talentSearch.CustomerSearch.Customer = Mapper.Map <DECustomer>(inputModel); talentSearch.Settings = Environment.Settings.DESettings; ErrorObj err = talentSearch.PerformCustomerSearch(); CustomerSearchLists SearchResults = new CustomerSearchLists(); SearchResults.Errors = Data.PopulateErrorObject(err, talentSearch.ResultDataSet, talentSearch.Settings, null); if (!SearchResults.Errors.HasError) { SearchResults.Customers = Data.PopulateObjectListFromTable <CustomerSearch.Customers>(talentSearch.ResultDataSet.Tables["SearchResults"]); if (SearchResults.Customers != null && SearchResults.Customers.Count > 0) { if (!string.IsNullOrEmpty(inputModel.AgentType) && !string.IsNullOrEmpty(inputModel.AgentLoginID)) { SearchResults.Clubs = GetClubDetails(inputModel); } } // Populate the datatablelist in the base view model with our lists viewModel.DataTableList = new List <CustomerSearchLists>(); viewModel.DataTableList.Add(SearchResults); viewModel.RecordsFiltered = (int)talentSearch.ResultDataSet.Tables["StatusResults"].Rows[0]["RecordsReturned"]; viewModel.RecordsTotal = SearchResults.Customers.Count; } return(viewModel); }
public void SelectIdByFilterTest() { TalentSearch.GetInstance().SelectIdByFilter(string.Empty, string.Empty, "C#,JAVA", string.Empty, string.Empty, "2017-12-15", "2018-01-05", "不限", "不限", string.Empty, string.Empty); }