예제 #1
0
 public static bool CheckColor(long l_id, int i_color)
 {
     try
     {
         Hashtable zoneCache = DBCache.GetZoneCache();
         if (zoneCache != null && zoneCache.Count > 0)
         {
             ICollection values = zoneCache.Values;
             foreach (ZoneInfo zoneInfo in values)
             {
                 long   zoneID    = zoneInfo.ZoneID;
                 string zoneColor = zoneInfo.ZoneColor;
                 if (zoneColor.Equals(string.Concat(i_color)))
                 {
                     bool result;
                     if (zoneID == l_id)
                     {
                         result = true;
                         return(result);
                     }
                     result = false;
                     return(result);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         DebugCenter.GetInstance().appendToFile("DBERROR~~~~~~~~~~~DBERROR : " + ex.Message + "\n" + ex.StackTrace);
     }
     return(true);
 }
예제 #2
0
        public static ArrayList getAllZone()
        {
            List <ZoneInfo> list = new List <ZoneInfo>();

            try
            {
                Hashtable zoneCache = DBCache.GetZoneCache();
                if (zoneCache != null && zoneCache.Count > 0)
                {
                    ICollection values = zoneCache.Values;
                    foreach (ZoneInfo item in values)
                    {
                        list.Add(item);
                    }
                }
            }
            catch (Exception ex)
            {
                DebugCenter.GetInstance().appendToFile("DBERROR~~~~~~~~~~~Get all zone error : " + ex.Message + "\n" + ex.StackTrace);
            }
            list.Sort((ZoneInfo x, ZoneInfo y) => x.z_name.CompareTo(y.z_name));
            ArrayList arrayList = new ArrayList();

            foreach (ZoneInfo current in list)
            {
                arrayList.Add(current);
            }
            return(arrayList);
        }
예제 #3
0
        public static ZoneInfo getZoneByID(long l_id)
        {
            ZoneInfo result = null;

            try
            {
                Hashtable zoneCache = DBCache.GetZoneCache();
                if (zoneCache != null && zoneCache.Count > 0 && zoneCache.ContainsKey(l_id))
                {
                    result = (ZoneInfo)zoneCache[l_id];
                }
            }
            catch (Exception ex)
            {
                DebugCenter.GetInstance().appendToFile("DBERROR~~~~~~~~~~~Get all zone error : " + ex.Message + "\n" + ex.StackTrace);
            }
            return(result);
        }