/// <summary> /// 获得查询结果 /// </summary> /// <param name="selecttrcn"></param> /// <returns></returns> protected override dynamic GetInstanceList(SelectTransaction <T> selecttrcn) { var size = GetPageSize(); //组合查询语句 string where = GetSearchWhere(); InitParams(); if (param.Count > 0) { foreach (var p in param) { if (p.Value.Length > 0) { where += string.Format(" AND {0}='{1}' ", p.Key, p.Value); } else { where += string.Format(" AND {0}", p.Key); } } } List <T> list = selecttrcn.SelectAll(where, size.PageSize * (size.PageIndex - 1), size.PageSize * size.PageIndex + 1);//查询出结果 return(new { Draw = size.Draw, recordsTotal = selecttrcn.SelectRowsCount(), recordsFiltered = selecttrcn.SelectRowsCount(where), List = list }); }
protected virtual dynamic GetInstanceList(SelectTransaction <T> selecttrcn) { var size = GetPageSize(); List <T> list = selecttrcn.SelectAll(size.PageSize * (size.PageIndex - 1), size.PageSize * size.PageIndex + 1);//查询出结果 return(new { List = list, Count = selecttrcn.SelectRowsCount() }); }
protected virtual dynamic GetInstanceList(SelectTransaction <T> selecttrcn) { var size = GetPageSize(); List <T> list = selecttrcn.SelectAll(size.PageSize * (size.PageIndex - 1), size.PageSize * size.PageIndex + 1);//查询出结果 return(new { Draw = size.Draw, recordsTotal = selecttrcn.SelectRowsCount(), recordsFiltered = selecttrcn.SelectRowsCount(), List = list }); }
public void SelectTransactionKey(SelectTransaction e, Action <long> yield) { WithConnection( c => { e.ExecuteReader(c).WithEach( reader => { long id = reader.id; yield(id); } ); } ); }
public void SelectTransactionKey(SelectTransaction e, Action<long> yield) { WithConnection( c => { e.ExecuteReader(c).WithEach( reader => { long id = reader.id; yield(id); } ); } ); }
// Update is called once per frame void Update() { if (AutoUpdateToLatestBlock) { CurrentBlockNumberDisplayed = LastBlockNumber; } if (TxtBlockNumberDisplayText == null) { TxtBlockNumberDisplayText = TxtBlockNumberDisplay.GetComponent <UnityEngine.UI.Text>(); } TxtBlockNumberDisplayText.text = StartBlockNumber + " << " + CurrentBlockNumberDisplayed + " >> " + LastBlockNumber; if (LastBlockNumberDisplayed != CurrentBlockNumberDisplayed) { BlockDetails details; if (LatestBlockDetails.TryGetValue(CurrentBlockNumberDisplayed, out details)) { SetText(BlockInfoText, details.GetDescriptiveText()); //details.GetDesc LastBlockNumberDisplayed = CurrentBlockNumberDisplayed; Transform blockInfoTransform = BlockInfoText.GetComponent <Transform>(); float offsetY = 0; SelectTransaction[] oldSelectComponents = blockInfoTransform.GetComponentsInChildren <SelectTransaction>(); foreach (var oldComponent in oldSelectComponents) { Destroy(oldComponent.gameObject); } blockInfoTransform.DetachChildren(); foreach (var tx in details.TransactionDetails) { GameObject transactionSelector = Instantiate(this.SelectTransactionButtonPrefab, blockInfoTransform); SelectTransaction selectTransactionScript = transactionSelector.GetComponent <SelectTransaction>(); selectTransactionScript.SetTransactionDetails(this, tx); //here Transform transactionSelectorTransform = transactionSelector.GetComponent <Transform>(); transactionSelectorTransform.SetPositionAndRotation(new UnityEngine.Vector3(blockInfoTransform.position.x, blockInfoTransform.position.y + offsetY), UnityEngine.Quaternion.identity); offsetY += 30; } } else { Debug.LogWarning("Could not display Block:" + CurrentBlockNumberDisplayed); } } if (LastBlockNumber > LastBlockNumberProcessed && /*we dont process the block before app start for now.*/ LastBlockNumber > StartBlockNumber) { BlockDetails blockDetails; //need to process this block. if (LatestBlockDetails.TryGetValue(LastBlockNumber, out blockDetails)) { foreach (var tx in blockDetails.TransactionDetails) { foreach (var eventDto in tx.LandEvents) { //Debug.Log("Last Block: " + LastBlockNumber + " Start: " + StartBlockNumber + " LastProcessed: " + LastBlockNumberProcessed); HandleLandEvent(eventDto); } foreach (var eventDto in tx.FishEvents) { HandleFishEvent(eventDto); } foreach (var landOwnerEvent in tx.LandOwner) { HandleLandOwnerEvent(landOwnerEvent); } foreach (var doggerWasBuild in tx.DoggerWasBuild) { HandleDoggerWasBuildEvent(doggerWasBuild); } } } else { Debug.LogError("Could not precess block " + LastBlockNumber.ToString()); } LastBlockNumberProcessed = LastBlockNumber; } //SetText(BlockInfoText, LatestBlockInformation); }