public ServiceResult <IEnumerable <CustomerViewModel> > Search(CustomerSearchInputModel request) { IRestRequest SearchCustomers = new RestRequest("api/CustomerManagement", method: Method.GET); IRestResponse <ServiceResult <IEnumerable <CustomerViewModel> > > Result = RestProvider.GetInstance().Get <ServiceResult <IEnumerable <CustomerViewModel> > >(SearchCustomers); if (Result != null) { return(Result.Data); } return(null); }
private List <CustomerSearch.Clubs> GetClubDetails(CustomerSearchInputModel inputModel) { TalentDataObjects dataObjects = new TalentDataObjects(); dataObjects.Settings = Environment.Settings.DESettings; List <CustomerSearch.Clubs> clubs = new List <CustomerSearch.Clubs>(); DataTable partnerClub = dataObjects.ClubSettings.GetPartnerUserClubByAgentTypeLoginID(inputModel.AgentType, inputModel.AgentLoginID); if (partnerClub.Rows.Count > 0) { clubs = Data.PopulateObjectListFromTable <CustomerSearch.Clubs>(dataObjects.ClubSettings.GetTblClubDetailsByAgentType(inputModel.AgentType)); } return(clubs); }
// 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 ServiceResult <IEnumerable <CustomerViewModel> > Search(CustomerSearchInputModel request) { return(new ServiceResult <IEnumerable <CustomerViewModel> >(StatusCode.Ok) { Data = new List <CustomerViewModel>() { new CustomerViewModel() { Id = 1, Address = "تهران - اسلامشهر - واوان - بلوار هشت بهشت - خیابان جوادی - کوچه 12 - پلاک 1", Code = "935-44263", District = "اسلامشهر", EconomicCode = "11202225", FirstName = "یاسر", LastName = "میرزایی", NationalIdentifier = "11020-3654214", PhoneNumber = "09357277842", PostalCode = "33179-52635", RegistrationNumber = "11021025745", }, new CustomerViewModel() { Id = 2, Address = "تهران - محله صادقیه - سه راه تهران ویلا - بن بست قاسمی - پلاک 13", Code = "935-5525563", District = "ستارخان", EconomicCode = "52555254", FirstName = "احمد", LastName = "رجبی", NationalIdentifier = "46657-3654214", PhoneNumber = "09357277758", PostalCode = "1417-48966", RegistrationNumber = "11241421512", }, new CustomerViewModel() { Id = 3, Address = "تهران - ونک - خیابان برزیل - بعد از توانیر - پلاک 9", Code = "935-4654", District = "ونک", EconomicCode = "4654613", FirstName = "وحید", LastName = "شیر محمدی", NationalIdentifier = "13245-3654214", PhoneNumber = "09125663645", PostalCode = "1417-454218", RegistrationNumber = "54644216541", }, new CustomerViewModel() { Id = 4, Address = "تهران - هفت تیر - خیابان خرمشهر - کوچه اقاقیا - پلاک 1 واحد 24", Code = "935-4654", District = "ونک", EconomicCode = "4654613", FirstName = "مهدی", LastName = "رحیمیان", NationalIdentifier = "45636-69854", PhoneNumber = "09121142355", PostalCode = "5497-46548", RegistrationNumber = "49865312351", }, new CustomerViewModel() { Id = 5, Address = "تهران - خیابان بهشتی - نرسیده به سهروردی - خیابان احمد نجفی - پلاک 6", Code = "935-4546", District = "سهروردی", EconomicCode = "6564641613", FirstName = "مجتبی", LastName = "گودرزی", NationalIdentifier = "4561-45645", PhoneNumber = "09124561324", PostalCode = "5451-45461", RegistrationNumber = "4564125645", } } }); }
public JQueryDataTable <CustomerSearchLists> Post(CustomerSearchInputModel input) { CustomerSearchViewModel view = new CustomerSearchBuilder().CustomerSearch(input); return(view.GetJQueryDataTable()); }
public ServiceResult <IEnumerable <CustomerViewModel> > Search(CustomerSearchInputModel request) { return(new ServiceResult <IEnumerable <CustomerViewModel> >(_mapper.Map <IEnumerable <CustomerViewModel> >(_customerRepository.GetAll()))); }
public object FindCustomer(CustomerSearchInputModel model) { throw new NotImplementedException(); }