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.SystemModule;
public partial class CIlgharCMS : IlgharCMS.Lib.AdminPageBase
{
public CIlgharCMS()
: base("IlgharCMS.SystemModule/menu/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> Menu
                            {
                                get
                                {
                                    object id = null;
                                    id = Convert.ToString(Request.QueryString["ID"]);
                                    if (_MenuID != null && _MenuID == id)
                                        return _Menu;

                                    int instanceID;
instanceID = InstanceID;

                                    using (IlgharCMS.SystemModule.IMenu bll = (IlgharCMS.SystemModule.IMenu)Manager.CreateObject("Menu", instanceID, ContentLang, true))
                                    {
                                        _MenuID = id;
                                        _Menu = bll.Get(id);
                                    }

                                    return _Menu;
                                }
                            }
                            private Dictionary<string, object> _Menu;
                            private object _MenuID;
                            
                        protected int t3613IDRecordCount
                        {
                            get
                            {
                                int instanceID;
instanceID = InstanceID;
                                using (IlgharCMS.SystemModule.IMenuCategory bll = (IlgharCMS.SystemModule.IMenuCategory)Manager.CreateObject("MenuCategory", instanceID, ContentLang, false))
                                {
                                    string condition = null;


                                    return bll.GetRecordCount(condition);
                                }
                            }
                        }
                        
                            protected int t3613IDCounter = 0;
                            protected object t3613IDRecord = null;
                        
                            private DataTable t3613ID;
                            private DataTable t3613ID_
                            {
                                get
                                {
                                    string condition = null;


                                    string sort = null;

                                    int instanceID;
instanceID = InstanceID;

                                    using (IlgharCMS.SystemModule.IMenuCategory bll = (IlgharCMS.SystemModule.IMenuCategory)Manager.CreateObject("MenuCategory", instanceID, ContentLang, false))
                                    {
                                        t3613ID = bll.List(-1, -1, condition, sort);
                                    }

                                    return t3613ID;
                                }
                            }
                        
                            protected string t3613
                            {
                                get
                                {
                                    XmlNode node = _xmlTemplate.SelectSingleNode("//t3613");
                                    Dictionary<string, object> replacementPair = new Dictionary<string, object>();
                                    
                                        replacementPair["{#t4098#}"] = new CustomBuildTree(
                                                                        delegate(TreeNode record, int index)
                                                                        {string t4098 = String.Empty;
if (Guid.Equals((t3613IDRecord as TreeNode).Row[IlgharCMS.SystemModule.Alias.MenuCategory.ID],(Menu==null?null:Menu[IlgharCMS.SystemModule.Alias.Menu.CategoryID])))
{t4098 = _xmlTemplate.SelectSingleNode("/" + "/t4098/If").InnerText;}
else
{t4098 = _xmlTemplate.SelectSingleNode("/" + "/t4098/Else").InnerText;}

                                                                            return t4098;
                                                                        }
                                                                        );
                                                replacementPair["{#Control#}"] = null;replacementPair["{#ChildRecords#}"] = null;replacementPair["{#ID#}"] = IlgharCMS.SystemModule.Alias.MenuCategory.ID;replacementPair["{#Name#}"] = IlgharCMS.SystemModule.Alias.MenuCategory.Name;
                                    StringBuilder all = Manager.BuildTree(node, t3613ID_, replacementPair, IlgharCMS.SystemModule.Alias.MenuCategory.ParentID, IlgharCMS.SystemModule.Alias.MenuCategory.ID, ref t3613IDRecord, ref t3613IDCounter);
                                    
                                    
                                    
                                    return all.ToString();
                                }
                            }
                          
                        protected int t5169IDRecordCount
                        {
                            get
                            {
                                int instanceID;
instanceID = InstanceID;
                                using (IlgharCMS.SystemModule.IChannel bll = (IlgharCMS.SystemModule.IChannel)Manager.CreateObject("Channel", instanceID, ContentLang, false))
                                {
                                    string condition = null;


                                    return bll.GetRecordCount(condition);
                                }
                            }
                        }
                        
                            protected int t5169IDCounter = 0;
                            protected object t5169IDRecord = null;
                        
                            private DataTable t5169ID;
                            private DataTable t5169ID_
                            {
                                get
                                {
                                    string condition = null;


                                    string sort = null;

                                    int instanceID;
instanceID = InstanceID;

                                    using (IlgharCMS.SystemModule.IChannel bll = (IlgharCMS.SystemModule.IChannel)Manager.CreateObject("Channel", instanceID, ContentLang, false))
                                    {
                                        t5169ID = bll.List(-1, -1, condition, sort);
                                    }

                                    return t5169ID;
                                }
                            }
                        
                            protected string t5169
                            {
                                get
                                {
                                    XmlNode node = _xmlTemplate.SelectSingleNode("//t5169");
                                    Dictionary<string, object> replacementPair = new Dictionary<string, object>();
                                    
                                        replacementPair["{#t5661#}"] = new CustomBuildTree(
                                                                        delegate(TreeNode record, int index)
                                                                        {string t5661 = String.Empty;
if (Guid.Equals((t5169IDRecord as TreeNode).Row[IlgharCMS.SystemModule.Alias.Channel.ID],(Menu==null?null:Menu[IlgharCMS.SystemModule.Alias.Menu.ChannelID])))
{t5661 = _xmlTemplate.SelectSingleNode("/" + "/t5661/If").InnerText;}
else
{t5661 = _xmlTemplate.SelectSingleNode("/" + "/t5661/Else").InnerText;}

                                                                            return t5661;
                                                                        }
                                                                        );
                                                replacementPair["{#Control#}"] = null;replacementPair["{#ChildRecords#}"] = null;replacementPair["{#ID#}"] = IlgharCMS.SystemModule.Alias.Channel.ID;replacementPair["{#Name#}"] = IlgharCMS.SystemModule.Alias.Channel.Name;
                                    StringBuilder all = Manager.BuildTree(node, t5169ID_, replacementPair, IlgharCMS.SystemModule.Alias.Channel.ParentID, IlgharCMS.SystemModule.Alias.Channel.ID, ref t5169IDRecord, ref t5169IDCounter);
                                    
                                    
                                    
                                    return all.ToString();
                                }
                            }
                          }
