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_category/add.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 t2890IDRecordCount
                        {
                            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 t2890IDCounter = 0;
                            protected object t2890IDRecord = null;
                        
                            private DataTable t2890ID;
                            private DataTable t2890ID_
                            {
                                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))
                                    {
                                        t2890ID = bll.List(-1, -1, condition, sort);
                                    }

                                    return t2890ID;
                                }
                            }
                        
                            protected string t2890
                            {
                                get
                                {
                                    XmlNode node = _xmlTemplate.SelectSingleNode("//t2890");
                                    Dictionary<string, object> replacementPair = new Dictionary<string, object>();
                                    
                                        replacementPair["{#t3375#}"] = new CustomBuildTree(
                                                                        delegate(TreeNode record, int index)
                                                                        {string t3375 = String.Empty;
if ((Convert.ToString((t2890IDRecord as TreeNode).Row[IlgharCMS.SystemModule.Alias.MenuCategory.ID])==Request.QueryString["ParentID"]))
{t3375 = _xmlTemplate.SelectSingleNode("/" + "/t3375/If").InnerText;}
else
{t3375 = _xmlTemplate.SelectSingleNode("/" + "/t3375/Else").InnerText;}

                                                                            return t3375;
                                                                        }
                                                                        );
                                                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, t2890ID_, replacementPair, IlgharCMS.SystemModule.Alias.MenuCategory.ParentID, IlgharCMS.SystemModule.Alias.MenuCategory.ID, ref t2890IDRecord, ref t2890IDCounter);
                                    
                                    
                                    
                                    return all.ToString();
                                }
                            }
                          }
