您目前尚未登陆,请选择【登陆】或【注册
首页->新闻文章->破竹CMS4.0免安装版源码>>admin/PropertyDefinition/PropertyControlSetting.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:破竹CMS4.0免安装版源码
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11using Pozhu.CMS.PropertyDefinitions; 12using Pozhu.Sites; 13using Pozhu.CMS.Documents; 14using Pozhu.Common.Utilities; 15using Pozhu.Common; 16using Pozhu.CMS.UI.UserControls.PropertyControls; 17using Pozhu.CMS.Web; 18 19public partial class admin_PropertyDefinition_PropertyControlSetting : AdminPageBase 20{ 21 protected void Page_Load(object sender, EventArgs e) 22 { 23 if (!Page.IsPostBack) 24 { 25 int propertyDefinitionID = int.Parse(Request.QueryString["PropertyDefinitionID"]); 26 ArrayList controls = PropertyDefinitionControllerBase.GetPropertyControls(SiteController.GetCurrentSite().SiteID); 27 DocumentPropertyDefinitionController objController = new DocumentPropertyDefinitionController(); 28 PropertyDefinition property = objController.GetProperty(propertyDefinitionID); 29 foreach (PropertyControl control in controls) 30 { 31 if (control.ApplyType == property.PropertyType) 32 { 33 ddlControls.Items.Add(new ListItem(control.FriendlyName, control.PropertyControlID.ToString())); 34 } 35 } 36 ddlControls.Items.Insert(0, new ListItem("请选择一个控件", "-1")); 37 38 // 39 PropertyControlSetting pcs = PropertyDefinitionControllerBase.GetPropertyControlSettingByPropertyID(propertyDefinitionID); 40 if (pcs != null) 41 { 42 PropertyControl propertyControl = PropertyDefinitionControllerBase.GetPropertyControl(pcs.PropertyControlID); 43 if (propertyControl.ApplyType == property.PropertyType) 44 { 45 phSettingSrc.AddUserControl( propertyControl.SettingControlSrc); 46 ddlControls.SelectedValue = propertyControl.PropertyControlID.ToString(); 47 } 48 } 49 } 50 51 if (ddlControls.SelectedIndex == 0) 52 { 53 lbtnSave.Enabled = false; 54 lbtnDelete.Enabled = false; 55 phSettingSrc.Controls.Clear(); 56 } 57 else 58 { 59 lbtnDelete.Enabled = true; 60 lbtnSave.Enabled = true; 61 } 62 } 63 protected void lbtnCancel_Click(object sender, EventArgs e) 64 { 65 string identify = Request.QueryString["Identify"]; 66 67 Response.Redirect("PropertyDefinitions.aspx?tabindex=" + Request.QueryString["tabindex"] + "&path=" + Request.QueryString["path"] + "&identify=" + identify); 68 69 } 70 protected void lbtnDelete_Click(object sender, EventArgs e) 71 { 72 string identify = Request.QueryString["Identify"]; 73 int propertyDefinitionID = int.Parse(Request.QueryString["PropertyDefinitionID"]); 74 PropertyDefinitionControllerBase.DeletePropertyControlSetting(propertyDefinitionID); 75 76 Response.Redirect("PropertyDefinitions.aspx?tabindex=" + Request.QueryString["tabindex"] + "&path=" + Request.QueryString["path"] + "&identify=" + identify); 77 78 } 79 protected void lbtnSave_Click(object sender, EventArgs e) 80 { 81 string identify = Request.QueryString["Identify"]; 82 int propertyDefinitionID = int.Parse(Request.QueryString["PropertyDefinitionID"]); 83 int propertyControlID = int.Parse(ddlControls.SelectedValue); 84 SettingControlBase settingControl = (SettingControlBase)phSettingSrc.Controls[0]; 85 PropertyDefinitionControllerBase.SavePropertyControlSetting(propertyDefinitionID, propertyControlID, settingControl.GetSettingXmlData()); 86 87 Response.Redirect("PropertyDefinitions.aspx?tabindex=" + Request.QueryString["tabindex"] + "&path=" + Request.QueryString["path"] + "&identify=" + identify); 88 } 89 protected void ddlControls_SelectedIndexChanged(object sender, EventArgs e) 90 { 91 if (ddlControls.SelectedIndex != 0) 92 { 93 int propertyDefinitionID = int.Parse(Request.QueryString["PropertyDefinitionID"]) ; 94 int propertyControlID = int.Parse(ddlControls.SelectedValue); 95 PropertyControl propertyControl = PropertyDefinitionControllerBase.GetPropertyControl(propertyControlID); 96 phSettingSrc.Controls.Clear(); 97 phSettingSrc.AddUserControl(propertyControl.SettingControlSrc); 98 } 99 } 100} 101
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:破竹CMS4.0免安装版源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号