public async Task <ApiLibraryDetailResponse> DeleteLibraryDetail(long id) { var apiResp = new ApiLibraryDetailResponse { ResponseType = -1, ResponseMessage = "Failed" }; var createdBy = 1; var libaryId = await(new JukeBox.BLL.Library()).DeleteLibraryDetail(id, createdBy); if (libaryId > 1) { var retVal = await(new JukeBox.BLL.Library()).GetLibraryDetail(libaryId, 0); if (retVal.Count > 0) { apiResp.ResponseObject = new List <ApiLibraryDetail>(); foreach (var _library in retVal) { var libraryDetail = new ApiLibraryDetail(); libraryDetail.Bind(_library); apiResp.ResponseObject.Add(libraryDetail); } apiResp.ResponseType = 1; apiResp.ResponseMessage = "Success"; } } return(apiResp); }
public async Task <ApiLibraryDetailResponse> GetLibraryDetail(long id, int?clientid = null) { var apiResp = new ApiLibraryDetailResponse { ResponseType = -1, ResponseMessage = "Failed" }; var retVal = await(new JukeBox.BLL.Library()).GetLibraryDetail(id, clientid); if (retVal.Count > 0) { apiResp.ResponseObject = new List <ApiLibraryDetail>(); foreach (var _library in retVal) { var libraryDetail = new ApiLibraryDetail(); libraryDetail.Bind(_library); apiResp.ResponseObject.Add(libraryDetail); } apiResp.ResponseType = 1; apiResp.ResponseMessage = "Success"; } return(apiResp); }