温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:破竹CMS4.0免安装版源码
1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
using Pozhu.CMS.PropertyDefinitions; 12
using Pozhu.CMS.Web; 13
14
public partial class admin_PropertyDefinition_EditPropertyControl : AdminPageBase 15
{ 16
protected void Page_Load(object sender, EventArgs e) 17
{ 18
if (!Page.IsPostBack) 19
{ 20
if (Request.QueryString["action"].ToLower() == "edit") 21
{ 22
int propertyControlyID = int.Parse(Request.QueryString["PropertyControlyID"]); 23
PropertyControl control = PropertyDefinitionControllerBase.GetPropertyControl(propertyControlyID); 24
tbFriendlyName.Text = control.FriendlyName; 25
tbControlClass.Text = control.ControlClass; 26
tbSettingControlSrc.Text = control.SettingControlSrc; 27
tbApplyType.Text = control.ApplyType.ToString(); 28
tbDescription.Text = control.Description; 29
} 30
} 31
} 32
protected void lbtnSave_Click(object sender, EventArgs e) 33
{ 34
if (Request.QueryString["action"].ToLower() == "edit") 35
{ 36
int propertyControlyID = int.Parse(Request.QueryString["PropertyControlyID"]); 37
PropertyControl control = PropertyDefinitionControllerBase.GetPropertyControl(propertyControlyID); 38
control.FriendlyName = tbFriendlyName.Text; 39
control.ControlClass = tbControlClass.Text; 40
control.SettingControlSrc = tbSettingControlSrc.Text; 41
control.ApplyType = Type.GetType(tbApplyType.Text); 42
control.Description = tbDescription.Text; 43
44
// 45
PropertyDefinitionControllerBase.UpdatePropertyControl(control); 46
} 47
else if(Request.QueryString["action"].ToLower() == "add") 48
{ 49
PropertyControl control = new PropertyControl(); 50
control.FriendlyName = tbFriendlyName.Text; 51
control.ControlClass = tbControlClass.Text; 52
control.SettingControlSrc = tbSettingControlSrc.Text; 53
control.ApplyType = Type.GetType(tbApplyType.Text); 54
control.Description = tbDescription.Text; 55
control.SiteID = CurrentSite.SiteID; 56
57
// 58
PropertyDefinitionControllerBase.AddPropertyControl(control); 59
} 60
Response.Redirect("PropertyControls.aspx"); 61
} 62
protected void lbtnCancel_Click(object sender, EventArgs e) 63
{ 64
Response.Redirect("PropertyControls.aspx"); 65
} 66
} 67





}
}