Esempio n. 1
0
        private static XmlParamter CreateParameter(string name, string value, ParameterDirection direciton)
        {
            XmlParamter p = new XmlParamter();

            p.Name      = name;
            p.Value     = value;
            p.Direction = direciton;
            return(p);
        }
Esempio n. 2
0
 public static String GetString(string key)
 {
     try
     {
         XmlParamter xpKey = new XmlParamter("Key", key);
         xpKey.Direction = System.IO.ParameterDirection.Equal;
         Xml.XmlNode xn = XMLHelper.GetDataOne(path, "KeyValue", xpKey);
         if (xn != null)
         {
             return xn.Attributes["Value"].Value;
         }
     }
     catch { }
     return "";
 }
Esempio n. 3
0
 public static Data.KeyValue GetByKey(string key)
 {
     Data.KeyValue kv = new Data.KeyValue();
     try
     {
         XmlParamter xpKey = new XmlParamter("Key", key);
         xpKey.Direction = System.IO.ParameterDirection.Equal;
         Xml.XmlNode xn = XMLHelper.GetDataOne(path, "KeyValue", xpKey);
         if (xn == null)
         {
             return null;
         }
         else
         {
             kv.Key = xn.Attributes["Key"].Value;
             kv.Value = xn.Attributes["Value"].Value;
             kv.Description = xn.Attributes["Description"].Value;
             kv.UpdateTime = Convert.ToDateTime(xn.Attributes["UpdateTime"].Value);
         }
     }
     catch { }
     return kv;
 }
Esempio n. 4
0
        public static void Edit(string key, string value, string description)
        {
            if (GetByKey(key) != null)
            {
                XmlParamter xpKey = new XmlParamter("Key", key);
                xpKey.Direction = System.IO.ParameterDirection.Equal;
                XmlParamter xpValue = new XmlParamter("Value", value);
                xpValue.Direction = System.IO.ParameterDirection.Update;
                XmlParamter xpDescription = new XmlParamter("Description", description);
                xpDescription.Direction = System.IO.ParameterDirection.Update;
                XmlParamter xpUpdateTime = new XmlParamter("UpdateTime", DateTools.GetNow().ToString("yyyy-MM-dd HH:mm:ss"));
                xpUpdateTime.Direction = System.IO.ParameterDirection.Update;

                XMLHelper.UpdateData(path, "KeyValue", xpKey, xpValue, xpDescription, xpUpdateTime);
            }
        }
Esempio n. 5
0
 private static XmlParamter CreateParameter(string name, string value, ParameterDirection direciton)
 {
     XmlParamter p = new XmlParamter();
     p.Name = name;
     p.Value = value;
     p.Direction = direciton;
     return p;
 }