Exemple #1
0
 public static XElement CreateActiveInfo(DailyAwardInfo info)
 {
     return new XElement("Item", new XAttribute("ID", info.ID),
         new XAttribute("Count", info.Count),
         new XAttribute("CountRemark", info.CountRemark == null ? "" : info.CountRemark),
         new XAttribute("IsBinds", info.IsBinds),
         new XAttribute("Remark", info.Remark == null ? "" : info.Remark),
         new XAttribute("Sex", info.Sex),
         new XAttribute("TemplateID", info.TemplateID),
         new XAttribute("Type", info.Type),
         new XAttribute("ValidDate", info.ValidDate),
     // GetWay="0"
     new XAttribute("GetWay", info.GetWay),
     //AwardDays="2"
     new XAttribute("AwardDays", info.AwardDays));
 }
 public DailyAwardInfo[] GetAllDailyAward()
 {
     List<DailyAwardInfo> infos = new List<DailyAwardInfo>();
     SqlDataReader reader = null;
     try
     {
         db.GetReader(ref reader, "SP_Daily_Award_All");
         while (reader.Read())
         {
             DailyAwardInfo info = new DailyAwardInfo();
             info.Count = (int)reader["Count"];
             info.ID = (int)reader["ID"];
             info.IsBinds = (bool)reader["IsBinds"];
             info.TemplateID = (int)reader["TemplateID"];
             info.Type = (int)reader["Type"];
             info.ValidDate = (int)reader["ValidDate"];
             info.Sex = (int)reader["Sex"];
             info.Remark = reader["Remark"] == null ? "" : reader["Remark"].ToString();
             info.CountRemark = reader["CountRemark"] == null ? "" : reader["CountRemark"].ToString();
             info.GetWay = (int)reader["GetWay"];
             info.AwardDays = (int)reader["AwardDays"];
             infos.Add(info);
         }
     }
     catch (Exception e)
     {
         if (log.IsErrorEnabled)
             log.Error("GetAllDaily", e);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
     return infos.ToArray();
 }