Пример #1
0
        public Customer_SearchModel GetCustomersList(ClientConnect.Customer.AdvSearchCriteria model, int pageNumber)
        {
            var result = new Customer_SearchModel();


            result.AdvSearchCriteria = model;
            result.CurrentPage       = pageNumber;

            if (!string.IsNullOrEmpty(model.Surname) || !string.IsNullOrEmpty(model.TelNo) || !string.IsNullOrEmpty(model.Postcode) || !string.IsNullOrEmpty(model.PolicyNumber) || !string.IsNullOrEmpty(model.ClientCustRef) || !string.IsNullOrEmpty(model.Address))
            {
                //Logging
                Log.File.Info(Msg.GenerateLogMsg("Finding jobs... Criteria:"));

                // get products
                var list = Repository.GetCustomers(model.Surname, model.Postcode, model.TelNo, model.PolicyNumber, model.ClientCustRef, model.Address, pageNumber, Settings.Default.JobSearchPageSize, StoreId);

                // if list empty
                //if ((list != null) && (list.Count > 0))
                //{
                //    result.CurrentPage = pageNumber;
                //    result.SearchResults = list;
                //    result.FirstItemIndex = list[0].StartElem;
                //    result.TotalRecords = list[0].ElemCount;
                //    result.LastItemIndex = list[0].LastElem;
                //}
            }
            return(result);
        }
Пример #2
0
        public Customer_SearchModel GetCustomersList(ClientConnect.Customer.AdvSearchCriteria model, int pageNumber)
        {
            var result = new Customer_SearchModel();


            result.AdvSearchCriteria = model;
            result.CurrentPage       = pageNumber;

            if (!string.IsNullOrEmpty(model.Surname) || !string.IsNullOrEmpty(model.TelNo) || !string.IsNullOrEmpty(model.Postcode) || !string.IsNullOrEmpty(model.PolicyNumber) || !string.IsNullOrEmpty(model.ClientCustRef) || !string.IsNullOrEmpty(model.Address))
            {
                //Logging
                Log.File.Info(Msg.GenerateLogMsg("Finding customers:"));

                var list = Repository.GetCustomers(model.Surname, model.Postcode, model.TelNo, model.PolicyNumber, model.ClientCustRef,
                                                   model.Address, model.UseAndInWhereCondition.HasValue?model.UseAndInWhereCondition.Value:false, pageNumber, Settings.Default.JobSearchPageSize, StoreId);

                if ((list != null) && (list.Count > 0))
                {
                    result.CurrentPage    = pageNumber;
                    result.SearchResults  = list;
                    result.FirstItemIndex = list[0].StartElem;
                    result.TotalRecords   = list[0].ElemCount;
                    result.LastItemIndex  = list[0].LastElem;
                }
            }
            return(result);
        }
Пример #3
0
 public Customer_SearchModel()
 {
     SearchCriteria    = string.Empty;
     CurrentPage       = 1;
     FirstItemIndex    = 0;
     TotalRecords      = 0;
     LastItemIndex     = 0;
     SearchResults     = new List <Customer_SearchResult>();
     AdvSearchCriteria = new AdvSearchCriteria();
 }