public HttpResponseMessage GetCompany() { int companyId = 1; List <EmployeeDTO> employeelist = service.getCompanyEmployees(companyId); return(OOPSResult.OKResult(employeelist)); }
public HttpResponseMessage Get() { int companyId = 1; int emplooyeeId = 3; EmployeeDTO selectedEmployee = service.getEmployee(emplooyeeId); if (selectedEmployee == null) { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, emplooyeeId + sysLanguage.CompanyTitlesControllerStrings.id_title)); } return(OOPSResult.OKResult(selectedEmployee)); }
public HttpResponseMessage Get() { List <BloodGroupDTO> bloodGroupList = bloodgroupService.getAll(); List <AccessTypeDTO> accessTypeList = accessTypeService.getAll(); StaticTypesViewModel viewModel = new StaticTypesViewModel() { bloodGroupList = bloodGroupList, accessTypeList = accessTypeList }; return(OOPSResult.OKResult(viewModel)); }
public HttpResponseMessage Put(EmployeeDTO employeeDTO) { try { EmployeeDTO dto = service.updateEmployee(employeeDTO); if (dto != null) { return(OOPSResult.OKResult(dto, null, HttpStatusCode.OK)); } else { return(Request.CreateErrorResponse(HttpStatusCode.SeeOther, sysLanguage.CompanyTitlesControllerStrings.update_title)); } } catch (Exception) { return(Request.CreateErrorResponse(HttpStatusCode.SeeOther, sysLanguage.CompanyTitlesControllerStrings.update_title)); } }
public HttpResponseMessage Post(EmployeeDTO employeeDTO) { try { EmployeeDTO dto = service.newEmployee(employeeDTO); if (dto != null) { return(OOPSResult.OKResult(dto, new Uri(Request.RequestUri + "/" + dto.Id), HttpStatusCode.Created)); } else { return(Request.CreateErrorResponse(HttpStatusCode.SeeOther, sysLanguage.CompanyTitlesControllerStrings.add_title)); } } catch (Exception) { return(Request.CreateErrorResponse(HttpStatusCode.SeeOther, sysLanguage.CompanyTitlesControllerStrings.add_title)); } }