public UpdateApartmentResponse UpdateApartment(UpdateApartmentRequest request)
        {
            AdministrationServiceDAO adminDAO = new AdministrationServiceDAO();
            bool result = adminDAO.UpdateApartment(request.apartment);

            return(new UpdateApartmentResponse(result));
        }
Exemplo n.º 2
0
        public UpdateApartmentResponse UpdateApartment(UpdateApartmentRequest request)
        {
            AdministrationServiceDAO adminDAO = new AdministrationServiceDAO();
            bool result = adminDAO.UpdateApartment(request.apartment);

            if (result)
            {
                return(new UpdateApartmentResponse(result));
            }
            else
            {
                ThrowNotFoundException(request.apartment.id);
                return(null);
            }
        }
Exemplo n.º 3
0
        public string UpdateApartment(string id)
        {
            AdministrationServiceDAO adminDAO = new AdministrationServiceDAO();

            string    body = GetBody();
            apartment ap   = JsonConvert.DeserializeObject <apartment>(body);

            ap.id = Convert.ToInt32(id);

            Response response = new Response();

            if (adminDAO.UpdateApartment(ap))
            {
                response.status = "ok";
            }
            else
            {
                response.status = "failed";
            }
            return(JsonConvert.SerializeObject(response));
        }