private CatalogDef GetCatalog(XElement ele)
        {
            string text                  = GetStringAttValue(ele, "text");
            string classString           = GetStringAttValue(ele, "class");
            string identify              = GetStringAttValue(ele, "identify");
            string filter                = GetStringAttValue(ele, "filter");
            string pattern               = GetStringAttValue(ele, "pattern");
            string folder                = GetStringAttValue(ele, "folder");
            SubProductCatalogDef catalog = new SubProductCatalogDef(classString, text, identify, filter, pattern, folder);

            if (ele.Element("Attributes") != null)
            {
                var xeles = ele.Element("Attributes").Elements("Attribute");
                if (xeles != null)
                {
                    foreach (XElement e in xeles)
                    {
                        CatalogAttriteDef attDef = GetCatalogAttributeDdef(e);
                        if (attDef != null)
                        {
                            catalog.AttributeDefs.Add(attDef);
                        }
                    }
                }
            }
            return(catalog);
        }
Exemplo n.º 2
0
        private string GetDateFormart(DateTime dt, SubProductCatalogDef catalogDef, string identify)
        {
            string defFormat = "yyyy-MM-dd HH:mm:ss";

            if (catalogDef == null)
            {
                return(dt.ToString(defFormat));
            }
            CatalogAttriteDef cad = catalogDef.GetCatalogAttrDefByIdentify(identify);

            if (cad == null || string.IsNullOrEmpty(cad.Format))
            {
                return(dt.ToString(defFormat));
            }
            return(dt.ToString(cad.Format));
        }