public async Task <IEnumerable <UsersSessionList> > GetUsersSessionList(FilteredSessionListRequest sessionListRequest) { try { IEnumerable <UsersSessionList> UsersSessionLists = new List <UsersSessionList>(); using (IDbConnection con = new SqlConnection(_connectionString)) { UsersSessionLists = await con.QueryAsync <UsersSessionList>("SSP_getSessionListByUserId", new { UserId = sessionListRequest.MemberId, SessionValue = sessionListRequest.SessionValue, Category = sessionListRequest.Category, SessionName = sessionListRequest.SessionName, Type = sessionListRequest.Type, StartDate = sessionListRequest.StartDate, EndDate = sessionListRequest.EndDate, OffSet = sessionListRequest.OffSet, Limit = sessionListRequest.Limit, }, commandType : CommandType.StoredProcedure); } if (UsersSessionLists.Count() == 0) { return(null); } return(UsersSessionLists); } catch (Exception ex) { throw ex; } }
public async Task <IActionResult> GetSessionListForUsers([FromBody] FilteredSessionListRequest sessionListRequest) { JsonResponse <IEnumerable <UsersSessionList> > objResult = new JsonResponse <IEnumerable <UsersSessionList> >(); try { HttpContext context = HttpContext; IEnumerable <UsersSessionList> sessionLists = await this._settingService.GetUsersSessionList(sessionListRequest); if (sessionLists != null && sessionLists.Count() > 0) { objResult.Data = sessionLists; objResult.Status = StaticResource.SuccessStatusCode; objResult.Message = StaticResource.SuccessMessage; return(new OkObjectResult(objResult)); } else { objResult.Data = null; objResult.Status = StaticResource.NotFoundStatusCode; objResult.Message = StaticResource.NotFoundMessage; return(new OkObjectResult(objResult)); } } catch (Exception ex) { HttpContext.RiseError(ex); objResult.Data = null; objResult.Status = StaticResource.FailStatusCode; objResult.Message = StaticResource.FailMessage; } return(new OkObjectResult(objResult)); }
public async Task <IEnumerable <SessionList> > GetPractitionerSessionList(FilteredSessionListRequest request, HttpContext context) { try { return(await this.practitionerRepo.GetPractitionerSessionList(request, context)); } catch (Exception ex) { throw ex; } }
public async Task <IEnumerable <UsersSessionList> > GetUsersSessionList(FilteredSessionListRequest sessionListRequest) { try { return(await this._settingsRepo.GetUsersSessionList(sessionListRequest)); } catch (Exception ex) { throw ex; } }