public int TypeExist(UniversalCollectType type, string name, TerType terType)
 {
     try
     {
         return(dal.TypeExist(type, name, terType));
     }
     catch (Exception ex)
     {
         logger.ErrorException("TypeExist", ex);
         return(-1);
     }
 }
        public int TypeExist(UniversalCollectType type, string name, TerType terType)
        {
            string SQL = "SELECT COUNT(1) FROM UniversalTerWayType WHERE WayType='" + (int)type + "' AND Name='" + name + "' AND TerminalType='" + ((int)terType).ToString() + "'";
            object obj = SQLHelper.ExecuteScalar(SQL, null);

            if (obj != null && obj != DBNull.Value)
            {
                return((Convert.ToInt32(obj) > 0) ? 1 : 0);
            }
            else
            {
                return(0);
            }
        }
Пример #3
0
 public static string GetUniversalCollectTypeName(UniversalCollectType type)
 {
     if (type == UniversalCollectType.Simulate)
     {
         return("模拟");
     }
     else if (type == UniversalCollectType.Pluse)
     {
         return("脉冲");
     }
     else
     {
         return("RS485");
     }
 }