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

                                    int instanceID;
instanceID = InstanceID;

                                    using (IlgharCMS.ShopModule.IGoodsCategory bll = (IlgharCMS.ShopModule.IGoodsCategory)Manager.CreateObject("GoodsCategory", instanceID, ContentLang, true))
                                    {
                                        _GoodsCategoryID = id;
                                        _GoodsCategory = bll.Get(id);
                                    }

                                    return _GoodsCategory;
                                }
                            }
                            private Dictionary<string, object> _GoodsCategory;
                            private object _GoodsCategoryID;
                            
                        protected int t2746IDRecordCount
                        {
                            get
                            {
                                int instanceID;
instanceID = InstanceID;
                                using (IlgharCMS.ShopModule.IGoodsCategory bll = (IlgharCMS.ShopModule.IGoodsCategory)Manager.CreateObject("GoodsCategory", instanceID, ContentLang, false))
                                {
                                    string condition = null;


                                    return bll.GetRecordCount(condition);
                                }
                            }
                        }
                        
                            protected int t2746IDCounter = 0;
                            protected object t2746IDRecord = null;
                        
                            private DataTable t2746ID;
                            private DataTable t2746ID_
                            {
                                get
                                {
                                    string condition = null;


                                    string sort = null;

                                    int instanceID;
instanceID = InstanceID;

                                    using (IlgharCMS.ShopModule.IGoodsCategory bll = (IlgharCMS.ShopModule.IGoodsCategory)Manager.CreateObject("GoodsCategory", instanceID, ContentLang, false))
                                    {
                                        t2746ID = bll.List(-1, -1, condition, sort);
                                    }

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

                                                                            return t3232;
                                                                        }
                                                                        );
                                                replacementPair["{#Control#}"] = null;replacementPair["{#ChildRecords#}"] = null;replacementPair["{#ID#}"] = IlgharCMS.ShopModule.Alias.GoodsCategory.ID;replacementPair["{#Name#}"] = IlgharCMS.ShopModule.Alias.GoodsCategory.Name;
                                    StringBuilder all = Manager.BuildTree(node, t2746ID_, replacementPair, IlgharCMS.ShopModule.Alias.GoodsCategory.ParentID, IlgharCMS.ShopModule.Alias.GoodsCategory.ID, ref t2746IDRecord, ref t2746IDCounter);
                                    
                                    
                                    
                                    return all.ToString();
                                }
                            }
                          }
