Пример #1
0
 public ConsortiaLevelInfo[] GetAllConsortiaLevel()
 {
     List<ConsortiaLevelInfo> infos = new List<ConsortiaLevelInfo>();
     SqlDataReader reader = null;
     try
     {
         db.GetReader(ref reader, "SP_Consortia_Level_All");
         while (reader.Read())
         {
             ConsortiaLevelInfo info = new ConsortiaLevelInfo();
             info.Count = (int)reader["Count"];
             info.Deduct = (int)reader["Deduct"];
             info.Level = (int)reader["Level"];
             info.NeedGold = (int)reader["NeedGold"];
             info.NeedItem = (int)reader["NeedItem"];
             info.Reward = (int)reader["Reward"];
             info.Riches = (int)reader["Riches"];
             info.ShopRiches = (int)reader["ShopRiches"];
             info.SmithRiches = (int)reader["SmithRiches"];
             info.StoreRiches = (int)reader["StoreRiches"];
             info.BufferRiches = (int)reader["BufferRiches"];
             infos.Add(info);
         }
     }
     catch (Exception e)
     {
         if (log.IsErrorEnabled)
             log.Error("GetAllConsortiaLevel", e);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
     return infos.ToArray();
 }
Пример #2
0
 public static XElement CreateConsortiLevelInfo(ConsortiaLevelInfo info)
 {
     return new XElement("Item", new XAttribute("Level", info.Level),
         new XAttribute("Count", info.Count),
         new XAttribute("Deduct", info.Deduct),
         new XAttribute("NeedGold", info.NeedGold),
         new XAttribute("NeedItem", info.NeedItem),
         new XAttribute("Reward", info.Reward),
         new XAttribute("ShopRiches", info.ShopRiches),
         new XAttribute("SmithRiches", info.SmithRiches),
         new XAttribute("StoreRiches", info.StoreRiches),
         new XAttribute("Riches", info.Riches),
     //BufferRiches="10000"
     new XAttribute("BufferRiches", info.BufferRiches));
 }