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); }
public int ContentManage_Html(int id, string action) { B_Create createBll = new B_Create(); M_CommonData conMod = contentBll.SelReturnModel(id); switch (action) { case "create": { conMod.IsCreate = 1; contentBll.UpdateByID(conMod); createBll.CreateInfo(conMod.GeneralID, conMod.NodeID, conMod.ModelID); createBll.CreatePageIndex(); } break; case "del": { if (!string.IsNullOrEmpty(conMod.HtmlLink)) { conMod.HtmlLink = ""; SafeSC.DelFile(conMod.HtmlLink); } conMod.IsCreate = 0; createBll.CreatePageIndex(); contentBll.UpdateByID(conMod); } break; } return(M_APIResult.Success); }
/// <summary> /// This button event will create a new downloadable and open up the folder /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void B_CreateAndOpen_Click(object sender, EventArgs e) { if (Directory.Exists(TB_OutputFolder.Text)) { Process.Start(TB_OutputFolder.Text); } B_Create.PerformClick(); }
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); }
public void CreateNewUser(string firstName, string lastName, string email, Office office, Gender gender) { PageFactory.InitElements(webDriver, this); B_New.Click(); T_FirstName.SendKeys(firstName); PageFactory.InitElements(webDriver, this); T_LastName.SendKeys(lastName); T_Email.SendKeys(email); data = office.ToString("g").Replace("_", " "); DL_Office.Click(); data = gender.ToString("g").Replace("_", " "); RB_Gender.Click(); B_Create.Click(); }
public B_Release() { try { bc = new B_Create(); } catch { } }
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"); } }
//异步,后期切换为多线 public static async void Start(HttpContext ctx) { bc = new B_Create(ctx); await BeginRelease(); }