public BlockListPage() { InitializeComponent(); BindingContext = new BlockListViewModel(); Shell.SetTabBarIsVisible(this, false); }
public ViewResult Index() { BlockListViewModel model = new BlockListViewModel(); model.FolderTree = GetCurrentFolderTree(); model.Instances = Service.GetBlocks(); return(View(model)); }
public List <BlockListViewModel> GetBlocks(int currentPage, int pageSize = AppSettings.PageSize, string chain = null) { var blockQuery = new BlockQueries(_context); var query = blockQuery.QueryBlocks(chain).Skip((currentPage - 1) * pageSize).Take(pageSize); return(query.AsEnumerable() .Select(p => BlockListViewModel.FromBlock(p, blockQuery.QueryBlockTxsCount(p.Hash))) .ToList()); }
/// <summary> /// Get All BlockList /// </summary> /// <param name="blockListViewModel"></param> /// <returns></returns> public BlockListViewModel GetAllBlockList(BlockListViewModel blockListViewModel) { BlockListViewModel blockListModel = new BlockListViewModel(); try { var blockDataList = this.context?.Block.Where(x => x.TenantId == blockListViewModel.TenantId && x.SchoolId == blockListViewModel.SchoolId).OrderBy(x => x.BlockSortOrder).ToList(); if (blockDataList.Count > 0) { foreach (var block in blockDataList) { var blockList = new GetBlockListForView() { TenantId = block.TenantId, SchoolId = block.SchoolId, BlockId = block.BlockId, BlockTitle = block.BlockTitle, BlockSortOrder = block.BlockSortOrder, CreatedBy = block.CreatedBy, CreatedOn = block.CreatedOn, UpdatedBy = block.UpdatedBy, UpdatedOn = block.UpdatedOn }; var blockPeriodDataList = this.context?.BlockPeriod.Where(x => x.TenantId == block.TenantId && x.SchoolId == block.SchoolId && x.BlockId == block.BlockId).OrderBy(x => x.PeriodSortOrder).ToList(); if (blockPeriodDataList.Count > 0) { blockList.BlockPeriod = blockPeriodDataList; } //block.BlockPeriod = block.BlockPeriod.OrderBy(x => x.PeriodSortOrder).ToList(); blockListModel.getBlockListForView.Add(blockList); } blockListModel._failure = false; } else { blockListModel._message = NORECORDFOUND; blockListModel._failure = true; } blockListModel.TenantId = blockListViewModel.TenantId; blockListModel.SchoolId = blockListViewModel.SchoolId; blockListModel._tenantName = blockListViewModel._tenantName; blockListModel._token = blockListViewModel._token; } catch (Exception es) { blockListModel.getBlockListForView = null; blockListModel._message = es.Message; blockListModel._failure = true; blockListModel._tenantName = blockListViewModel._tenantName; blockListModel._token = blockListViewModel._token; } return(blockListModel); }
public ActionResult <BlockListViewModel> GetAllBlockList(BlockListViewModel blockListViewModel) { BlockListViewModel blockList = new BlockListViewModel(); try { blockList = _periodService.GetAllBlockList(blockListViewModel); } catch (Exception es) { blockList._failure = false; blockList._message = es.Message; } return(blockList); }
/// <summary> /// Get All BlockList /// </summary> /// <param name="blockListViewModel"></param> /// <returns></returns> public BlockListViewModel GetAllBlockList(BlockListViewModel blockListViewModel) { BlockListViewModel blockList = new BlockListViewModel(); try { if (TokenManager.CheckToken(blockListViewModel._tenantName + blockListViewModel._userName, blockListViewModel._token)) { blockList = this.periodRepository.GetAllBlockList(blockListViewModel); } else { blockList._failure = true; blockList._message = TOKENINVALID; } } catch (Exception es) { blockList._failure = true; blockList._message = es.Message; } return(blockList); }
public BlockListPage() { InitializeComponent(); BindingContext = new BlockListViewModel(this); }