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/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> Article
                            {
                                get
                                {
                                    object id = null;
                                    id = Convert.ToString(Request.QueryString["ID"]);
                                    if (_ArticleID != null && _ArticleID == id)
                                        return _Article;

                                    int instanceID;
instanceID = InstanceID;

                                    using (IlgharCMS.ArticleModule.IArticle bll = (IlgharCMS.ArticleModule.IArticle)Manager.CreateObject("Article", instanceID, ContentLang, true))
                                    {
                                        _ArticleID = id;
                                        _Article = bll.Get(id);
                                    }

                                    return _Article;
                                }
                            }
                            private Dictionary<string, object> _Article;
                            private object _ArticleID;
                            
                            protected System.Collections.Generic.Dictionary<System.String,System.String> Config
                            {
                                get
                                {
                                    object id = null;
                                    
                                    if (_ConfigID != null && _ConfigID == id)
                                        return _Config;

                                    int instanceID;
instanceID = InstanceID;

                                    using (IlgharCMS.ArticleModule.IInstanceConfig bll = (IlgharCMS.ArticleModule.IInstanceConfig)Manager.CreateObject("InstanceConfig", instanceID, ContentLang, false))
                                    {
                                        _ConfigID = id;
                                        _Config = bll.GetBasicSettings();
                                    }

                                    return _Config;
                                }
                            }
                            private System.Collections.Generic.Dictionary<System.String,System.String> _Config;
                            private object _ConfigID;
                            
                        protected int t2453IDRecordCount
                        {
                            get
                            {
                                int instanceID;
instanceID = InstanceID;
                                using (IlgharCMS.ArticleModule.Article.ITag bll = (IlgharCMS.ArticleModule.Article.ITag)Manager.CreateObject("Article.Tag", instanceID, ContentLang, false))
                                {
                                    string condition = null;
condition += "P2194_4_60=";
object v0 = (Article==null?null:Article[IlgharCMS.ArticleModule.Alias.Article.ID]);
                                            if (v0 == null)
                                                condition = condition.Substring(0, condition.Length - 11);
                                            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 t2453IDCounter = 0;
                            protected object t2453IDRecord = null;
                            private DataTable t2453IDData;
                            protected DataTable t2453ID
                            {
                                get
                                {
                                    if (t2453IDData != null)
                                        return t2453IDData;

                                    t2453IDData = t2453ID_;
                                    return t2453IDData;
                                }
                            }
                        
                                private DataTable t2453ID_
                                {
                                    get
                                    {
                                        string condition = null;
condition += "P2194_4_60=";
object v0 = (Article==null?null:Article[IlgharCMS.ArticleModule.Alias.Article.ID]);
                                            if (v0 == null)
                                                condition = condition.Substring(0, condition.Length - 11);
                                            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.ArticleModule.Article.ITag bll = (IlgharCMS.ArticleModule.Article.ITag)Manager.CreateObject("Article.Tag", instanceID, ContentLang, false))
                                        {
                                            t2453IDData = bll.List(-1, -1, condition, sort);
                                        }

                                        return t2453IDData;
                                    }
                                }
                            
                            protected string t2453
                            {
                                get
                                {
                                    XmlNode node = _xmlTemplate.SelectSingleNode("//t2453");
                                    Dictionary<string, object> replacementPair = new Dictionary<string, object>();
                                    replacementPair["{#TagID#}"] = IlgharCMS.ArticleModule.Alias.Article.Tag.TagID;replacementPair["{#TagName#}"] = IlgharCMS.ArticleModule.Alias.Article.Tag.TagName;replacementPair["{#TagPageGenerate#}"] = IlgharCMS.ArticleModule.Alias.Article.Tag.TagPageGenerate;replacementPair["{#TagPageTemplate#}"] = IlgharCMS.ArticleModule.Alias.Article.Tag.TagPageTemplate;replacementPair["{#TagPageID#}"] = IlgharCMS.ArticleModule.Alias.Article.Tag.TagPageID;replacementPair["{#TagPageExtension#}"] = IlgharCMS.ArticleModule.Alias.Article.Tag.TagPageExtension;
                                    StringBuilder all = Manager.Build(node, t2453ID_, replacementPair, ref t2453IDRecord, ref t2453IDCounter);
                                    
                                    
                                    
                                    return all.ToString();
                                }
                            }
                          
                        protected int t4293IDRecordCount
                        {
                            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 t4293IDCounter = 0;
                            protected object t4293IDRecord = null;
                        
                            private DataTable t4293ID;
                            private DataTable t4293ID_
                            {
                                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))
                                    {
                                        t4293ID = bll.List(-1, -1, condition, sort);
                                    }

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

                                                                            return t4781;
                                                                        }
                                                                        );
                                                replacementPair["{#Control#}"] = null;replacementPair["{#ChildRecords#}"] = null;replacementPair["{#ID#}"] = IlgharCMS.ArticleModule.Alias.ArticleCategory.ID;replacementPair["{#Name#}"] = IlgharCMS.ArticleModule.Alias.ArticleCategory.Name;replacementPair["{#PageGenerate#}"] = IlgharCMS.ArticleModule.Alias.ArticleCategory.PageGenerate;replacementPair["{#PageTemplate#}"] = IlgharCMS.ArticleModule.Alias.ArticleCategory.PageTemplate;replacementPair["{#PageID#}"] = IlgharCMS.ArticleModule.Alias.ArticleCategory.PageID;replacementPair["{#PageExtension#}"] = IlgharCMS.ArticleModule.Alias.ArticleCategory.PageExtension;
                                    StringBuilder all = Manager.BuildTree(node, t4293ID_, replacementPair, IlgharCMS.ArticleModule.Alias.ArticleCategory.ParentID, IlgharCMS.ArticleModule.Alias.ArticleCategory.ID, ref t4293IDRecord, ref t4293IDCounter);
                                    
                                    
                                    
                                    return all.ToString();
                                }
                            }
                          
                        protected int t8159IDRecordCount
                        {
                            get
                            {
                                int instanceID;
instanceID = (int)SystemChannel[IlgharCMS.SystemModule.Alias.Instance.InnerID];
                                using (IlgharCMS.SystemModule.IPlayer bll = (IlgharCMS.SystemModule.IPlayer)Manager.CreateObject("Player", instanceID, ContentLang, false))
                                {
                                    string condition = null;


                                    return bll.GetRecordCount(condition);
                                }
                            }
                        }
                        
                            protected int t8159IDCounter = 0;
                            protected object t8159IDRecord = null;
                            private DataTable t8159IDData;
                            protected DataTable t8159ID
                            {
                                get
                                {
                                    if (t8159IDData != null)
                                        return t8159IDData;

                                    t8159IDData = t8159ID_;
                                    return t8159IDData;
                                }
                            }
                        
                                private DataTable t8159ID_
                                {
                                    get
                                    {
                                        string condition = null;


                                        string sort = null;

                                        int instanceID;
instanceID = (int)SystemChannel[IlgharCMS.SystemModule.Alias.Instance.InnerID];

                                        using (IlgharCMS.SystemModule.IPlayer bll = (IlgharCMS.SystemModule.IPlayer)Manager.CreateObject("Player", instanceID, ContentLang, false))
                                        {
                                            t8159IDData = bll.List(-1, -1, condition, sort);
                                        }

                                        return t8159IDData;
                                    }
                                }
                            
                            protected string t8159
                            {
                                get
                                {
                                    XmlNode node = _xmlTemplate.SelectSingleNode("//t8159");
                                    Dictionary<string, object> replacementPair = new Dictionary<string, object>();
                                    replacementPair["{#ID#}"] = IlgharCMS.SystemModule.Alias.Player.ID;replacementPair["{#Name#}"] = IlgharCMS.SystemModule.Alias.Player.Name;
                                    StringBuilder all = Manager.Build(node, t8159ID_, replacementPair, ref t8159IDRecord, ref t8159IDCounter);
                                    
                                    
                                    
                                    return all.ToString();
                                }
                            }
                          }
