public static PagedResult <ActivityDTO> GetActivities() { return(exceptionHandling(delegate { PartialRetrievingInfo pagerInfo = new PartialRetrievingInfo(); pagerInfo.PageSize = -1; return Instance.GetActivities(Token, pagerInfo); })); }
public static PagedResult <SuplementDTO> GetSuplements(PartialRetrievingInfo pageInfo) { return(exceptionHandling(delegate { var param = new GetSupplementsParam(); param.SortOrder = SearchSortOrder.Name; return Instance.GetSuplements(Token, param, pageInfo); })); }
public static PagedResult <CustomerDTO> GetCustomers(CustomerSearchCriteria customerSearchCriteria) { return(exceptionHandling(delegate { PartialRetrievingInfo pagerInfo = new PartialRetrievingInfo(); pagerInfo.PageSize = -1; return Instance.GetCustomers(Token, customerSearchCriteria, pagerInfo); })); }
public async void RetrieveMonth(DateTime monthDate, TrainingDaysHolder holder) { DateTime monthTOShow = monthDate; WorkoutDaysSearchCriteria search = new WorkoutDaysSearchCriteria(); search.UserId = holder.User != null ? (Guid?)holder.User.GlobalId : null; search.CustomerId = holder.CustomerId; search.EndDate = monthDate.AddMonths(1); if (Settings.NumberOfMonthToRetrieve > 1) {//-1 because we need to subtract months monthDate = monthDate.AddMonths(-1 * (Settings.NumberOfMonthToRetrieve - 1)); } search.StartDate = monthDate; PartialRetrievingInfo pageInfo = new PartialRetrievingInfo(); pageInfo.PageSize = 0;//we want to download all entries in selected period of time var m = new ServiceManager <GetTrainingDaysCompletedEventArgs>(delegate(BodyArchitectAccessServiceClient client1, EventHandler <GetTrainingDaysCompletedEventArgs> operationCompleted) { client1.GetTrainingDaysCompleted -= operationCompleted; client1.GetTrainingDaysCompleted += operationCompleted; client1.GetTrainingDaysAsync(ApplicationState.Current.SessionData.Token, search, pageInfo); }); m.OperationCompleted += (s, a) => { if (a.Error != null) { onTrainingDaysRetrieved(monthTOShow); BAMessageBox.ShowError(ApplicationStrings.ApplicationState_ErrRetrieveTrainingDays); return; } if (a.Result != null && a.Result.Result != null) { RetrievedDays(monthDate, Settings.NumberOfMonthToRetrieve, a.Result.Result.Items, holder); onTrainingDaysRetrieved(monthTOShow); } }; if (!m.Run()) { if (ApplicationState.Current.IsOffline) { BAMessageBox.ShowError(ApplicationStrings.ErrOfflineMode); } else { BAMessageBox.ShowError(ApplicationStrings.ErrNoNetwork); } onTrainingDaysRetrieved(monthTOShow); } }
public PagedResult <ExerciseDTO> GetExercises(Token token, ExerciseSearchCriteria searchCriteria, PartialRetrievingInfo retrievingInfo) { BodyArchitect.Service.V2.InternalBodyArchitectService service = new V2.InternalBodyArchitectService(NHibernateContext.Current().Session); V2.Model.Token v2token = new V2.Model.Token(token.SessionId, token.Language); V2.Model.ExerciseSearchCriteria crit = new V2.Model.ExerciseSearchCriteria(); V2.Model.PartialRetrievingInfo nfo = new V2.Model.PartialRetrievingInfo(); crit = Mapper.Map <V2.Model.ExerciseSearchCriteria>(searchCriteria); nfo = Mapper.Map <V2.Model.PartialRetrievingInfo>(retrievingInfo); var res = service.GetExercises(v2token, crit, nfo); var ret = Mapper.Map <V2.Model.PagedResult <V2.Model.ExerciseDTO>, PagedResult <ExerciseDTO> >(res); return(ret); }
public static PagedResult <ExerciseRecordsReportResultItem> ReportExerciseRecords(ExerciseRecordsParams param, PartialRetrievingInfo pageInfo) { return(exceptionHandling(() => Instance.ReportExerciseRecords(Token, param, pageInfo))); }
public static PagedResult <MessageDTO> GetMessages(GetMessagesCriteria param, PartialRetrievingInfo pageInfo) { return(exceptionHandling(() => Instance.GetMessages(Token, param, pageInfo))); }
public static PagedResult <MyPlaceDTO> GetMyPlaces(MyPlaceSearchCriteria param, PartialRetrievingInfo pageInfo) { return(exceptionHandling(() => Instance.GetMyPlaces(Token, param, pageInfo))); }
public static PagedResult <SupplementCycleDefinitionDTO> GetSupplementsCycleDefinitions(GetSupplementsCycleDefinitionsParam param, PartialRetrievingInfo pageInfo) { return(exceptionHandling(() => Instance.GetSupplementsCycleDefinitions(Token, param, pageInfo))); }
public static PagedResult <MyTrainingDTO> GetMyTrainings(GetMyTrainingsParam param, PartialRetrievingInfo pageInfo) { return(exceptionHandling(() => Instance.GetMyTrainings(Token, param, pageInfo))); }
public static PagedResult <ProductInfoDTO> GetProducts(GetProductsParam criteria, PartialRetrievingInfo pageInfo) { return(exceptionHandling(() => Instance.GetProducts(Token, criteria, pageInfo))); }
public static PagedResult <ReminderItemDTO> GetReminders(GetRemindersParam remindersParam, PartialRetrievingInfo pageInfo) { return(exceptionHandling(() => Instance.GetReminders(Token, remindersParam, pageInfo))); }
public static PagedResult <TrainingDayDTO> GetTrainingDays(WorkoutDaysSearchCriteria searchCriteria, PartialRetrievingInfo pageInfo) { return(exceptionHandling(delegate { return Instance.GetTrainingDays(Token, searchCriteria, pageInfo); })); }
public static PagedResult <ExerciseDTO> GetExercises(ExerciseSearchCriteria searchCriteria, PartialRetrievingInfo pageInfo) { return(exceptionHandling(delegate { pageInfo.PageSize = GetPageSize(150); return Instance.GetExercises(Token, searchCriteria, pageInfo); })); }
public static PagedResult <ChampionshipDTO> GetChampionships(GetChampionshipsCriteria criteria, PartialRetrievingInfo retrievingInfo) { return(exceptionHandling(() => Instance.GetChampionships(Token, criteria, retrievingInfo))); }
public static PagedResult <ScheduleEntryBaseDTO> GetScheduleEntries(GetScheduleEntriesParam getScheduleEntriesParam, PartialRetrievingInfo retrievingInfo) { return(exceptionHandling(delegate { retrievingInfo.PageSize = GetPageSize(retrievingInfo.PageSize); return Instance.GetScheduleEntries(Token, getScheduleEntriesParam, retrievingInfo); })); }
public static PagedResult <TrainingPlan> GetWorkoutPlans(WorkoutPlanSearchCriteria searchCriteria, PartialRetrievingInfo pagerInfo) { return(exceptionHandling(delegate { pagerInfo.LongTexts = false; return Instance.GetWorkoutPlans(Token, searchCriteria, pagerInfo); })); }
public static PagedResult <UserSearchDTO> GetUsers(UserSearchCriteria searchCriteria, PartialRetrievingInfo pagerInfo) { return(exceptionHandling(() => { pagerInfo.PageSize = GetPageSize(40); return Instance.GetUsers(Token, searchCriteria, pagerInfo); })); }
public static PagedResult <CommentEntryDTO> GetComments(IRatingable ratingable, PartialRetrievingInfo retrievingInfo) { return(exceptionHandling(delegate { retrievingInfo.PageSize = GetPageSize(retrievingInfo.PageSize); return Instance.GetComments(Token, ratingable.GlobalId, retrievingInfo); })); }
public async Task RetrieveMonthAsync(DateTime monthDate, TrainingDaysHolder holder) { DateTime monthTOShow = monthDate; WorkoutDaysSearchCriteria search = new WorkoutDaysSearchCriteria(); search.UserId = holder.User != null ? (Guid?)holder.User.GlobalId : null; search.CustomerId = holder.CustomerId; search.EndDate = monthDate.AddMonths(1); if (Settings.NumberOfMonthToRetrieve > 1) {//-1 because we need to subtract months monthDate = monthDate.AddMonths(-1 * (Settings.NumberOfMonthToRetrieve - 1)); } search.StartDate = monthDate; PartialRetrievingInfo pageInfo = new PartialRetrievingInfo(); pageInfo.PageSize = 0;//we want to download all entries in selected period of time try { var result = await BAService.GetTrainingDaysAsync(search, pageInfo); RetrievedDays(monthDate, Settings.NumberOfMonthToRetrieve, result.Items, holder); } catch (NetworkException) { if (ApplicationState.Current.IsOffline) { BAMessageBox.ShowWarning(ApplicationStrings.EntryObjectPageBase_SavedLocallyOnly); } else { BAMessageBox.ShowError(ApplicationStrings.ErrNoNetwork); } } catch (Exception) { BAMessageBox.ShowError(ApplicationStrings.ApplicationState_ErrRetrieveTrainingDays); } //var m = new ServiceManager<GetTrainingDaysCompletedEventArgs>(delegate(BodyArchitectAccessServiceClient client1, EventHandler<GetTrainingDaysCompletedEventArgs> operationCompleted) //{ // client1.GetTrainingDaysCompleted -= operationCompleted; // client1.GetTrainingDaysCompleted += operationCompleted; // client1.GetTrainingDaysAsync(ApplicationState.Current.SessionData.Token, search, pageInfo); //}); //m.OperationCompleted += (s, a) => // { // if (a.Error != null) // { // onTrainingDaysRetrieved(monthTOShow); // BAMessageBox.ShowError(ApplicationStrings.ApplicationState_ErrRetrieveTrainingDays); // return; // } // if (a.Result != null && a.Result.Result!=null ) // { // RetrievedDays(monthDate, Settings.NumberOfMonthToRetrieve, a.Result.Result.Items, holder); // onTrainingDaysRetrieved(monthTOShow); // } //}; //if(!m.Run()) //{ // if(ApplicationState.Current.IsOffline) // { // BAMessageBox.ShowError(ApplicationStrings.ErrOfflineMode); // } // else // { // BAMessageBox.ShowError(ApplicationStrings.ErrNoNetwork); // } // onTrainingDaysRetrieved(monthTOShow); //} }
public static PagedResult <PaymentBasketDTO> GetPaymentBaskets(GetPaymentBasketParam getPaymentBasketParam, PartialRetrievingInfo retrievingInfo) { return(exceptionHandling(() => Instance.GetPaymentBaskets(Token, getPaymentBasketParam, retrievingInfo))); }
public static PagedResult <CustomerGroupDTO> GetCustomerGroups(CustomerGroupSearchCriteria criteria, PartialRetrievingInfo pageInfo) { return(exceptionHandling(() => Instance.GetCustomerGroups(Token, criteria, pageInfo))); }
public static PagedResult <TrainingDayCommentDTO> GetBlogComments(TrainingDayInfoDTO day, PartialRetrievingInfo info) { return(exceptionHandling(delegate { info.PageSize = GetPageSize(info.PageSize); return Instance.GetTrainingDayComments(Token, day, info); })); }