public HttpResponseMessage GetCustomerList(string CustomerSearchDTO) { CustomerSearchDTO dto = TransformHelper.ConvertBase64JsonStringToDTO <CustomerSearchDTO>(CustomerSearchDTO); ResultDTO <List <CustomerResultDTO> > actionresult = new ResultDTO <List <CustomerResultDTO> >(); try { if (dto.QueryType == 0)//查询客户信息 { actionresult.Object = _ICustomerServices.GetCustomerList(dto); } else if (dto.QueryType == 1)//查询相似客户 { actionresult.Object = _ICustomerServices.GetSimilarCustomerList(dto); } actionresult.SubmitResult = true; actionresult.rows = dto.rows; actionresult.page = dto.page; actionresult.Count = dto.Count; } catch (Exception ex) { actionresult.SubmitResult = false; actionresult.Message = ex.Message; } HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(JsonConvert.SerializeObject(actionresult), System.Text.Encoding.GetEncoding("UTF-8"), "application/json") }; return(result); }
public ActionResult <IEnumerable <CustomerItem> > Get() { IEnumerable <CustomerItem> customerItems = _iCustomerServices.GetCustomerList().Result; List <CustomerItem> customerItemsId = customerItems.ToList(); return(Ok(customerItemsId)); }