public ActionResult getAddress(int id) { try { Addresses address = _addressesService.Get(_ => _.Id == id); return(Ok(address)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task Test_GetAddressById_Is_Ok() { try { AddressModel currentAddressModel = await _addressesService.Get(95, 1); } catch (Exception ex) { Assert.IsFalse(true); } Assert.IsTrue(true); }
public ActionResult getOrderProductStore(int id) { try { OrderProductStores orderProductStores = _orderProductStoresService.Get(_ => _.Id == id); List <OrderProductDetails> orderProductDetails = _orderProductDetailsService.GetMany(_ => _.OrderProductStoreId == orderProductStores.Id).ToList(); orderProductDetails.ForEach(_ => { Products product = _productsService.Get(__ => __.Id == _.ProductId); _.Product = product; }); Orders order = _ordersService.Get(_ => _.Id == orderProductStores.OrderId); Addresses address = _addressesService.Get(_ => _.Id == order.AddressId); OrderProductStoreGetModel orderProductStoreGetModel = new OrderProductStoreGetModel { Id = orderProductStores.Id, Date = orderProductStores.Date, Note = orderProductStores.Note, /* Order = order,*/ Address = address, OrderProductDetails = orderProductDetails, /* OrderStatus = orderProductStores.OrderStatus, * Total = orderProductStores.Total*/ }; return(Ok(orderProductStoreGetModel)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IHttpActionResult Get( string seating = null, string capacity = null, string equipment = null) { if (!paramParser.TryParseNullableSeating(seating, out Seating? seatingValue)) { return(errorsFactory.CreateBadRequest(this, seating, nameof(seating))); } if (!paramParser.TryParseNullableInt32(capacity, out int?minCapacityValue)) { return(errorsFactory.CreateBadRequest(this, capacity, nameof(capacity))); } var equipmentElements = GetEquipmentElements(equipment); var addresses = addressesService.Get(equipmentElements, seatingValue, minCapacityValue); return(Content(HttpStatusCode.OK, addresses)); }
public async Task <Domain.Addresses.AddressModel> Retrieve(QueryAddress query) { var currentAddress = await _addressesService.Get(query.Id); return(currentAddress); }
public string getAddressesOptionSting(long ixAddress) { var address = _addressesService.Get(ixAddress); return(address.sStreetAndNumberOrPostOfficeBoxOne + " " + address.sStreetAndNumberOrPostOfficeBoxTwo + " " + address.sStreetAndNumberOrPostOfficeBoxThree + " " + address.sCityOrSuburb + " " + address.sZipOrPostCode + " " + address.CountrySubDivisionsFKDiffStateOrProvince.sCountrySubDivision + " " + address.Countries.sCountry); }