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/ajax_list.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 int t337IDRecordCount
                        {
                            get
                            {
                                int instanceID;
instanceID = InstanceID;
                                using (IlgharCMS.SystemModule.IMenu bll = (IlgharCMS.SystemModule.IMenu)Manager.CreateObject("Menu", instanceID, ContentLang, false))
                                {
                                    string condition = null;
condition += "P2131_24_264=";
object v0 = Request.QueryString["CategoryID"];
                                            if (v0 == null)
                                                condition = condition.Substring(0, condition.Length - 13);
                                            else if (v0.ToString() == String.Empty)
                                                condition = condition.Substring(0, condition.Length - 1) + " IS NULL ";
                                            else
                                                condition += v0.ToString();
                                            

                                    return bll.GetRecordCount(condition);
                                }
                            }
                        }
                        
                            protected int t337IDCounter = 0;
                            protected object t337IDRecord = null;
                        
                            private DataTable t337ID;
                            private DataTable t337ID_
                            {
                                get
                                {
                                    string condition = null;
condition += "P2131_24_264=";
object v0 = Request.QueryString["CategoryID"];
                                            if (v0 == null)
                                                condition = condition.Substring(0, condition.Length - 13);
                                            else if (v0.ToString() == String.Empty)
                                                condition = condition.Substring(0, condition.Length - 1) + " IS NULL ";
                                            else
                                                condition += v0.ToString();
                                            

                                    string sort = null;

                                    int instanceID;
instanceID = InstanceID;

                                    using (IlgharCMS.SystemModule.IMenu bll = (IlgharCMS.SystemModule.IMenu)Manager.CreateObject("Menu", instanceID, ContentLang, false))
                                    {
                                        t337ID = bll.List(-1, -1, condition, sort);
                                    }

                                    return t337ID;
                                }
                            }
                        
                            protected string t337
                            {
                                get
                                {
                                    XmlNode node = _xmlTemplate.SelectSingleNode("//t337");
                                    Dictionary<string, object> replacementPair = new Dictionary<string, object>();
                                    
                                        replacementPair["{#t1722#}"] = new CustomBuildTree(
                                                                        delegate(TreeNode record, int index)
                                                                        {string t1722 = String.Empty;
if (Convert.ToBoolean((t337IDRecord as TreeNode).Row[IlgharCMS.SystemModule.Alias.Menu.IsDisplay]))
{t1722 = _xmlTemplate.SelectSingleNode("/" + "/t1722/If").InnerText;}
else
{t1722 = _xmlTemplate.SelectSingleNode("/" + "/t1722/Else").InnerText;}

                                                                            return t1722;
                                                                        }
                                                                        );
                                                replacementPair["{#Control#}"] = null;replacementPair["{#ChildRecords#}"] = null;
                                        replacementPair[@"{#ImagePath#}"] = new CustomBuildTree(
                                                                        delegate(TreeNode record, int index)
                                                                        {
                                                                            object t1525 = ImagePath;
                                                                            if (t1525 != null)
                                                                                return t1525.ToString();
                                                                            else
                                                                                return String.Empty;
                                                                        }
                                                                        );
                                                
                                        replacementPair[@"{#ContentLang#}"] = new CustomBuildTree(
                                                                        delegate(TreeNode record, int index)
                                                                        {
                                                                            object t1674 = ContentLang;
                                                                            if (t1674 != null)
                                                                                return t1674.ToString();
                                                                            else
                                                                                return String.Empty;
                                                                        }
                                                                        );
                                                replacementPair["{#InnerID#}"] = IlgharCMS.SystemModule.Alias.Menu.InnerID;replacementPair["{#ParentInnerID#}"] = IlgharCMS.SystemModule.Alias.Menu.InnerID;replacementPair["{#Name#}"] = IlgharCMS.SystemModule.Alias.Menu.Name;replacementPair["{#CategoryID#}"] = IlgharCMS.SystemModule.Alias.Menu.CategoryID;
                                    StringBuilder all = Manager.BuildTree(node, t337ID_, replacementPair, IlgharCMS.SystemModule.Alias.Menu.ParentID, IlgharCMS.SystemModule.Alias.Menu.ID, ref t337IDRecord, ref t337IDCounter);
                                    
                                    
                                    
                                    return all.ToString();
                                }
                            }
                          }
