示例#1
0
        public MasterPageTemplate GetByID(int _masterPageTemplateId)
        {
            MasterPageTemplateDAC _masterPageTemplateComponent = new MasterPageTemplateDAC();
            IDataReader           reader = _masterPageTemplateComponent.GetByIDMasterPageTemplate(_masterPageTemplateId);
            MasterPageTemplate    _masterPageTemplate = null;

            while (reader.Read())
            {
                _masterPageTemplate = new MasterPageTemplate();
                if (reader["MasterPageTemplateId"] != DBNull.Value)
                {
                    _masterPageTemplate.MasterPageTemplateId = Convert.ToInt32(reader["MasterPageTemplateId"]);
                }
                if (reader["Name"] != DBNull.Value)
                {
                    _masterPageTemplate.Name = Convert.ToString(reader["Name"]);
                }
                if (reader["Path"] != DBNull.Value)
                {
                    _masterPageTemplate.Path = Convert.ToString(reader["Path"]);
                }
                if (reader["ClassName"] != DBNull.Value)
                {
                    _masterPageTemplate.ClassName = Convert.ToString(reader["ClassName"]);
                }
                if (reader["MasterPageContent"] != DBNull.Value)
                {
                    _masterPageTemplate.MasterPageContent = Convert.ToString(reader["MasterPageContent"]);
                }
                _masterPageTemplate.NewRecord = false;
            }
            reader.Close();
            return(_masterPageTemplate);
        }
示例#2
0
        public bool Insert(MasterPageTemplate masterpagetemplate)
        {
            int autonumber = 0;
            MasterPageTemplateDAC masterpagetemplateComponent = new MasterPageTemplateDAC();
            bool endedSuccessfuly = masterpagetemplateComponent.InsertNewMasterPageTemplate(ref autonumber, masterpagetemplate.Name, masterpagetemplate.Path, masterpagetemplate.ClassName, masterpagetemplate.MasterPageContent);

            if (endedSuccessfuly)
            {
                masterpagetemplate.MasterPageTemplateId = autonumber;
            }
            return(endedSuccessfuly);
        }
示例#3
0
        internal void ExecuteMasterPage(object invoker, string virtualPath, MasterPageTemplate template, NameObjectCollection parameters, HtmlTextWriter writer)
        {
            if (virtualPath == null)
            {
                HttpContext.Current.Response.Write(Resources.PageBase_IncludeSrcIsRequired);
                return;
            }

            virtualPath = MakeAbsolutePath(virtualPath);
            virtualPath = UrlUtil.ConvertDots(virtualPath);

            string path = TemplateManager.ParseTemplate(virtualPath);

            if (virtualPath.EndsWith(".aspx", StringComparison.OrdinalIgnoreCase))
            {
                PageBase page = BuildManager.CreateInstanceFromVirtualPath(path, typeof(PageBase)) as PageBase;

                if (page != null)
                {
                    page.HtmlTextWriter     = writer;
                    page.Parameters         = parameters;
                    page.MasterPageInvoker  = invoker;
                    page.MasterPageTemplate = template;

                    page.ProcessRequest(HttpContext.Current);
                }
            }
            else if (virtualPath.EndsWith(".ascx", StringComparison.OrdinalIgnoreCase))
            {
                PagePartBase part = m_LoadControlCallback(path) as PagePartBase;

                if (part != null)
                {
                    part.HtmlTextWriter     = writer;
                    part.Parameters         = parameters;
                    part.MasterPageInvoker  = invoker;
                    part.MasterPageTemplate = template;

                    part.RenderControl(new HtmlTextWriter(new HttpResponseWriter(HttpContext.Current.Response)));
                }
            }
        }
示例#4
0
        public List <MasterPageTemplate> GetAll()
        {
            MasterPageTemplateDAC     _masterPageTemplateComponent = new MasterPageTemplateDAC();
            IDataReader               reader = _masterPageTemplateComponent.GetAllMasterPageTemplate().CreateDataReader();
            List <MasterPageTemplate> _masterPageTemplateList = new List <MasterPageTemplate>();

            while (reader.Read())
            {
                if (_masterPageTemplateList == null)
                {
                    _masterPageTemplateList = new List <MasterPageTemplate>();
                }
                MasterPageTemplate _masterPageTemplate = new MasterPageTemplate();
                if (reader["MasterPageTemplateId"] != DBNull.Value)
                {
                    _masterPageTemplate.MasterPageTemplateId = Convert.ToInt32(reader["MasterPageTemplateId"]);
                }
                if (reader["Name"] != DBNull.Value)
                {
                    _masterPageTemplate.Name = Convert.ToString(reader["Name"]);
                }
                if (reader["Path"] != DBNull.Value)
                {
                    _masterPageTemplate.Path = Convert.ToString(reader["Path"]);
                }
                if (reader["ClassName"] != DBNull.Value)
                {
                    _masterPageTemplate.ClassName = Convert.ToString(reader["ClassName"]);
                }
                if (reader["MasterPageContent"] != DBNull.Value)
                {
                    _masterPageTemplate.MasterPageContent = Convert.ToString(reader["MasterPageContent"]);
                }
                _masterPageTemplate.NewRecord = false;
                _masterPageTemplateList.Add(_masterPageTemplate);
            }
            reader.Close();
            return(_masterPageTemplateList);
        }
