public ApiResponse <CorporationDto> SearchCorporation(string token, SearchCorporationDto model) { string response = GetResponse(_settings.BaseUrl + "Cashier/SearchCorporation", HttpMethod.Post, model, token); var result = JsonConvert.DeserializeObject <ApiResponse <CorporationDto> >(response.ToString()); return(result); }
public IActionResult Corporation(SearchCorporationDto model) { if (!ModelState.IsValid) { return(View(model)); } ApiResponse <CorporationDto> resultCorporation = _buybackGateway.SearchCorporation(UserData.Token, model); if (resultCorporation.IsError) { ModelState.AddModelError(string.Empty, resultCorporation.Message); return(View(model)); } ViewBag.Corporation = resultCorporation.Result; return(View(model)); }
public ApiResponse <CorporationDto> SearchCorporation(SearchCorporationDto searchCorporation) { var response = new ApiResponse <CorporationDto>(); CorporationDto appUserCorporation = _corporationManager.Users.Select( s => new CorporationDto() { Id = s.Id, TaxNumber = s.TaxNumber, Name = s.Name, LastName = s.LastName, Address = s.Address, Deposit = s.Deposit, IsActive = s.IsActive }).SingleOrDefault(r => r.TaxNumber == searchCorporation.TaxNumber); if (appUserCorporation == null) { return(response.ErrorResult(default, ResponseMessageEnum.SubscriptionNotFound, 404));