internal ReturnObj BuildXml(IList<XmlHelper.ParamList> paramLists, string channelId) { ReturnObj obj = new ReturnObj(); obj.State = 1; obj.Msg = "操作成功完成。"; obj.Content = ""; StringBuilder sb = new StringBuilder(); IDao idao=new Dao.Impl.Dao(); IList<PriceLog> list = idao.GetList(channelId); if (list.Count == 0) { obj.State = -1; obj.Msg = "操作成功完成。"; obj.Content = "没有今天的价格记录!"; return obj; } foreach (var p in paramLists) { if (p.Name.Equals("pricelog") && p.Value.Equals("1")) { sb.Append(BuildPriceLogXml(list)); } } obj.Content = sb.ToString(); return obj; }
internal ReturnObj BuildEntity(IList<XmlHelper.ParamList> paramLists, System.Xml.XmlDocument xmlDoc) { ReturnObj returnObj = new ReturnObj(); returnObj.Content = ""; returnObj.Msg = ""; returnObj.State = 0; IList<DataBean> list = new List<DataBean>(); foreach (var p in paramLists) { if (p.Name.Equals("xsjls") && p.Value.Equals("1")) { list = BuildDataBeanEntity(xmlDoc.SelectSingleNode("/cpXML/xsjls")); } } IDao iDao = new Dao.Impl.Dao(); int i = iDao.Save(list); if (i > 0) { returnObj.State = 1; returnObj.Content = "成功提交" + i.ToString() + "条数据!"; returnObj.Msg = "操作成功!"; } else { returnObj.State = -1; returnObj.Msg = "添加失败请再次尝试!"; } return returnObj; }