private void ShowInfo(MACInfoDef info) { this.MACleft.Text = info.MACleft; this.MACRangeCode.Text = info.MACRangeCode; this.MACTotal.Text = info.MACTotal; this.MACUsed.Text = info.MACUsed; this.HDCPQuery.Text = info.HDCPQuery; }
public MACInfoDef GetMACInfo(string code) { MACInfoDef item = new MACInfoDef(); string param = Null2String(code); if(param == "") { return item; } try { INumControlRepository itemRepository = RepositoryFactory.GetInstance().GetRepository<INumControlRepository>(); long totalNum = itemRepository.GetMACRangeTotalByCode(param); long usedNum = itemRepository.GetMACRangeTotalUsedByCode(param); long leftNum = totalNum -usedNum; item.MACRangeCode = param; item.MACTotal = totalNum.ToString(); item.MACUsed = usedNum.ToString(); item.MACleft = leftNum.ToString(); DataTable HDCPQueryResult = itemRepository.GetHDCPQuery(); item.HDCPQuery = "0"; if (HDCPQueryResult.Rows.Count > 0) { item.HDCPQuery = HDCPQueryResult.Rows[0][0].ToString(); } } catch (Exception) { throw; } return item; }