//---------------------------------------------------------------------------------------------------- public void Instantiate_Sub() { this.jRoot = J("<div class='StartPage jRoot'>"); this.jRoot.append(this.GetHtmlRoot()); this.TopBar = new TopBar(); jF2(".TopBarHolder").append(this.TopBar.jRoot); this.LeftNav = new LeftNav(); jF2(".TD_LeftNav").append(this.LeftNav.jRoot); this.TableGridMain = new TableGridMain(); this.HomePageMainUI = new PageParts.HomePage.HomePageMainUI(); this.MyAccountMainUI = new PageParts.MyAccount.MyAccountMainUI(); this.ConnectionsMainUI = new PageParts.Connections.ConnectionsMainUI(); this.ConnectionPropertiesMainUI = new PageParts.ConnectionProperties.ConnectionPropertiesMainUI(); this.ManageAssetsMainUI = new PageParts.ManageAssets.ManageAssetsMainUI(); this.TableDesignMainUI = new PageParts.TableDesign.TableDesignMainUI(); this.TablePermissionsMainUI = new PageParts.TablePermissions.TablePermissionsMainUI(); this.UsersMainUI = new PageParts.Users.UsersMainUI(); this.SubscriptionMainUI = new PageParts.Subscription.SubscriptionMainUI(); this.OtherSettingsMainUI = new PageParts.OtherSettings.OtherSettingsMainUI(); this.SendFeedbackMainUI = new PageParts.SendFeedback.SendFeedbackMainUI(); this.AboutMainUI = new PageParts.About.AboutMainUI(); this.RecordMainUI = new PageParts.Record.RecordMainUI(); this.PageId = this.PageId; // triggers this.TableGridMain to get set & instantiated }
public override string ToString() { return(string.Format(CultureInfo.CurrentCulture, "RTStrokeAdd [ DocumentIdentifier: {0}, PageIdentifier: {1}, StrokeIdentifier: {2}, StrokeFinished: {3}, InkData Size: {4} ]", DocumentIdentifier.ToString(), PageIdentifier.ToString(), StrokeIdentifier.ToString(), StrokeFinished.ToString(), InkData.Length)); }
[HttpGet] // GET api/users public async Task <IActionResult> Get([FromQuery] PageIdentifier pagination) { try { pagination.PageNumber = (pagination.PageNumber < 1) ? 1 : pagination.PageNumber; pagination.PageSize = (pagination.PageSize < 1) ? 9999 : pagination.PageSize; var kresApi = await _service.Users.GetAllAsync(pagination); if (kresApi.IsValid) { return(Ok(kresApi)); } else { return(BadRequest(kresApi)); } } catch (Exception ex) { var kresApi = new Result <List <UserDto> >(); kresApi.AddErrorMessage("Generic error: " + ex.Message); return(BadRequest(kresApi)); } }
public override string ToString() { return("RTStrokeAdd " + "{ DocumentIdentifier: " + DocumentIdentifier.ToString() + ", PageIdentifier: " + PageIdentifier.ToString() + ", StrokeIdentifier: " + StrokeIdentifier.ToString() + ", StrokeFinished: " + StrokeFinished.ToString() + ", InkData Size: " + InkData.Length + " }"); }
public async Task <Result <List <UserDto> > > GetAllAsync(PageIdentifier pagination = null) { var result = new Result <List <UserDto> >(); try { var db = GetOpenConnection(); IEnumerable <UserDto> entity; var sql = @"SELECT [UserId], [UserName], [EMail], [FullName], [RoleDefinition], [Disabled] FROM [Users] ORDER BY UserName "; if (pagination != null) { if (db.GetType().Name == "SqliteConnection") { sql += " LIMIT @NumRecords OFFSET @Offset ;"; } else { sql += " OFFSET @Offset ROWS FETCH NEXT @NumRecords ROWS ONLY;"; } entity = await db.QueryAsync <UserDto>(sql.ToString(), new { Offset = pagination.Offset, NumRecords = pagination.PageSize }); } else { entity = await db.QueryAsync <UserDto>(sql.ToString(), new { }); } result.Entity = entity.ToList(); result.TotalCount = (await GetCount()).Entity; await CloseIsTempConnection(db); } catch (Exception ex) { AddExecptionsMessagesToErrorsList(ex, result.ErrorList); } return(ResultDomainAction(result)); }
public async Task <Result <List <UserDto> > > GetAllAsync(PageIdentifier pagination = null) { string urlApi; if (pagination == null) { urlApi = @"api/users"; } else { urlApi = $"api/users?pageNumber={pagination.PageNumber}&pageSize={pagination.PageSize}"; } // option 1 return(await _httpClient.GetFromJsonAsync <Result <List <UserDto> > >(urlApi)); // option 2 //var httpRes = await _httpClient.GetAsync(urlApi); //var res = await httpRes.Content.ReadFromJsonAsync<Result<List<UserDto>>>(); //return res; }
public void NavigateToPage(PageIdentifier pageId, bool keepMenuOpen = false) { if (!_pages.ContainsKey(pageId)) { switch (pageId) { case PageIdentifier.NewTracker: _pages.Add(pageId, new NavigationPage(new NewTrackerPage())); break; case PageIdentifier.About: _pages.Add(pageId, new NavigationPage(new AboutPage())); break; case PageIdentifier.Settings: _pages.Add(pageId, new NavigationPage(new SettingsPage())); break; } } var newPage = _pages[pageId]; if (newPage != null && newPage != Detail) { Detail = newPage; if (Detail.Navigation.ModalStack.Any()) { Device.BeginInvokeOnMainThread(() => Detail.Navigation.PopModalAsync()); } if (Detail.Navigation.NavigationStack.Any()) { Device.BeginInvokeOnMainThread(() => Detail.Navigation.PopToRootAsync()); } } IsPresented = keepMenuOpen; }
public async Task <Result <List <UserDto> > > GetAllAsync(PageIdentifier pagination = null) { var resService = new Result <List <UserDto> >(); try { var ctx = GetOpenConnection(); var users = new GenericRepositoryEF <KntDbContext, User>(ctx); if (pagination != null) { var query = users.Queryable .OrderBy(u => u.UserName) .Pagination(pagination); resService.Entity = await query .Select(u => u.GetSimpleDto <UserDto>()) .ToListAsync(); } else { var query = users.Queryable .OrderBy(u => u.UserName); resService.Entity = await query .Select(u => u.GetSimpleDto <UserDto>()) .ToListAsync(); } resService.TotalCount = (await GetCount()).Entity; await CloseIsTempConnection(ctx); } catch (Exception ex) { AddExecptionsMessagesToErrorsList(ex, resService.ErrorList); } return(ResultDomainAction(resService)); }
private void NavigateToPage(PageIdentifier pageId) => App.Conductor.NavigateToPage(pageId);
public async Task <Result <List <UserDto> > > GetAllAsync(PageIdentifier pagination = null) { return(await _repository.Users.GetAllAsync(pagination)); }