Ejemplo n.º 1
0
        public static string Bulid(HttpContext context)
        {
            bool value = false;
            string message = "Fail!";

            XElement result = new XElement("Result");
            try
            {
                using (ProduceBussiness db = new ProduceBussiness())
                {
                    XElement template = new XElement("ItemTemplate");
                    ItemTemplateInfo[] items = db.GetAllGoods();
                    foreach (ItemTemplateInfo g in items)
                    {
                        template.Add(FlashUtils.CreateItemInfo(g));
                    }
                    result.Add(template);                    
                    value = true;
                    message = "Success!";
                }
            }
            catch
            { }

            result.Add(new XAttribute("value", value));
            result.Add(new XAttribute("message", message));

            //csFunction.CreateCompressXml(context, result, "TemplateAlllist1", false);
            return csFunction.CreateCompressXml(context, result, "TemplateAlllist", true);

        }