public FindApartmentResponse FindApartment(FindApartmentRequest request)
        {
            AdministrationServiceDAO adminDAO = new AdministrationServiceDAO();
            apartment result = adminDAO.FindApartment(request.id, request.number_of_beds, request.apartment_number.ToString());

            return(new FindApartmentResponse(result));
        }
示例#2
0
        public FindApartmentResponse FindApartment(FindApartmentRequest request)
        {
            AdministrationServiceDAO adminDAO = new AdministrationServiceDAO();

            apartment[] result = adminDAO.FindApartment(request.id, request.num_of_beds);
            if (result != null)
            {
                return(new FindApartmentResponse(result));
            }
            else
            {
                ThrowNotFoundException(request.id);
                return(null);
            }
        }
示例#3
0
        public string GetApartment(string id)
        {
            AdministrationServiceDAO adminDAO = new AdministrationServiceDAO();

            apartment[] ap = adminDAO.FindApartment(Convert.ToInt32(id), 1);
            if (ap != null)
            {
                return(JsonConvert.SerializeObject(ap));
            }
            else
            {
                Response response = new Response();
                response.status = "not_found";
                return(JsonConvert.SerializeObject(response));
            }
        }