示例#5
0
 public void DialogMaster(string title, bool showTitle, int width, MasterPageTemplate template)
 {
     base.ExecuteMasterPage(IsDialog ? dialogMasterPath : dialogMasterPagePath, template, new NameObjectCollection(new object[] { "title", title, "showTitle", showTitle, "width", width }));
 }
示例#6
0
 public void DialogMaster(int width, MasterPageTemplate template)
 {
     base.ExecuteMasterPage(IsDialog ? dialogMasterPath : dialogMasterPagePath, template, new NameObjectCollection(new object[] { "width", width }));
 }
示例#7
0
 public void DialogMaster(string title, MasterPageTemplate template)
 {
     base.ExecuteMasterPage(IsDialog ? dialogMasterPath : dialogMasterPagePath, template, new NameObjectCollection(new object[] { "title", title }));
 }
示例#8
0
 public void DialogMaster(MasterPageTemplate template)
 {
     base.ExecuteMasterPage(IsDialog ? dialogMasterPath : dialogMasterPagePath, template, null);
 }
示例#9
0
        public bool Update(MasterPageTemplate masterpagetemplate, int old_masterPageTemplateId)
        {
            MasterPageTemplateDAC masterpagetemplateComponent = new MasterPageTemplateDAC();

            return(masterpagetemplateComponent.UpdateMasterPageTemplate(masterpagetemplate.Name, masterpagetemplate.Path, masterpagetemplate.ClassName, masterpagetemplate.MasterPageContent, old_masterPageTemplateId));
        }
示例#10
0
 protected void ExecuteMasterPage(string src, MasterPageTemplate template, NameObjectCollection parameters)
 {
     PartExecutor.ExecuteMasterPage(this, src, template, parameters, this.HtmlTextWriter);
 }
示例#11
0
 public void MasterPage(string src, MasterPageTemplate template)
 {
     PartExecutor.ExecuteMasterPage(this, src, template, null, this.HtmlTextWriter);
 }
示例#12
0
 public void DialogMaster(string title, bool showTitle, int width, MasterPageTemplate template)
 {
     base.ExecuteMasterPage(IsDialog ? dialogMasterPath : dialogMasterPagePath, template, new NameObjectCollection(new object[] { "title", title, "showTitle", showTitle, "width", width}));
 }
示例#13
0
 public void DialogMaster(int width, MasterPageTemplate template)
 {
     base.ExecuteMasterPage(IsDialog ? dialogMasterPath : dialogMasterPagePath, template, new NameObjectCollection(new object[] { "width", width}));
 }
示例#14
0
 public void DialogMaster(string title, MasterPageTemplate template)
 {
     base.ExecuteMasterPage(IsDialog ? dialogMasterPath : dialogMasterPagePath, template, new NameObjectCollection(new object[] { "title", title }));
 }
示例#15
0
        public void DialogMaster(MasterPageTemplate template)
        {

            base.ExecuteMasterPage(IsDialog ? dialogMasterPath : dialogMasterPagePath, template, null);
        }
示例#16
0
		internal void ExecuteMasterPage(object invoker, string virtualPath, MasterPageTemplate template, NameObjectCollection parameters, HtmlTextWriter writer)
		{
			if (virtualPath == null)
			{
				HttpContext.Current.Response.Write(Resources.PageBase_IncludeSrcIsRequired);
				return;
			}

			virtualPath = MakeAbsolutePath(virtualPath);
            virtualPath = UrlUtil.ConvertDots(virtualPath);

			string path = TemplateManager.ParseTemplate(virtualPath);

			if (virtualPath.EndsWith(".aspx", StringComparison.OrdinalIgnoreCase))
			{
				PageBase page = BuildManager.CreateInstanceFromVirtualPath(path, typeof(PageBase)) as PageBase;

				if (page != null)
				{
					page.HtmlTextWriter = writer;
					page.Parameters = parameters;
					page.MasterPageInvoker = invoker;
					page.MasterPageTemplate = template;

					page.ProcessRequest(HttpContext.Current);
				}
			}
			else if (virtualPath.EndsWith(".ascx", StringComparison.OrdinalIgnoreCase))
			{
				PagePartBase part = m_LoadControlCallback(path) as PagePartBase;

				if (part != null)
				{
					part.HtmlTextWriter = writer;
					part.Parameters = parameters;
					part.MasterPageInvoker = invoker;
					part.MasterPageTemplate = template;

					part.RenderControl(new HtmlTextWriter(new HttpResponseWriter(HttpContext.Current.Response)));
				}
			}
		}