Ejemplo n.º 1
0
        public void TemplateChildrenXml(int TemplateTypeCode, XmlNode ParentNode)
        {
            FileTemplateBFL        ebfl       = new FileTemplateBFL();
            FileTemplateQueryModel queryModel = new FileTemplateQueryModel();

            queryModel.FileTemplateTypeCodeEqual = TemplateTypeCode;
            List <FileTemplateModel> fileTemplateList = ebfl.GetFileTemplateList(queryModel);

            if (fileTemplateList.Count > 0)
            {
                foreach (FileTemplateModel model2 in fileTemplateList)
                {
                    XmlElement   newChild = ParentNode.OwnerDocument.CreateElement("node");
                    XmlAttribute node     = ParentNode.OwnerDocument.CreateAttribute("Code");
                    node.Value = model2.Code.ToString();
                    newChild.Attributes.Append(node);
                    XmlAttribute attribute2 = ParentNode.OwnerDocument.CreateAttribute("Text");
                    attribute2.Value = model2.FileTemplateName;
                    newChild.Attributes.Append(attribute2);
                    XmlAttribute attribute3 = ParentNode.OwnerDocument.CreateAttribute("ParentCode");
                    attribute3.Value = TemplateTypeCode.ToString();
                    newChild.Attributes.Append(attribute3);
                    XmlAttribute attribute4 = ParentNode.OwnerDocument.CreateAttribute("Isleaf");
                    attribute4.Value = "false";
                    newChild.Attributes.Append(attribute4);
                    if (!newChild.HasChildNodes)
                    {
                        newChild.Attributes["Isleaf"].Value = "true";
                    }
                    ParentNode.AppendChild(newChild);
                }
            }
        }
Ejemplo n.º 2
0
        public void DeleteNodeAndTemplate(FileTemplateTypeModel objModel)
        {
            FileTemplateBFL        ebfl       = new FileTemplateBFL();
            FileTemplateQueryModel queryModel = new FileTemplateQueryModel();

            queryModel.FileTemplateTypeCodeEqual = objModel.Code;
            List <FileTemplateModel> fileTemplateList = new List <FileTemplateModel>();

            fileTemplateList = ebfl.GetFileTemplateList(queryModel);
            if (fileTemplateList != null)
            {
                foreach (FileTemplateModel model2 in fileTemplateList)
                {
                    this.DeleteVersionByTemplate(model2);
                    ebfl.Delete(model2);
                }
            }
            this.Delete(objModel);
        }