//读表存数据 void getSevendayData() { List <SXML> xml = XMLMgr.instance.GetSXMLList("seven_days.seven_day"); foreach (SXML x in xml) { int day = x.getInt("day"); sevendayData sdd = new sevendayData(); SXML xml_la = x.GetNode("login_awd"); login_awd la = new login_awd(); la.item_id = xml_la.getInt("awd_item"); la.item_num = xml_la.getInt("awd_num"); la.point = xml_la.getInt("point"); la.tab = xml_la.getInt("tab"); la.des = xml_la.getString("des"); half_buy hb = new half_buy(); SXML xml_hb = x.GetNode("half_buy"); hb.shop_item = xml_hb.getInt("shop_item"); hb.shop_num = xml_hb.getInt("shop_num"); hb.point = xml_hb.getInt("point"); hb.tab = xml_hb.getInt("tab"); hb.des = xml_hb.getString("des"); hb.cost = xml_hb.getInt("cost"); Dictionary <int, award> dic_award = new Dictionary <int, award>(); foreach (SXML y in x.GetNodeList("award")) { award ad = new award(); ad.award_id = y.getInt("award_id"); ad.task_type = y.getInt("type"); ad.task_need = y.getString("param1"); ad.task_point = y.getInt("point"); ad.tab = y.getInt("tab"); ad.task_des = y.getString("des"); dic_award[ad.award_id] = ad; ad.lst_ta = GetTaskAwards(day, ad.award_id); } sdd.loginaed = la; sdd.halfbuy = hb; sdd.task_award = dic_award; dic_data[day] = sdd; } List <SXML> p_xml = XMLMgr.instance.GetSXMLList("seven_days.point_awd"); foreach (SXML z in p_xml) { four_box fb = new four_box(); fb.id = z.getInt("award_id"); fb.param1 = z.getInt("param1"); task_awards ta = new task_awards(); ta.id = z.GetNode("RewardItem").getInt("item_id"); ta.value = z.GetNode("RewardItem").getInt("value"); fb.lst_ta = ta; jifen_box.Add(fb); } }
//对应的奖励 List <task_awards> GetTaskAwards(int day, int award_id) { List <task_awards> lst = new List <task_awards>(); List <SXML> xml = XMLMgr.instance.GetSXML("seven_days.seven_day", "day==" + day).GetNode("award", "award_id==" + award_id).GetNodeList("RewardItem"); foreach (SXML x in xml) { task_awards ta = new task_awards(); ta.id = x.getInt("item_id"); ta.value = x.getInt("value"); lst.Add(ta); } return(lst); }