public int Site_CMSPage_UpdateByp_gid(Site_CMSPage obj) { using (SiteCatesAccess access = new SiteCatesAccess()) { return(access.Site_CMSPage_UpdateByp_gid(obj)); } }
public List <Site_CMSPage> Site_CMSPage_SelectPage(string cloumns, int pageIndex, int pageSize, string orderBy, string where, out int rowCount) { DbCommand dbCmd = db.GetStoredProcCommand("Proc_Site_CMSPage_SelectPage"); db.AddOutParameter(dbCmd, "@rowCount", DbType.Int32, 4); db.AddInParameter(dbCmd, "@cloumns", DbType.String, cloumns); db.AddInParameter(dbCmd, "@pageIndex", DbType.Int32, pageIndex); db.AddInParameter(dbCmd, "@pageSize", DbType.Int32, pageSize); db.AddInParameter(dbCmd, "@orderBy", DbType.String, orderBy); db.AddInParameter(dbCmd, "@where", DbType.String, where); List <Site_CMSPage> list = new List <Site_CMSPage>(); try { using (IDataReader reader = db.ExecuteReader(dbCmd)) { while (reader.Read()) { //属性赋值 Site_CMSPage obj = Obj2Model <Site_CMSPage>(reader); list.Add(obj); } reader.NextResult(); } rowCount = (int)dbCmd.Parameters["@rowCount"].Value; return(list); } catch (Exception e) { throw new Exception(e.Message); } }
public int Site_CMSPage_Insert(Site_CMSPage obj) { using (SiteCatesAccess access = new SiteCatesAccess()) { return(access.Site_CMSPage_Insert(obj)); } }
public int Site_CMSPage_UpdateByp_gid(Site_CMSPage obj) { DbCommand dbCmd = db.GetStoredProcCommand("Proc_Site_CMSPage_UpdateByp_gid"); db.AddInParameter(dbCmd, "@p_id", DbType.Int32, obj.p_id); db.AddInParameter(dbCmd, "@p_gid", DbType.String, obj.p_gid); db.AddInParameter(dbCmd, "@p_name", DbType.String, obj.p_name); db.AddInParameter(dbCmd, "@p_path", DbType.String, obj.p_path); db.AddInParameter(dbCmd, "@p_tempPath", DbType.String, obj.p_tempPath); db.AddInParameter(dbCmd, "@p_filePath", DbType.String, obj.p_filePath); db.AddInParameter(dbCmd, "@p_createTime", DbType.String, obj.p_createTime); db.AddInParameter(dbCmd, "@p_createUser", DbType.String, obj.p_createUser); db.AddInParameter(dbCmd, "@p_pageDuty", DbType.String, obj.p_pageDuty); db.AddInParameter(dbCmd, "@p_siteName", DbType.Int32, obj.p_siteName); try { int returnValue = db.ExecuteNonQuery(dbCmd); return(returnValue); } catch (Exception e) { throw new Exception(e.Message); } }
public static int Site_CMSPage_Insert(Site_CMSPage obj) { ISiteService channel = Entity.CreateChannel <ISiteService>(SiteEnum.SiteService.SiteService); var result = channel.Site_CMSPage_Insert(obj); (channel as IDisposable).Dispose(); return(result); }
public ActionResult SiteCMSPageEdit() { string p_name = Request["p_name"] ?? string.Empty; string p_path = Request["p_path"] ?? string.Empty; string p_tempPath = Request["p_tempPath"] ?? string.Empty; string p_filePath = Request["p_filePath"] ?? string.Empty; string p_pageDuty = Request["p_pageDuty"] ?? string.Empty; string p_gid = Request["p_gid"] ?? string.Empty; int siteName = Request["siteName"].ToInt32(0); Site_CMSPage info = null; if (string.IsNullOrEmpty(p_gid)) { info = new Site_CMSPage(); //新增 info.p_gid = Entity.GenerateGUID(); info.p_createTime = DateTime.Now; info.p_createUser = SiteHelp.CurrentUserName; info.p_siteName = siteName; } else { info = SiteServiceClass.Site_CMSPage_SelectByp_gid(p_gid); } info.p_filePath = p_filePath; info.p_name = p_name; info.p_pageDuty = p_pageDuty; info.p_path = p_path; info.p_tempPath = p_tempPath; if (string.IsNullOrEmpty(p_gid)) { int result = SiteServiceClass.Site_CMSPage_Insert(info); if (result > 0) { return(Json(new { success = true, errors = new { text = "新增成功" } })); } else { return(Json(new { success = false, errors = new { text = "新增失败" } })); } } else { int result = SiteServiceClass.Site_CMSPage_UpdateByp_gid(info); if (result > 0) { return(Json(new { success = true, errors = new { text = "修改成功" } })); } else { return(Json(new { success = false, errors = new { text = "修改失败" } })); } } }
//测试action public ActionResult PublishPage() { string p_gid = Request["p_gid"] ?? string.Empty; string p_path = Request["p_path"] ?? string.Empty;//模板绝对路径 基地址 名称 Site_CMSPage info = SiteServiceClass.Site_CMSPage_SelectByp_gid(p_gid); string tempFilePath = info.p_tempPath; string generatePath = info.p_filePath; tempFilePath = tempFilePath.Replace("/", "\\"); generatePath = generatePath.Replace("~", "").Replace("/", "\\"); //查询页面下的区块数据 <路径,数据项> Dictionary <string, List <Site_CMSItem> > dic = new Dictionary <string, List <Site_CMSItem> >(); Site_CMSBlocksSearchInfo search = new Site_CMSBlocksSearchInfo() { b_p_gid = p_gid }; int rowCount; List <Site_CMSBlock> list = SiteServiceClass.Site_CMSBlock_SelectPage(search, 1, 100, out rowCount); List <Site_CMSItem> itemList = new List <Site_CMSItem>(); Site_CMSItemSearchInfo itemSearch = null; foreach (Site_CMSBlock item in list) { itemSearch = new Site_CMSItemSearchInfo() { i_status = (int)SiteEnum.SiteItemStatus.正常, i_b_gid = item.b_gid }; itemList = SiteServiceClass.Site_CMSItem_SelectPage(itemSearch, 1, 100, out rowCount); dic.Add(item.b_path, itemList); } //获取数据,传递到页面 ViewBag.dataList = dic; return(this.GeneratePage(tempFilePath, generatePath, this.ViewData, this.TempData, this.ControllerContext)); }
public ActionResult SiteCMSPageEditView() { string p_gid = Request["p_gid"] ?? string.Empty; int siteName = Request["siteName"].ToInt32(0); Site_CMSPage info = null; if (string.IsNullOrEmpty(p_gid)) { info = new Site_CMSPage(); } else { info = SiteServiceClass.Site_CMSPage_SelectByp_gid(p_gid); } ViewData["window"] = Request["window"] ?? string.Empty; ViewData["info"] = info; ViewBag.siteName = siteName; return(View()); }
public Site_CMSPage Site_CMSPage_SelectByp_gid(string p_gid) { DbCommand dbCmd = db.GetStoredProcCommand("Proc_Site_CMSPage_SelectByp_gid"); db.AddInParameter(dbCmd, "@p_gid", DbType.String, p_gid); Site_CMSPage obj = null; try { using (IDataReader reader = db.ExecuteReader(dbCmd)) { while (reader.Read()) { //属性赋值 obj = Obj2Model <Site_CMSPage>(reader); } } return(obj); } catch (Exception e) { throw new Exception(e.Message); } }
//测试action public ActionResult PublishPage() { string p_gid = Request["p_gid"] ?? string.Empty; string p_path = Request["p_path"] ?? string.Empty;//模板绝对路径 基地址 名称 Site_CMSPage info = SiteServiceClass.Site_CMSPage_SelectByp_gid(p_gid); string tempFilePath = info.p_tempPath; string generatePath = info.p_filePath; //获取页面发布服务配置名称 string siteName = Request["siteName"] ?? string.Empty;//模板绝对路径 基地址 名称 SiteEnum.SiteService serviceName = SiteEnum.SiteService.PublishPageService; SiteEnum.SiteName serviceEnum = (SiteEnum.SiteName)Enum.Parse(typeof(SiteEnum.SiteName), siteName); switch (serviceEnum) { case SiteEnum.SiteName.MainSite: serviceName = SiteEnum.SiteService.PublishPageService; break; case SiteEnum.SiteName.XiaoShuoSite: serviceName = SiteEnum.SiteService.PublishXiaoShuoPageService; break; case SiteEnum.SiteName.VideoSite: serviceName = SiteEnum.SiteService.PublishVideoPageService; break; default: serviceName = SiteEnum.SiteService.PublishPageService; break; } tempFilePath = tempFilePath.Replace("/", "\\"); generatePath = generatePath.Replace("~", "").Replace("/", "\\"); //查询页面下的区块数据 <路径,数据项> Dictionary <string, List <Site_CMSItem> > dic = new Dictionary <string, List <Site_CMSItem> >(); Site_CMSBlocksSearchInfo search = new Site_CMSBlocksSearchInfo() { b_p_gid = p_gid }; int rowCount; List <Site_CMSBlock> list = SiteServiceClass.Site_CMSBlock_SelectPage(search, 1, 100, out rowCount); List <Site_CMSItem> itemList = new List <Site_CMSItem>(); Site_CMSItemSearchInfo itemSearch = null; foreach (Site_CMSBlock item in list) { itemSearch = new Site_CMSItemSearchInfo() { i_status = (int)SiteEnum.SiteItemStatus.正常, i_b_gid = item.b_gid }; itemList = SiteServiceClass.Site_CMSItem_SelectPage(itemSearch, 1, 100, out rowCount); dic.Add(item.b_path, itemList); } //获取数据,传递到页面 ViewBag.dataList = dic; return(this.GeneratePage(tempFilePath, generatePath, serviceName, this.ViewData, this.TempData, this.ControllerContext)); }