public int PropertiesCategoriesManage(PropertiesCategorie cp) { string sql = string.Empty; string errText = string.Empty; string s_cont = string.Empty; int rtn = AccessFactory.conn.m_ExecuteScalar(ref errText, "SELECT COUNT(1) FROM PropertiesCategorie WHERE id = " + cp.Id + "", ref s_cont); if (rtn < 0) return rtn; int ncount = objectHandlers.ToInt(s_cont); if (ncount > 0) { sql = "UPDATE PropertiesCategorie SET CategoriePropertiesName='" + cp.CategoriePropertiesName + "',Visible='" + cp.Visible + "',[SkinId]='" + cp.SkinId + "' WHERE id=" + cp.Id; } else { sql = "INSERT INTO PropertiesCategorie(id,CategoriePropertiesName,Visible,[SkinId]) VALUES(" + "" + cp.Id + ",'" + cp.CategoriePropertiesName + "','" + cp.Visible + "','" + cp.SkinId + "')"; } return AccessFactory.conn.m_RunSQL(ref errText, sql); }
public int PropertiesCategoriesManage(Admin admin, PropertiesCategorie cp) { int rtn = HandlersFactory.adminHandlers.CheckAdminPower(admin); if (rtn < 0) return rtn; return DataBaseFactory.propertiesHandlers.PropertiesCategoriesManage(cp); }
protected void Page_Load(object sender, EventArgs e) { //检测管理员登录 base.handlerService.manageService.adminHandlers.CheckAdminLogin(); base.handlerService.manageService.adminHandlers.CheckAdminPop(46); if (!Page.IsPostBack) { this.Init(); } else { PropertiesCategorie pc = new PropertiesCategorie(); pc.Id = objectHandlers.Get("id"); if (objectHandlers.ToInt(pc.Id) == 0) { pc.Id = (base.handlerService.skinService.propertiesHandlers.GetMaxPropertiesCategrie() + 1).ToString(); } pc.CategoriePropertiesName = objectHandlers.Post("iClassName"); pc.Visible = objectHandlers.Post("iVisible"); pc.SkinId = objectHandlers.Post("iSkinId"); ; int rtn = 0; try { rtn = base.handlerService.skinService.propertiesHandlers.PropertiesCategoriesManage(base.adminInfo, pc); if (rtn == 1) { foreach (string key in Request.Form.AllKeys) { if (key.IndexOf("name_") > -1 && !string.IsNullOrEmpty(objectHandlers.Post(key))) { string[] keys = key.Split('_'); Properties cps = new Properties(); cps.Id = objectHandlers.Post("cpid_" + keys[1]); cps.ProertieName = objectHandlers.Post(key); cps.PropertiesCategorieId = pc.Id; cps.Type = objectHandlers.Post("type_" + keys[1]); cps.Values = objectHandlers.Post("pttext_" + keys[1]); cps.width = objectHandlers.ToInt(objectHandlers.Post("pwidth_" + keys[1])); cps.height = objectHandlers.ToInt(objectHandlers.Post("pheight_" + keys[1])); cps.iOrder = objectHandlers.ToInt(objectHandlers.Post("porder_" + keys[1])); rtn = base.handlerService.skinService.propertiesHandlers.PropertiesManage(base.adminInfo, cps); } } CachingService.Remove(CachingService.CACHING_ALL_PROPERTIES + pc.Id); CachingService.Remove(CachingService.CACHING_ALL_PROPERTIES_ENTITY + pc.Id); CachingService.Remove(CachingService.CACHING_ALL_PROPERTIES_CATEGORIES_ENTITY + pc.SkinId); } } catch (Exception ex) { base.ajaxdata = "{state:false,message:\"" + objectHandlers.JSEncode(ex.Message.ToString()) + "\"}"; base.AjaxErch(base.ajaxdata); return; } base.AjaxErch(rtn, "属性分类维护成功!"); } }
/// <summary> /// 从记录行中得到实体 /// </summary> /// <param name="?"></param> /// <param name="type"></param> /// <returns></returns> public static EntityBase GetEntityObjectFromRow(DataRow row, Type type) { if (row == null) return null; switch (type.ToString()) { case "TCG.Entity.Categories": Categories categories = new Categories(); categories.Id = row["Id"].ToString().Trim(); categories.ResourceListTemplate = templateHandlers.GetTemplateByID(row["iListTemplate"].ToString()); categories.iOrder = (int)row["iOrder"]; categories.Parent = row["Parent"].ToString().Trim(); categories.ResourceTemplate = templateHandlers.GetTemplateByID(row["iTemplate"].ToString()); categories.vcClassName = row["vcClassName"].ToString().Trim(); categories.vcDirectory = row["vcDirectory"].ToString().Trim(); categories.vcName = row["vcName"].ToString().Trim(); categories.vcUrl = row["vcUrl"].ToString().Trim(); categories.dUpdateDate = (DateTime)row["dUpdateDate"]; categories.cVisible = row["Visible"].ToString().Trim(); categories.DataBaseService = row["DataBaseService"].ToString().Trim(); categories.SkinInfo = skinHandlers.GetSkinEntityBySkinId(row["SkinId"].ToString().Trim()); categories.IsSinglePage = row["IsSinglePage"].ToString().Trim(); categories.vcPic = row["vcPic"].ToString().Trim(); categories.vcSpeciality = (row["vcSpeciality"] == null) ? "" : row["vcSpeciality"].ToString(); return (EntityBase)categories; case "TCG.Entity.Resources": Resources resources = new Resources(); resources.Id = row["Id"].ToString(); resources.vcTitle = row["vcTitle"].ToString(); resources.Categorie = categoriesHandlers.GetCategoriesById(row["iClassID"].ToString()); resources.vcUrl = (string)row["vcUrl"].ToString(); resources.vcContent = (string)row["vcContent"].ToString().Trim(); resources.vcAuthor = (string)row["vcAuthor"].ToString().Trim(); resources.iCount = (int)row["iCount"]; resources.vcKeyWord = (string)row["vcKeyWord"].ToString().Trim(); resources.vcEditor = (string)row["vcEditor"].ToString().Trim(); resources.cCreated = (string)row["cCreated"].ToString().Trim(); resources.vcSmallImg = (string)row["vcSmallImg"].ToString().Trim(); resources.vcBigImg = (string)row["vcBigImg"].ToString().Trim(); resources.vcShortContent = (string)row["vcShortContent"].ToString().Trim(); resources.vcSpeciality = (string)row["vcSpeciality"].ToString().Trim(); resources.cChecked = (string)row["cChecked"].ToString().Trim(); resources.cDel = (string)row["cDel"].ToString().Trim(); resources.cPostByUser = (string)row["cPostByUser"].ToString().Trim(); resources.vcFilePath = (string)row["vcFilePath"].ToString().Trim(); resources.dAddDate = (DateTime)row["dAddDate"]; resources.dUpDateDate = (DateTime)row["dUpDateDate"]; resources.vcTitleColor = (string)row["vcTitleColor"].ToString().Trim(); resources.cStrong = (string)row["cStrong"].ToString().Trim(); resources.SheifUrl = (string)row["SheifUrl"].ToString().Trim(); resources.PropertiesCategorieId = objectHandlers.ToInt(row["PropertiesCategorieId"]); resources.CCCategories = row["CCCategories"].ToString(); CachingService.Set(resources.Id, resources, null); return (EntityBase)resources; case "TCG.Entity.Template": Template template = new Template(); template.Id = row["Id"].ToString(); template.SkinInfo = skinHandlers.GetSkinEntityBySkinId(row["SkinId"].ToString()); template.TemplateType = templateHandlers.GetTemplateType((int)row["TemplateType"]); template.iParentId = row["iParentId"].ToString(); template.iSystemType = (int)row["iSystemType"]; template.vcTempName = (string)row["vcTempName"]; template.Content = (string)row["vcContent"]; template.vcUrl = (string)row["vcUrl"]; template.dAddDate = (DateTime)row["dAddDate"]; template.dUpdateDate = (DateTime)row["dUpdateDate"]; return (EntityBase)template; case "TCG.Entity.Skin": Skin skin = new Skin(); skin.Id = row["Id"].ToString().Trim(); skin.Name = row["Name"].ToString().Trim(); skin.Pic = row["Pic"].ToString().Trim(); skin.WebDescription = row["WebDescription"].ToString().Trim(); skin.Filename = row["Filename"].ToString().Trim(); skin.WebKeyWords = row["WebKeyWords"].ToString().Trim(); skin.IndexPage = row["IndexPage"].ToString().Trim(); return (EntityBase)skin; case "TCG.Entity.SheifSourceInfo": SheifSourceInfo sourceinfo = new SheifSourceInfo(); sourceinfo.Id = row["ID"].ToString().Trim(); sourceinfo.SourceName = row["SourceName"].ToString().Trim(); sourceinfo.SourceUrl = row["SourceUrl"].ToString().Trim(); sourceinfo.CharSet = row["CharSet"].ToString().Trim(); sourceinfo.ListAreaRole = row["ListAreaRole"].ToString().Trim(); sourceinfo.TopicListRole = row["TopicListRole"].ToString().Trim(); sourceinfo.TopicListDataRole = row["TopicListDataRole"].ToString().Trim(); sourceinfo.TopicRole = row["TopicRole"].ToString().Trim(); sourceinfo.TopicDataRole = row["TopicDataRole"].ToString().Trim(); sourceinfo.TopicPagerOld = row["TopicPagerOld"].ToString().Trim(); sourceinfo.TopicPagerTemp = row["TopicPagerTemp"].ToString().Trim(); sourceinfo.IsRss = (bool)row["IsRss"]; return (EntityBase)sourceinfo; case "TCG.Entity.FileCategories": //FileCategories filecagegories = new FileCategories(); //filecagegories.Id = row["iId"].ToString(); //filecagegories.iParentId = objectHandlers.ToInt(row["iParentId"]); //filecagegories.dCreateDate = objectHandlers.ToTime(row["dCreateDate"].ToString()); //filecagegories.vcFileName = row["vcFileName"].ToString().Trim(); //filecagegories.vcMeno = row["vcMeno"].ToString().Trim(); //filecagegories.vcKey = row["vcKey"].ToString().Trim(); //filecagegories.MaxSpace = objectHandlers.ToLong(row["MaxSpace"]); //filecagegories.Space = objectHandlers.ToLong(row["Space"]); //return (EntityBase)filecagegories; case "TCG.Entity.FileResources": //FileResources fileresource = new FileResources(); //fileresource.Id = row["iID"].ToString().Trim(); //fileresource.iClassId = (int)row["iClassId"]; //fileresource.iSize = (int)row["iSize"]; //fileresource.vcFileName = row["vcFileName"].ToString().Trim(); //fileresource.vcIP = row["vcIP"].ToString().Trim(); //fileresource.vcType = row["vcType"].ToString().Trim(); //fileresource.iRequest = (int)row["iRequest"]; //fileresource.iDowns = (int)row["iDowns"]; //fileresource.dCreateDate = (DateTime)row["dCreateDate"]; //return (EntityBase)fileresource; case "TCG.Entity.SheifCategorieConfig": SheifCategorieConfig sheifcategorieconfig = new SheifCategorieConfig(); sheifcategorieconfig.Id = row["Id"].ToString(); sheifcategorieconfig.SheifSourceId = row["SheifSourceId"].ToString().Trim(); sheifcategorieconfig.LocalCategorieId = row["LocalCategorieId"].ToString().Trim(); sheifcategorieconfig.ResourceCreateDateTime = objectHandlers.ToTime(row["ResourceCreateDateTime"].ToString().Trim()); return (EntityBase)sheifcategorieconfig; case "TCG.Entity.Properties": Properties categorieProperties = new Properties(); categorieProperties.Id = row["Id"].ToString(); categorieProperties.ProertieName = row["ProertieName"].ToString(); categorieProperties.PropertiesCategorieId = row["PropertiesCategorieId"].ToString(); categorieProperties.Type = row["Type"].ToString(); categorieProperties.Values = row["Values"].ToString(); categorieProperties.width = objectHandlers.ToInt(row["width"].ToString()); categorieProperties.height = objectHandlers.ToInt(row["height"].ToString()); categorieProperties.iOrder = objectHandlers.ToInt(row["iOrder"].ToString()); return (EntityBase)categorieProperties; case "TCG.Entity.ResourceProperties": ResourceProperties rategorieProperties = new ResourceProperties(); rategorieProperties.Id = row["Id"].ToString(); rategorieProperties.ResourceId = row["ResourceId"].ToString(); rategorieProperties.PropertieName = row["PropertieName"].ToString(); rategorieProperties.PropertieValue = row["PropertieValue"].ToString(); rategorieProperties.PropertieId = objectHandlers.ToInt(row["PropertieId"].ToString()); rategorieProperties.iOrder = objectHandlers.ToInt(row["iOrder"].ToString()); return (EntityBase)rategorieProperties; case "TCG.Entity.PropertiesCategorie": PropertiesCategorie pc = new PropertiesCategorie(); pc.CategoriePropertiesName = row["CategoriePropertiesName"].ToString(); pc.Id = row["Id"].ToString(); pc.Visible = row["Visible"].ToString(); pc.Visible = row["Visible"].ToString(); return (EntityBase)pc; case "TCG.Entity.Speciality": Speciality speciality = new Speciality(); speciality.Id = row["Id"].ToString(); speciality.SkinId = (string)row["SkinId"]; speciality.iParent = (int)row["iParent"]; speciality.vcTitle = (string)row["vcTitle"]; speciality.vcExplain = (string)row["vcExplain"]; speciality.dUpDateDate = (DateTime)row["dUpDateDate"]; return (EntityBase)speciality; case "TCG.Entity.FeedBack": FeedBack feedBack = new FeedBack(); feedBack.Id = row["Id"].ToString(); feedBack.UserName = row["UserName"].ToString(); feedBack.Tel = row["Tel"].ToString(); feedBack.QQ = row["QQ"].ToString(); feedBack.Content = row["Content"].ToString(); feedBack.AddDate = objectHandlers.ToTime(row["AddDate"].ToString()); feedBack.Ip = row["Ip"].ToString(); feedBack.SkinId = row["SkinId"].ToString(); feedBack.Title = row["Title"].ToString(); feedBack.Email = row["Email"].ToString(); return (EntityBase)feedBack; } return null; }