/// <summary> /// Load Data Transfer All. Violate SRP. /// </summary> /// <returns></returns> private async Task <IEnumerable <Dto> > LoadDtoAll() { IEnumerable <Dto> list = null; try { HelperView?.Clear(); var countItem = await _helperDataServices.GetItemsCount <Entity>(); var currentList = new IncrementalList <Dto>(LoadMoreItems) { MaxItemCount = countItem }; var tmplist = await _helperDataServices.GetPagedSummaryDoAsync <Dto, Entity>(1, PageSize); HelperView = currentList; HelperView.LoadItems(tmplist); list = currentList; } catch (Exception e) { throw new DataLayerException(e.Message, e); } if (list == null) { return(null); } return(list); }
/// <summary> /// Конструктор /// </summary> /// <param name="parPlatform">Объект платформы</param> public HelperController(Platform parPlatform) { _helper = new Helper(); View = new HelperView(parPlatform, _helper); _helper.Initialize(); parPlatform.EscDown += OnEscDown; }
/// <summary> /// Update the value. /// </summary> protected virtual void Update() { HelperView = LoadView(); if (HelperView != null) { PreviousValue = CurrentValue; CurrentValue = HelperView.FirstOrDefault(); } }
/// <summary> /// Element to delete the entity /// </summary> /// <param name="payLoad">Payload to be deleted</param> /// <returns></returns> public override async Task <bool> DeleteEntity(DataPayLoad payLoad) { var cv = CurrentValue; bool entityDeleted = false; if (cv != null) { entityDeleted = await DataServices.GetHelperDataServices() .ExecuteAsyncDelete <Dto, Entity>(cv); if (entityDeleted) { HelperView.Remove(cv); HelperDto = HelperView.FirstOrDefault(); //Update(); } else { MessageBox.Show("Error deleting item"); } } return(entityDeleted); }
/// <summary> /// Update. /// </summary> protected override void Update() { HelperView = LoadView(); PreviousValue = CurrentValue; CurrentValue = HelperView.FirstOrDefault(); }
internal void ShowTeachingTips() => HelperView.ShowTeachingTips(GaugeView.TeachingTipTarget, JournalView.TeachingTipTarget);