public ApiResponse <CustomerDto> SearchCustomer(string token, SearchCustomerDto model) { string response = GetResponse(_settings.BaseUrl + "Cashier/SearchCustomer", HttpMethod.Post, model, token); var result = JsonConvert.DeserializeObject <ApiResponse <CustomerDto> >(response.ToString()); return(result); }
public IActionResult Customer(SearchCustomerDto model) { if (!ModelState.IsValid) { return(View(model)); } ApiResponse <CustomerDto> resultCustomer = _buybackGateway.SearchCustomer(UserData.Token, model); if (resultCustomer.IsError) { ModelState.AddModelError(string.Empty, resultCustomer.Message); return(View(model)); } ViewBag.Customer = resultCustomer.Result; return(View(model)); }