public string AirFailureCountTranslator(DataTable dataTable) { FailureCount failure = new FailureCount(); foreach (DataRow dataRow in dataTable.Rows) { failure.failureCount = Convert.ToInt32(dataRow["FailureCount"]); } var json = JsonConvert.SerializeObject(failure); return(json); }
public async Task <FailureCount> FailureCountInfoService(UIRequest uIRequest) { string result = null; string redisKey = "AirFailureCount" + uIRequest.FromDate + uIRequest.ToDate; result = _cache.Get(redisKey); if (result == null) { DataTable dataTable = await _sqlDatabase.AirFailureCountDatabase(uIRequest); result = _airTranslator.AirFailureCountTranslator(dataTable); _cache.Add(redisKey, result); } FailureCount failureCount = JsonConvert.DeserializeObject <FailureCount>(result); return(failureCount); }
public override int GetHashCode() { int hash = 1; if (State != 0) { hash ^= State.GetHashCode(); } if (StateDescription.Length != 0) { hash ^= StateDescription.GetHashCode(); } if (SuccessCount != 0) { hash ^= SuccessCount.GetHashCode(); } if (FailureCount != 0) { hash ^= FailureCount.GetHashCode(); } if (TotalCount != 0) { hash ^= TotalCount.GetHashCode(); } if (createTime_ != null) { hash ^= CreateTime.GetHashCode(); } if (updateTime_ != null) { hash ^= UpdateTime.GetHashCode(); } if (endTime_ != null) { hash ^= EndTime.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }