public void CreateHtmlFunc(HttpRequest r, bool c, M_CommonData cdate, DataTable table) { M_Node noinfo = nodeBll.GetNodeXML(NodeID); if (noinfo.ListPageHtmlEx < 3 && quickmake.Checked == true) { B_Create CreateBll = new B_Create(r); if (c) { CreateBll.createann(cdate.GeneralID.ToString()); //发布内容页 CreateBll.CreateColumnByID(cdate.NodeID.ToString()); //发布栏目页 } CreateBll.CreatePageIndex(); //发布首页 } cdate = contentBll.SelReturnModel(cdate.GeneralID); string[] strArr = fieldBll.GetIsChain(ModelID, 1).Split(',');//需要替换的字段 for (int i = 0; i < strArr.Length; i++) { DataRow[] dr = table.Select("FieldName = '" + strArr[i] + "' "); if (dr != null && dr.Length > 0) { dr[0]["FieldValue"] = wordBll.RePlaceKeyWord(dr[0]["FieldValue"].ToString()); } } contentBll.UpdateContent(table, cdate); }
private void CreateHtmlFunc(HttpRequest r, M_CommonData cdata, DataTable table) { M_Node noinfo = nodeBll.GetNodeXML(cdata.NodeID); if (noinfo.ListPageHtmlEx < 3) { B_Create CreateBll = new B_Create(r); CreateBll.createann(cdata.GeneralID.ToString()); //发布内容页 CreateBll.CreateColumnByID(cdata.NodeID.ToString()); //发布栏目页 CreateBll.CreatePageIndex(); //发布首页 } cdata = contentBll.SelReturnModel(cdata.GeneralID); contentBll.UpdateContent(table, cdata); }
private void BeginRelease() { List <M_Release> list = GetModel(); if (list == null) { return; } File.Delete(function.VToP(vpath)); foreach (M_Release model in list) { #region 生成 switch (model.MyRType) { case M_Release.RType.Index: //生成全站首页或栏目首页 if (string.IsNullOrEmpty(model.NodeIDS)) { bc.CreatePageIndex(); } //else { bc.CreatePageIndex(DataConverter.CLng(model.NodeIDS)); } break; case M_Release.RType.ALL: //生成指定栏目下或全站的内容 CreateSiteAll(model.NodeIDS); break; case M_Release.RType.IDRegion: CreateByIDRegion(model); break; case M_Release.RType.Newest: //指定数量的最新文章 bc.CreateLastInfoRecord(model.Count.ToString()); break; case M_Release.RType.DateRegion: CreateByDate(model); break; case M_Release.RType.ByNodeIDS: //通过栏目ID发布内容 bc.CreateInfoColumn(model.NodeIDS); break; case M_Release.RType.ALLNode: //所有栏目的内容页 bc.CreateColumnAll(); break; case M_Release.RType.NodeIDS: //发布选定栏目页 bc.CreateColumnByID(model.NodeIDS); break; case M_Release.RType.ALLSPage: bc.CreateSingle(); break; case M_Release.RType.SPage: //取出指定单页信息,交于节点生成方法生成 bc.CreateColumnByID(model.NodeIDS); break; case M_Release.RType.Special: bc.CreateSpecial(model.NodeIDS); break; case M_Release.RType.Gids: //发布选定的多个内容页 bc.createann(model.Gids); break; default: ZLLog.L(Model.ZLEnum.Log.safe, "指定的生成方式不存在"); return; }//switch end; #endregion } if (contentCount < 1 && bc.m_CreateCount > 0) { //后期全部转移至此 contentCount = bc.m_CreateCount; } ResutList.Add(new M_ReleaseResult() { ResultMsg = "<i class=\"fa fa-check-circle\"></i>生成请求处理完成", Status = 99, Count = contentCount, IsEnd = true }); }
protected void Button1_Click(object sender, EventArgs e) { if (Page.IsValid) { string adminname = HttpContext.Current.Request.Cookies["ManageState"]["LoginName"]; adminname = StringHelper.Base64StringDecode(adminname); M_CommonData CData = contentBll.GetCommonData(GeneralID); NodeID = CData.NodeID; ModelID = CData.ModelID; CData.Title = txtTitle.Text; int elite = ChkAudit.Checked ? 1 : 0; if (CData.EliteLevel == 0 && elite == 1) { if (SiteConfig.UserConfig.InfoRule > 0) { M_UserInfo muser = buser.GetUserByName(adminname); if (!muser.IsNull) { buser.ChangeVirtualMoney(muser.UserID, new M_UserExpHis() { score = SiteConfig.UserConfig.InfoRule, detail = "修改内容:" + txtTitle.Text + "增加积分", ScoreType = (int)M_UserExpHis.SType.Point }); } } } CData.EliteLevel = elite; CData.InfoID = ""; CData.Template = TxtTemplate_hid.Value; if (TlpView_Tlp.Count > 0) { CData.Template = TlpView_Tlp.SelectedValue; } CData.Hits = DataConverter.CLng(txtNum.Text); CData.FirstNodeID = GetFriestNode(CData.NodeID); CData.UpDateType = 2; CData.UpDateTime = DataConverter.CDate(txtdate.Text); CData.Hits = string.IsNullOrEmpty(txtNum.Text) ? 0 : DataConverter.CLng(txtNum.Text); CData.PdfLink = ""; CData.Status = Convert.ToInt32(ddlFlow.SelectedValue.Trim()); if (string.IsNullOrEmpty(txtAddTime.Text)) { CData.CreateTime = contentBll.GetCommonData(GeneralID).CreateTime; } else { CData.CreateTime = DataConverter.CDate(txtAddTime.Text); } if (string.IsNullOrEmpty(txtInputer.Text)) { CData.Inputer = contentBll.GetCommonData(GeneralID).Inputer; } else { CData.Inputer = txtInputer.Text; } CData.Status = Convert.ToInt32(ddlFlow.SelectedValue.Trim()); string OldKey = CData.TagKey; //CData.TagKey = Keyword; CData.TopImg = "";//首页图片 DataTable dt = bfield.GetModelFieldList(ModelID).Tables[0]; Call commonCall = new Call(); DataTable table = commonCall.GetDTFromPage(dt, Page, ViewState, content); int newID = contentBll.AddContent(table, CData);//插入信息给两个表,主表和从表:CData-主表的模型,table-从表 string iscreate = "0"; if (quickmake.Checked == true) { B_Create CreateBll = new B_Create(); if (createnew) { CreateBll.createann(newID.ToString()); //发布内容页 CreateBll.CreateColumnByID(NodeID.ToString()); //发布栏目页 } CreateBll.CreatePageIndex(); //发布首页 iscreate = "1"; } //关键字 B_KeyWord kll = new B_KeyWord(); //积分 if (SiteConfig.UserConfig.InfoRule > 0) { M_UserInfo muser = buser.GetUserByName(adminname); if (!muser.IsNull) { buser.ChangeVirtualMoney(muser.UserID, new M_UserExpHis() { UserID = muser.UserID, detail = "添加内容:" + txtTitle.Text + "增加积分", score = SiteConfig.UserConfig.InfoRule, ScoreType = (int)M_UserExpHis.SType.Point }); } } Response.Redirect("ContentShow.aspx?gid=" + newID + "&iscreate=" + iscreate + "&nodename=" + Server.UrlEncode(nodename.Value) + "&type=add"); } }
private static Task BeginRelease() { List <M_Release> list = GetModel(); if (list == null || list.Count < 1) { AddResult("<i class='fa fa-lightbulb-o'></i> 没有需要生成的内容"); return(Task.CompletedTask); } File.Delete(function.VToP(vpath)); foreach (M_Release model in list) { try { #region 生成 switch (model.MyRType) { case M_Release.RType.Index: //生成全站首页或栏目首页 if (string.IsNullOrEmpty(model.NodeIDS)) { bc.CreatePageIndex(); } //else { bc.CreatePageIndex(DataConverter.CLng(model.NodeIDS)); } break; case M_Release.RType.ALL: //生成指定栏目下或全站的内容 CreateSiteAll(model.NodeIDS); break; case M_Release.RType.IDRegion: CreateByIDRegion(model); break; case M_Release.RType.Newest: //指定数量的最新文章 bc.CreateLastInfoRecord(model.Count.ToString()); break; case M_Release.RType.DateRegion: CreateByDate(model); break; case M_Release.RType.ByNodeIDS: //通过栏目ID发布内容 bc.CreateInfoColumn(model.NodeIDS); break; case M_Release.RType.ALLNode: //所有栏目的内容页 bc.CreateColumnAll(); break; case M_Release.RType.NodeIDS: //发布选定栏目页 bc.CreateColumnByID(model.NodeIDS); break; case M_Release.RType.ALLSPage: bc.CreateSingle(); break; case M_Release.RType.SPage: //取出指定单页信息,交于节点生成方法生成 bc.CreateColumnByID(model.NodeIDS); break; case M_Release.RType.Special: //生成专题列表页与所属内容页 bc.CreateSpecial(model.NodeIDS); break; case M_Release.RType.Gids: //发布选定的多个内容页 bc.createann(model.Gids); break; default: ZLLog.L(Model.ZLEnum.Log.labelex, "指定的生成方式不存在"); return(Task.CompletedTask); }//switch end; #endregion } catch (Exception ex) { ZLLog.L(Model.ZLEnum.Log.labelex, "BeginRelease--," + JsonConvert.SerializeObject(model) + "原因:" + ex.Message); } } if (contentCount < 1 && bc.m_CreateCount > 0) { contentCount = bc.m_CreateCount; } ResutList.Add(new M_ReleaseResult() { ResultMsg = "<i class=\"fa fa-check-circle\"></i>生成请求处理完成", Status = 99, Count = contentCount, IsEnd = true }); return(Task.CompletedTask); }