示例#1
0
 public static XElement CreateBallConfigInfo(BallConfigInfo b)
 {
     return new XElement("Item",
        new XAttribute("TemplateID", b.TemplateID),
        new XAttribute("Common", b.Common),
        new XAttribute("CommonAddWound", b.CommonAddWound),
        new XAttribute("CommonMultiBall", b.CommonMultiBall),
        new XAttribute("Special", b.Special),
        new XAttribute("SpecialII", b.SpecialII));
 }
示例#2
0
        public BallConfigInfo[] GetAllBallConfig()
        {
            List<BallConfigInfo> infos = new List<BallConfigInfo>();
            SqlDataReader reader = null;
            try
            {
                db.GetReader(ref reader, "[SP_Ball_Config_All]");
                while (reader.Read())
                {
                    BallConfigInfo info = new BallConfigInfo();
                    info.Common = (int)reader["Common"];
                    info.TemplateID = (int)reader["TemplateID"];
                    info.CommonAddWound = (int)reader["CommonAddWound"];
                    info.CommonMultiBall = (int)reader["CommonMultiBall"];
                    info.Special = (int)reader["Special"];
                    info.SpecialII = (int)reader["SpecialII"];

                    infos.Add(info);
                }
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                    log.Error("Init", e);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }
            return infos.ToArray();
        }