Exemplo n.º 1
0
        public HttpResponseMessage CompanyAdminEdit(CompanyAdminDomain model, int id)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            bool isSuccessful = _CompanyAdminService.UpdateCompanyAdmin(model);

            ItemResponse <bool> response = new ItemResponse <bool>();

            response.Item = isSuccessful;

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
Exemplo n.º 2
0
        public HttpResponseMessage CompanyGetById(int id)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            CompanyAdminDomain singleCompany = _CompanyAdminService.CompanyAndAddressGetId(id);

            ItemResponse <CompanyAdminDomain> response = new ItemResponse <CompanyAdminDomain>();

            response.Item = singleCompany;

            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }