public ActionResult <CompliantProvider> SortCompliantProviders() { int code = 200; BaseResponse res = null; //IUserAuthData uData = _authService.GetCurrentUser(); try { CompliantProvider cp = _service.SortCompliantProviders(); if (cp == null) { code = 404; res = new ErrorResponse("App resource not found"); } else { res = new ItemResponse <CompliantProvider> { Item = cp }; } } catch (Exception ex) { code = 500; res = new ErrorResponse(ex.Message); base.Logger.LogError(ex.ToString()); } return(StatusCode(code, res)); }
public ActionResult <CompliantProvider> SortCompliantByState(int stateId) { int code = 200; BaseResponse res = null; try { CompliantProvider cp = _service.SortCompliantByState(stateId); if (cp == null) { code = 404; res = new ErrorResponse("App resource not found"); } else { res = new ItemResponse <CompliantProvider> { Item = cp }; } } catch (Exception ex) { code = 500; res = new ErrorResponse(ex.Message); base.Logger.LogError(ex.ToString()); } return(StatusCode(code, res)); }
public CompliantProvider SortCompliantProviders() { CompliantProvider cp = new CompliantProvider(); _data.ExecuteCmd("dbo.Providers_SortByCompliant", inputParamMapper : delegate(SqlParameterCollection col) { }, singleRecordMapper : delegate(IDataReader reader, short set) { cp.Compliant = reader.GetSafeInt32(0); cp.NonCompliant = reader.GetSafeInt32(1); cp.TotalCount = reader.GetSafeInt32(2); }); return(cp); }
public CompliantProvider SortCompliantByState(int stateId) { CompliantProvider cp = new CompliantProvider(); _data.ExecuteCmd("dbo.Providers_SelectCompliantByState", inputParamMapper : delegate(SqlParameterCollection col) { col.AddWithValue("@stateId", stateId); }, singleRecordMapper : delegate(IDataReader reader, short set) { cp.Compliant = reader.GetSafeInt32(0); cp.NonCompliant = reader.GetSafeInt32(1); cp.TotalCount = reader.GetSafeInt32(2); }); return(cp); }