public int GetIdleBoxCount(Box.Size size) { DataTable table = null; LoggingData data = new LoggingData(ip, username, password, database); table = data.GetIdleBoxCount((int)size); if (table == null || table.Rows.Count == 0) { CLog4net.LogError("获取箱子数目失败:" + size); return(0); } int count = 0; count = Convert.ToInt32(table.Rows[0][0]); return(count); }