/// <summary>
/// 保存页面
/// </summary>
/// <param name="needTip">是否需要提示</param>
/// <returns>true:成功 false:失败</returns>
public bool Save(bool needTip)
{
try
{
Id = "1";
string conditions = "";
ArticleGroupEntity entity = new ArticleGroupEntity();
if (Id != "")
{
entity.article_group_id += Id;
string packageCondition = txtPackageCondition.Text.Trim(); //
string brandCondition = txtBrandCondition.Text.Trim();
string xmlSegment = "<Conditions></Conditions>"; ///初始化根元素--必须
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlSegment);//加载片段
XmlNode xmldocSelect = xmlDoc.SelectSingleNode("Conditions");
XmlNode package = xmlDoc.CreateElement("PackageCondition"); //创建节点元素
package.InnerText = packageCondition; //给节点元素付值
xmldocSelect.AppendChild(package); //添加节点元素到根元素
XmlElement brand = xmlDoc.CreateElement("BrandCondition");
brand.InnerText = brandCondition;
xmldocSelect.AppendChild(brand);
conditions = xmlDoc.OuterXml; //获取表示此节点及其所有子节点的标记的输出。
}
entity.auto_match.Value= conditions;
_adapter.Save(WebUIMapper2, entity);
string str = _mgrAGM.Save(entity);
if (str.Trim() != "")
{
AjaxAlert(str);
return false;
}
return true;
}
catch (Exception e)
{
Log.Error(17010502, e, this.GetType());
throw e;
}
}