您目前尚未登陆,请选择【登陆】或【注册
首页->新闻文章->破竹CMS4.0免安装版源码>>admin/PropertyDefinition/EditPropertyDefinitionCategory.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.Categories; 12using Pozhu.Sites; 13using Pozhu.CMS.PropertyDefinitions; 14using Pozhu.CMS.Documents; 15using Pozhu.Common.Utilities; 16using Pozhu.CMS.Web; 17 18public partial class admin_PropertyDefinition_EditPropertyDefinitionCategory : AdminPageBase 19{ 20 protected void Page_Load(object sender, EventArgs e) 21 { 22 if (!Page.IsPostBack) 23 { 24 int siteID = SiteController.GetCurrentSite().SiteID; 25 int categoryID = CategoryController.GetCategory(siteID, Request.QueryString["path"]).CategoryID; 26 27 28 // 29 string action = Request.QueryString["action"]; 30 if (action == "add") 31 { 32 this.lbtnUpdate.Visible = false; 33 } 34 else if (action == "edit") 35 { 36 // 37 string identify = Request.QueryString["Identify"]; 38 PropertyDefinitionControllerBase pdController = null; 39 if (identify.ToLower() == "category") 40 { 41 pdController = new CategoryPropertyDefinitionController(); 42 } 43 else if (identify.ToLower() == "document") 44 { 45 pdController = new DocumentPropertyDefinitionController(); 46 } 47 48 // 49 int propertyCategoryID = int.Parse(Request.QueryString["PropertyCategoryID"]); 50 PropertyCategory pc = pdController.GetPropertyCategory(propertyCategoryID); 51 52 // 53 tbName.Text = pc.Title; 54 tbDescription.Text = pc.Description; 55 56 lbtnAdd.Visible = false; 57 } 58 } 59 60 } 61 protected void lbtnCancel_Click(object sender, EventArgs e) 62 { 63 string identify = Request.QueryString["Identify"]; 64 Response.Redirect("PropertyDefinitions.aspx?tabindex=" + Request.QueryString["tabindex"] + "&path=" + Request.QueryString["path"] + "&identify=" + identify); 65 66 } 67 protected void lbtnAdd_Click(object sender, EventArgs e) 68 { 69 int siteID = SiteController.GetCurrentSite().SiteID; 70 int categoryID = CategoryController.GetCategory(siteID, Request.QueryString["path"]).CategoryID; 71 72 // 73 string redirectUrl = Null.NullString; 74 string identify = Request.QueryString["Identify"]; 75 PropertyDefinitionControllerBase pdController = null; 76 if (identify.ToLower() == "category") 77 { 78 pdController = new CategoryPropertyDefinitionController(); 79 } 80 else if (identify.ToLower() == "document") 81 { 82 pdController = new DocumentPropertyDefinitionController(); 83 } 84 85 // 86 PropertyCategory pc = new PropertyCategory(); 87 pc.Title = tbName.Text; 88 pc.Description = tbDescription.Text; 89 pc.CategoryID = categoryID; 90 91 //添加 92 pdController.AddPropertyCategory(pc); 93 94 // 95 Response.Redirect("PropertyDefinitions.aspx?tabindex=" + Request.QueryString["tabindex"] + "&path=" + Request.QueryString["path"] + "&identify=" + identify); 96 } 97 protected void lbtnUpdate_Click(object sender, EventArgs e) 98 { 99 int siteID = SiteController.GetCurrentSite().SiteID; 100 int categoryID = CategoryController.GetCategory(siteID, Request.QueryString["path"]).CategoryID; 101 102 // 103 string redirectUrl = Null.NullString; 104 string identify = Request.QueryString["Identify"]; 105 PropertyDefinitionControllerBase pdController = null; 106 if (identify.ToLower() == "category") 107 { 108 pdController = new CategoryPropertyDefinitionController(); 109 } 110 else if (identify.ToLower() == "document") 111 { 112 pdController = new DocumentPropertyDefinitionController(); 113 } 114 115 // 116 int propertyCategoryID = int.Parse(Request.QueryString["PropertyCategoryID"]); 117 PropertyCategory pc = pdController.GetPropertyCategory(propertyCategoryID); 118 pc.CategoryID = categoryID; 119 pc.Title = tbName.Text; 120 pc.Description = tbDescription.Text; 121 122 //更新 123 pdController.UpdatePropertyCategory(pc); 124 125 // 126 Response.Redirect("PropertyDefinitions.aspx?tabindex=" + Request.QueryString["tabindex"] + "&path=" + Request.QueryString["path"] + "&identify=" + identify); 127 } 128} 129
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:破竹CMS4.0免安装版源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号