private void ProcUploadDeptArticle(string companyCode, XmlNode reqNode, XmlDocument respXmlDoc, XmlNode respNode) { List <string> codes = null; List <DeptArticle> items = null; string msg = null; bool ok = true; try { string str = null; XmlNode codesNode = reqNode.SelectSingleNode("删除"); if (codesNode != null) { codes = new List <string>(); foreach (XmlNode codeNode in codesNode.ChildNodes) { if (XmlUtils.GetAttributeValue(codeNode, "代码", out str)) { codes.Add(str); } } } XmlNode itemsNode = reqNode.SelectSingleNode("变更"); if (itemsNode != null) { items = new List <DeptArticle>(); foreach (XmlNode itemNode in itemsNode.ChildNodes) { DeptArticle item = new DeptArticle(); items.Add(item); item.DeptCode = str; XmlUtils.GetAttributeValue(itemNode, "部门代码", out item.DeptCode); XmlUtils.GetAttributeValue(itemNode, "商品代码", out item.ArticleCode); } } } catch (Exception e) { ok = false; msg = e.Message; } if (ok) { ok = UploadInfoProc.SaveDeptArticle(out msg, companyCode, codes, items); } if (!ok) { XmlNode errorNode = respNode.SelectSingleNode("错误列表"); if (errorNode == null) { errorNode = XmlUtils.AppendChildNode(respXmlDoc, respNode, "错误列表"); } XmlNode node = XmlUtils.AppendChildNode(respXmlDoc, XmlUtils.AppendChildNode(respXmlDoc, errorNode, "部门商品列表"), "内容"); XmlUtils.SetAttributeValue(respXmlDoc, node, "信息", msg); } }
private void ProcUploadPromotion(string companyCode, XmlNode reqNode, XmlDocument respXmlDoc, XmlNode respNode) { List <string> codes = null; List <Promotion> items = null; string msg = null; bool ok = true; try { string str = null; XmlNode codesNode = reqNode.SelectSingleNode("删除"); if (codesNode != null) { codes = new List <string>(); foreach (XmlNode codeNode in codesNode.ChildNodes) { if (XmlUtils.GetAttributeValue(codeNode, "代码", out str)) { codes.Add(str); } } } //--XmlNode itemsNode = reqNode.SelectSingleNode; //-- if (itemsNode != null) //-- { items = new List <Promotion>(); foreach (XmlNode itemNode in reqNode.ChildNodes) { if (XmlUtils.GetAttributeValue(itemNode, "编号", out str)) { Promotion item = new Promotion(); items.Add(item); item.Id = int.Parse(str); if (XmlUtils.GetChildTextNodeValue(itemNode, "主题", out str)) { item.Subject = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "内容", out str)) { item.Content = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "年度", out str)) { item.Year = int.Parse(str); } if (XmlUtils.GetChildTextNodeValue(itemNode, "期数", out str)) { item.PeriodNum = int.Parse(str); } if (XmlUtils.GetChildTextNodeValue(itemNode, "开始时间", out str)) { item.BeginTime = FormatUtils.ParseDatetimeString(str); } if (XmlUtils.GetChildTextNodeValue(itemNode, "结束时间", out str)) { item.EndTime = FormatUtils.ParseDatetimeString(str); } } } //-- } } catch (Exception e) { ok = false; msg = e.Message; } if (ok) { ok = UploadInfoProc.SavePromotion(out msg, companyCode, codes, items); } if (!ok) { XmlNode errorNode = respNode.SelectSingleNode("错误列表"); if (errorNode == null) { errorNode = XmlUtils.AppendChildNode(respXmlDoc, respNode, "错误列表"); } XmlNode node = XmlUtils.AppendChildNode(respXmlDoc, XmlUtils.AppendChildNode(respXmlDoc, errorNode, "促销活动列表"), "内容"); XmlUtils.SetAttributeValue(respXmlDoc, node, "信息", msg); } }
private void ProcUploadArticle(string companyCode, XmlNode reqNode, XmlDocument respXmlDoc, XmlNode respNode) { List <string> codes = null; List <Article> items = null; string msg = null; bool ok = true; try { string str = null; XmlNode codesNode = reqNode.SelectSingleNode("删除"); if (codesNode != null) { codes = new List <string>(); foreach (XmlNode codeNode in codesNode.ChildNodes) { if (XmlUtils.GetAttributeValue(codeNode, "代码", out str)) { codes.Add(str); } } } XmlNode itemsNode = reqNode.SelectSingleNode("变更"); if (itemsNode != null) { items = new List <Article>(); foreach (XmlNode itemNode in itemsNode.ChildNodes) { if (XmlUtils.GetAttributeValue(itemNode, "代码", out str)) { Article item = new Article(); items.Add(item); item.Code = str; if (XmlUtils.GetChildTextNodeValue(itemNode, "代码", out str)) { item.NewCode = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "名称", out str)) { item.Name = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "简称", out str)) { item.ShortName = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "拼音", out str)) { item.Spell = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "单位", out str)) { item.Unit = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "花色", out str)) { item.Color = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "规格", out str)) { item.Spec = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "货号", out str)) { item.ModelCode = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "品类", out str)) { item.CategoryCode = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "品牌", out str)) { item.BrandCode = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "合同", out str)) { item.ContractCode = str; } } } } } catch (Exception e) { ok = false; msg = e.Message; } if (ok) { ok = UploadInfoProc.SaveArticle(out msg, companyCode, codes, items); } if (!ok) { XmlNode errorNode = respNode.SelectSingleNode("错误列表"); if (errorNode == null) { errorNode = XmlUtils.AppendChildNode(respXmlDoc, respNode, "错误列表"); } XmlNode node = XmlUtils.AppendChildNode(respXmlDoc, XmlUtils.AppendChildNode(respXmlDoc, errorNode, "商品列表"), "内容"); XmlUtils.SetAttributeValue(respXmlDoc, node, "信息", msg); } }
private void ProcUploadPayMethod(string companyCode, XmlNode reqNode, XmlDocument respXmlDoc, XmlNode respNode) { List <string> codes = null; List <Payment> items = null; string msg = null; bool ok = true; try { string str = null; XmlNode codesNode = reqNode.SelectSingleNode("删除"); if (codesNode != null) { codes = new List <string>(); foreach (XmlNode codeNode in codesNode.ChildNodes) { if (XmlUtils.GetAttributeValue(codeNode, "代码", out str)) { codes.Add(str); } } } XmlNode itemsNode = reqNode.SelectSingleNode("变更"); if (itemsNode != null) { items = new List <Payment>(); foreach (XmlNode itemNode in itemsNode.ChildNodes) { if (XmlUtils.GetAttributeValue(itemNode, "代码", out str)) { Payment item = new Payment(); items.Add(item); item.Code = str; XmlUtils.GetChildTextNodeValue(itemNode, "代码", out item.NewCode); XmlUtils.GetChildTextNodeValue(itemNode, "名称", out item.Name); if (XmlUtils.GetChildTextNodeValue(itemNode, "末级", out str)) { item.IsLeaf = (str.Equals("Y") || str.Equals("y")); } if (XmlUtils.GetChildTextNodeValue(itemNode, "满减标记", out str)) { item.JoinPromDecMoney = (str.Equals("1") || str.Equals("y") || str.Equals("Y")); } item.CouponType = -1; if (XmlUtils.GetChildTextNodeValue(itemNode, "优惠券", out str)) { if (str.Length > 0) { item.CouponType = int.Parse(str); } } } } } } catch (Exception e) { ok = false; msg = e.Message; } if (ok) { ok = UploadInfoProc.SavePayMethod(out msg, companyCode, codes, items); } if (!ok) { XmlNode errorNode = respNode.SelectSingleNode("错误列表"); if (errorNode == null) { errorNode = XmlUtils.AppendChildNode(respXmlDoc, respNode, "错误列表"); } XmlNode node = XmlUtils.AppendChildNode(respXmlDoc, XmlUtils.AppendChildNode(respXmlDoc, errorNode, "支付方式列表"), "内容"); XmlUtils.SetAttributeValue(respXmlDoc, node, "信息", msg); } }
private void ProcUploadContract(string companyCode, XmlNode reqNode, XmlDocument respXmlDoc, XmlNode respNode) { List <string> codes = null; List <Contract> items = null; string msg = null; bool ok = true; try { string str = null; XmlNode codesNode = reqNode.SelectSingleNode("删除"); if (codesNode != null) { codes = new List <string>(); foreach (XmlNode codeNode in codesNode.ChildNodes) { if (XmlUtils.GetAttributeValue(codeNode, "代码", out str)) { codes.Add(str); } } } XmlNode itemsNode = reqNode.SelectSingleNode("变更"); if (itemsNode != null) { items = new List <Contract>(); foreach (XmlNode itemNode in itemsNode.ChildNodes) { if (XmlUtils.GetAttributeValue(itemNode, "代码", out str)) { Contract item = new Contract(); items.Add(item); item.Code = str; if (XmlUtils.GetChildTextNodeValue(itemNode, "代码", out str)) { item.NewCode = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "厂商名称", out str)) { item.SuppName = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "厂商代码", out str)) { item.SuppCode = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "部门代码", out str)) { item.DeptCode = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "有效", out str)) { item.IsValid = (str.Equals("Y") || str.Equals("y")); } } } } } catch (Exception e) { ok = false; msg = e.Message; } if (ok) { ok = UploadInfoProc.SaveContract(out msg, companyCode, codes, items); } if (!ok) { XmlNode errorNode = respNode.SelectSingleNode("错误列表"); if (errorNode == null) { errorNode = XmlUtils.AppendChildNode(respXmlDoc, respNode, "错误列表"); } XmlNode node = XmlUtils.AppendChildNode(respXmlDoc, XmlUtils.AppendChildNode(respXmlDoc, errorNode, "合同列表"), "内容"); XmlUtils.SetAttributeValue(respXmlDoc, node, "信息", msg); } }
private void ProcUploadArticleCategory(string companyCode, XmlNode reqNode, XmlDocument respXmlDoc, XmlNode respNode) { List <string> codes = null; List <ArticleCategory> items = null; string msg = null; bool ok = true; try { string str = null; XmlNode codesNode = reqNode.SelectSingleNode("删除"); if (codesNode != null) { codes = new List <string>(); foreach (XmlNode codeNode in codesNode.ChildNodes) { if (XmlUtils.GetAttributeValue(codeNode, "代码", out str)) { codes.Add(str); } } } XmlNode itemsNode = reqNode.SelectSingleNode("变更"); if (itemsNode != null) { items = new List <ArticleCategory>(); foreach (XmlNode itemNode in itemsNode.ChildNodes) { if (XmlUtils.GetAttributeValue(itemNode, "代码", out str)) { ArticleCategory item = new ArticleCategory(); items.Add(item); item.Code = str; if (XmlUtils.GetChildTextNodeValue(itemNode, "代码", out str)) { item.NewCode = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "名称", out str)) { item.Name = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "拼音", out str)) { item.Spell = str; } if (XmlUtils.GetChildTextNodeValue(itemNode, "末级", out str)) { item.IsLeaf = (str.Equals("Y") || str.Equals("y")); } } } } } catch (Exception e) { ok = false; msg = e.Message; } if (ok) { ok = UploadInfoProc.SaveArticleCategory(out msg, companyCode, codes, items); } if (!ok) { XmlNode errorNode = respNode.SelectSingleNode("错误列表"); if (errorNode == null) { errorNode = XmlUtils.AppendChildNode(respXmlDoc, respNode, "错误列表"); } XmlNode node = XmlUtils.AppendChildNode(respXmlDoc, XmlUtils.AppendChildNode(respXmlDoc, errorNode, "分类列表"), "内容"); XmlUtils.SetAttributeValue(respXmlDoc, node, "信息", msg); } }