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/instance/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> Instance
                            {
                                get
                                {
                                    object id = null;
                                    id = Convert.ToInt32(Request.QueryString["ID"]);
                                    if (_InstanceID != null && _InstanceID == id)
                                        return _Instance;

                                    int instanceID;
instanceID = InstanceID;

                                    using (IlgharCMS.SystemModule.IInstance bll = (IlgharCMS.SystemModule.IInstance)Manager.CreateObject("Instance", instanceID, ContentLang, true))
                                    {
                                        _InstanceID = id;
                                        _Instance = bll.Get(id);
                                    }

                                    return _Instance;
                                }
                            }
                            private Dictionary<string, object> _Instance;
                            private object _InstanceID;
                            
                        protected int t2279IDRecordCount
                        {
                            get
                            {
                                int instanceID;
instanceID = InstanceID;
                                using (IlgharCMS.SystemModule.IModule bll = (IlgharCMS.SystemModule.IModule)Manager.CreateObject("Module", instanceID, ContentLang, false))
                                {
                                    string condition = null;
condition += "P2131_5_110=";
object v0 = (Instance==null?null:Instance[IlgharCMS.SystemModule.Alias.Instance.ModuleID]);
                                            if (v0 == null)
                                                condition = condition.Substring(0, condition.Length - 12);
                                            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 t2279IDCounter = 0;
                            protected object t2279IDRecord = null;
                            private DataTable t2279IDData;
                            protected DataTable t2279ID
                            {
                                get
                                {
                                    if (t2279IDData != null)
                                        return t2279IDData;

                                    t2279IDData = t2279ID_;
                                    return t2279IDData;
                                }
                            }
                        
                                private DataTable t2279ID_
                                {
                                    get
                                    {
                                        string condition = null;
condition += "P2131_5_110=";
object v0 = (Instance==null?null:Instance[IlgharCMS.SystemModule.Alias.Instance.ModuleID]);
                                            if (v0 == null)
                                                condition = condition.Substring(0, condition.Length - 12);
                                            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.IModule bll = (IlgharCMS.SystemModule.IModule)Manager.CreateObject("Module", instanceID, ContentLang, false))
                                        {
                                            t2279IDData = bll.List(1, 1, condition, sort);
                                        }

                                        return t2279IDData;
                                    }
                                }
                            
                            protected string t2279
                            {
                                get
                                {
                                    XmlNode node = _xmlTemplate.SelectSingleNode("//t2279");
                                    Dictionary<string, object> replacementPair = new Dictionary<string, object>();
                                    replacementPair["{#Name#}"] = IlgharCMS.SystemModule.Alias.Module.Name;
                                    StringBuilder all = Manager.Build(node, t2279ID_, replacementPair, ref t2279IDRecord, ref t2279IDCounter);
                                    
                                    
                                    
                                    return all.ToString();
                                }
                            }
                          }
