using System;
using System.Data;
using System.Xml;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Web;
using IlgharCMS;
using IlgharCMS.ArticleModule;
public partial class CIlgharCMS : IlgharCMS.Lib.AdminPageBase
{
public CIlgharCMS()
: base("IlgharCMS.ArticleModule/article_category/edit.dwt.aspx")
{}
protected XmlDocument _xmlTemplate;
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
_xmlTemplate = XmlData.GetXmlDocument();
if (!String.IsNullOrEmpty(Request.QueryString["GetPageCount"]))
                            {
                                Response.Write(1);
                                Response.End();
                            }
                        
}

                            protected Dictionary<string, object> ArticleCategory
                            {
                                get
                                {
                                    object id = null;
                                    id = Convert.ToString(Request.QueryString["ID"]);
                                    if (_ArticleCategoryID != null && _ArticleCategoryID == id)
                                        return _ArticleCategory;

                                    int instanceID;
instanceID = InstanceID;

                                    using (IlgharCMS.ArticleModule.IArticleCategory bll = (IlgharCMS.ArticleModule.IArticleCategory)Manager.CreateObject("ArticleCategory", instanceID, ContentLang, true))
                                    {
                                        _ArticleCategoryID = id;
                                        _ArticleCategory = bll.Get(id);
                                    }

                                    return _ArticleCategory;
                                }
                            }
                            private Dictionary<string, object> _ArticleCategory;
                            private object _ArticleCategoryID;
                            
                        protected int t3453IDRecordCount
                        {
                            get
                            {
                                int instanceID;
instanceID = InstanceID;
                                using (IlgharCMS.ArticleModule.IArticleCategory bll = (IlgharCMS.ArticleModule.IArticleCategory)Manager.CreateObject("ArticleCategory", instanceID, ContentLang, false))
                                {
                                    string condition = null;


                                    return bll.GetRecordCount(condition);
                                }
                            }
                        }
                        
                            protected int t3453IDCounter = 0;
                            protected object t3453IDRecord = null;
                        
                            private DataTable t3453ID;
                            private DataTable t3453ID_
                            {
                                get
                                {
                                    string condition = null;


                                    string sort = null;

                                    int instanceID;
instanceID = InstanceID;

                                    using (IlgharCMS.ArticleModule.IArticleCategory bll = (IlgharCMS.ArticleModule.IArticleCategory)Manager.CreateObject("ArticleCategory", instanceID, ContentLang, false))
                                    {
                                        t3453ID = bll.List(-1, -1, condition, sort);
                                    }

                                    return t3453ID;
                                }
                            }
                        
                            protected string t3453
                            {
                                get
                                {
                                    XmlNode node = _xmlTemplate.SelectSingleNode("//t3453");
                                    Dictionary<string, object> replacementPair = new Dictionary<string, object>();
                                    
                                        replacementPair["{#t3941#}"] = new CustomBuildTree(
                                                                        delegate(TreeNode record, int index)
                                                                        {string t3941 = String.Empty;
if (Guid.Equals((t3453IDRecord as TreeNode).Row[IlgharCMS.ArticleModule.Alias.ArticleCategory.ID],(ArticleCategory==null?null:ArticleCategory[IlgharCMS.ArticleModule.Alias.ArticleCategory.ParentID])))
{t3941 = _xmlTemplate.SelectSingleNode("/" + "/t3941/If").InnerText;}
else
{t3941 = _xmlTemplate.SelectSingleNode("/" + "/t3941/Else").InnerText;}

                                                                            return t3941;
                                                                        }
                                                                        );
                                                replacementPair["{#Control#}"] = null;replacementPair["{#ChildRecords#}"] = null;replacementPair["{#ID#}"] = IlgharCMS.ArticleModule.Alias.ArticleCategory.ID;replacementPair["{#Name#}"] = IlgharCMS.ArticleModule.Alias.ArticleCategory.Name;
                                    StringBuilder all = Manager.BuildTree(node, t3453ID_, replacementPair, IlgharCMS.ArticleModule.Alias.ArticleCategory.ParentID, IlgharCMS.ArticleModule.Alias.ArticleCategory.ID, ref t3453IDRecord, ref t3453IDCounter);
                                    
                                    
                                    
                                    return all.ToString();
                                }
                            }
                          }
