public void MyBind() { B_KeyWord bkeyword = new B_KeyWord(); GridView1.DataSource = bkeyword.GetKeyWordAll();// GetAuthorPage(0, 0, 10); GridView1.DataBind(); }
//填充共通部分 private M_CommonData FillContentModel(ref DataTable table, M_CommonData CData, ref string err) { if (CData == null) { CData = new M_CommonData(); } //if (SiteConfig.SiteOption.FileRj == 1 && contentBll.SelHasTitle(RequestEx["txtTitle"])) { WriteErr(Resources.L.该内容标题已存在 + "!", "javascript:history.go(-1);"); } if (CData.GeneralID < 1) { CData.Inputer = adminMod.AdminName; CData.NodeID = NodeID; CData.ModelID = ModelID; CData.TableName = modelBll.SelReturnModel(ModelID).TableName; string parentTree = ""; CData.FirstNodeID = nodeBll.SelFirstNodeID(CData.NodeID, ref parentTree); CData.ParentTree = parentTree; } DataTable dt = fieldBll.SelByModelID(CData.ModelID, false); try { table = Call.GetDTFromMVC(dt, Request); } catch (Exception ex) { err = ex.Message; return(null); } CData.Title = RequestEx["txtTitle"]; CData.EliteLevel = DataConvert.CLng(RequestEx["EliteLevel"]); CData.Hits = DataConvert.CLng(RequestEx["Hits"]); CData.TagKey = RequestEx["tabinput"]; CData.Status = DataConvert.CLng(RequestEx["ddlFlow"]); CData.Template = RequestEx["TemplateUrl_hid"]; CData.CreateTime = DataConverter.CDate(RequestEx["CreateTime"]); CData.UpDateTime = DataConverter.CDate(RequestEx["UpDateTime"]); CData.SpecialID = "," + string.Join(",", DataConvert.CStr(RequestEx["Spec_Hid"]).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)) + ","; CData.TitleStyle = RequestEx["ThreadStyle"]; CData.TopImg = RequestEx["ThumImg_Hid"];//首页图片 CData.Subtitle = RequestEx["Subtitle"]; CData.PYtitle = RequestEx["PYtitle"]; CData.RelatedIDS = RequestEx["RelatedIDS_Hid"]; CData.IsComm = DataConvert.CLng(RequestEx["IsComm_Radio"]); CData.UGroupAuth = RequestEx["UGroupAuth"]; CData.IsTop = DataConvert.CLng(RequestEx["IsTop"]); CData.IsTopTime = DataConvert.CStr(RequestEx["IsTopTime"]); #region 关键词 { B_KeyWord keyBll = new B_KeyWord(); string[] ignores = DataConvert.CStr(RequestEx["Keywords"]).Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); string[] newKeys = CData.TagKey.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); string keys = StrHelper.RemoveRepeat(newKeys, ignores); if (!string.IsNullOrEmpty(keys)) { keyBll.AddKeyWord(keys, 1); } } #endregion return(CData); }
//关键字绑定 protected void BindKeyword() { B_KeyWord bkeyword = new B_KeyWord(); DataTable dt = bkeyword.GetKeyWordAll(); RepKeyword.DataSource = dt; RepKeyword.DataBind(); }
private void DeleteKeyWords(string KWId) { B_KeyWord bkeywords = new B_KeyWord(); if (bkeywords.DeleteByID(KWId)) { HttpContext.Current.Response.Write("<script language=javascript> alert('删除成功!');window.document.location.href='KeyWordManage.aspx';</script>"); } }
private void InItModify(int Kwid) { B_KeyWord bkeyword = new B_KeyWord(); M_KeyWord mkeyword = bkeyword.GetKeyWordByid(Kwid); TxtKeywordText.Text = mkeyword.KeywordText; RadlKeywordType.SelectedValue = mkeyword.KeywordType.ToString(); TxtPriority.Text = mkeyword.Priority.ToString(); EBtnModify.Visible = true; EBtnSubmit.Visible = false; }
//关键字绑定 protected void BindKeyword() { B_KeyWord bkeyword = new B_KeyWord(); DataTable dt = bkeyword.GetKeyWordAll(); RepKeyword.DataSource = dt; RepKeyword.DataBind(); if (dt != null) { dt.Dispose(); } }
protected void EBtnModify_Click(object sender, EventArgs e) { B_KeyWord bkeyword = new B_KeyWord(); M_KeyWord mkeyword = new M_KeyWord(); mkeyword.KeyWordID = Convert.ToInt32(Request.QueryString["KWId"].Trim()); mkeyword.KeywordText = TxtKeywordText.Text.ToString(); mkeyword.KeywordType = DataConverter.CLng(RadlKeywordType.SelectedValue); mkeyword.Priority = DataConverter.CLng(TxtPriority.Text.ToString()); mkeyword.LastUseTime = DateTime.Now; mkeyword.ArrGeneralID = ""; if (bkeyword.Update(mkeyword)) { Response.Write("<script language=javascript> alert('修改成功!');window.document.location.href='KeyWordManage.aspx';</script>"); } }
protected void EBtnSubmit_Click(object sender, EventArgs e) { B_KeyWord bkeyword = new B_KeyWord(); M_KeyWord mkeyword = new M_KeyWord(); mkeyword.KeywordText = TxtKeywordText.Text.ToString(); mkeyword.KeywordType = DataConverter.CLng(RadlKeywordType.SelectedValue); mkeyword.Priority = DataConverter.CLng(TxtPriority.Text.ToString()); mkeyword.LastUseTime = DateTime.Now; mkeyword.ArrGeneralID = ""; if (bkeyword.Add(mkeyword)) { Response.Write("<script language=javascript> alert('添加成功!');window.document.location.href='KeyWordManage.aspx';</script>"); //Page.Response.Redirect("KeyWordManage.aspx"); } }
public string getKey() { B_KeyWord bll = new B_KeyWord(); DataTable temptable = bll.GetKeyWordAll(); string keys = ""; for (int i = 0; i < temptable.Rows.Count; i++) { if (i == 0) { keys = temptable.Rows[i]["KeywordText"].ToString(); } else { keys = keys + "," + temptable.Rows[i]["KeywordText"].ToString(); } } return(keys); }
protected void btndelete_Click(object sender, EventArgs e) { B_KeyWord bkeyword = new B_KeyWord(); int i = 0, flag = 0; string sid = ""; for (i = 0; i < GridView1.Rows.Count; i++) { if (((CheckBox)GridView1.Rows[i].Cells[0].FindControl("SelectCheckBox")).Checked) { sid = GridView1.DataKeys[GridView1.Rows[i].RowIndex].Value.ToString(); if (bkeyword.DeleteByID(sid)) { flag++; } } } if (flag > 0) { Response.Write("<script language=javascript> alert('批量删除成功!');window.document.location.href='KeyWordManage.aspx';</script>"); } }
protected void EBtnSubmit_Click(object sender, EventArgs e) { Call CommonCall = new Call(); IList <string> content = new List <string>(); if (this.Page.IsValid) { this.ModelID = DataConverter.CLng(this.HdnModel.Value); this.NodeID = DataConverter.CLng(this.HdnNode.Value); DataTable dt = this.bfield.GetModelFieldList(this.ModelID).Tables[0]; this.UserInfo = buser.GetLogin(); DataTable table = CommonCall.GetDTFromPage(dt, this.Page, ViewState); M_CommonData CData = new M_CommonData(); M_Node nodeMod = bnode.GetNodeXML(this.NodeID); CData.NodeID = this.NodeID; CData.ModelID = this.ModelID; CData.TableName = this.bmode.GetModelById(this.ModelID).TableName; CData.Title = BaseClass.CheckInjection(this.txtTitle.Text); CData.Inputer = this.UserInfo.UserName; CData.EliteLevel = 0; CData.Status = nodeMod.SiteContentAudit;//读取节点中定义的状态 CData.Template = ""; CData.InfoID = ""; CData.SpecialID = ""; CData.PdfLink = ""; CData.CreateTime = DateTime.Now; CData.FirstNodeID = GetFriestNode(this.NodeID); CData.ParentTree = GetParentTree(this.NodeID); CData.IsBid = (CData.BidType > 0) ? 1 : 0; CData.DefaultSkins = 0; string Keyword = this.TxtTagKey.Text.Trim(); CData.TagKey = Keyword; CData.TopImg = "";//首页图片 //if (allpromoney > this.UserInfo.UserPoint) //{ // function.WriteErrMsg("您的点卡不够发布此内容!请充值后再发布!"); //} //插入数据 int newID = this.bll.AddContent(table, CData); B_KeyWord kll = new B_KeyWord(); if (!string.IsNullOrEmpty(Keyword)) { string[] arrKey = Keyword.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); for (int tt = 0; tt < arrKey.Length; tt++) { if (kll.IsExist(arrKey[tt])) { M_KeyWord kinfo = kll.GetKeyByName(arrKey[tt]); kinfo.QuoteTimes++; kinfo.LastUseTime = DateTime.Now; if (string.IsNullOrEmpty(kinfo.ArrGeneralID)) { kinfo.ArrGeneralID = newID.ToString() + ","; } else { kinfo.ArrGeneralID = kinfo.ArrGeneralID + newID.ToString() + ","; } kll.Update(kinfo); } else { M_KeyWord kinfo1 = new M_KeyWord(); kinfo1.KeyWordID = 0; kinfo1.KeywordText = arrKey[tt]; kinfo1.KeywordType = 1; kinfo1.LastUseTime = DateTime.Now; kinfo1.Hits = 0; kinfo1.Priority = 10; kinfo1.QuoteTimes = 1; kinfo1.ArrGeneralID = "," + newID.ToString() + ","; kll.Add(kinfo1); } } } //if (SiteConfig.UserConfig.InfoRule > 0) //{ // if (buser.AddExp(this.UserInfo.UserID, SiteConfig.UserConfig.InfoRule)) // { // Response.Write(this.UserInfo.UserID); // Response.End(); // M_UserExpHis hist = new M_UserExpHis(); // hist.UserID = this.UserInfo.UserID; // hist.Operator = this.UserInfo.UserID; // hist.detail = this.txtTitle.Text; // hist.score = SiteConfig.UserConfig.InfoRule; // hist.OperatorIP = Request.UserHostAddress; // B_History.AddExpHis(hist); // } //} int nodeid = this.NodeID; M_Node noinfo = bnode.GetNodeXML(nodeid); M_UserInfo uinfos = this.UserInfo; int AddPoint = DataConverter.CLng(noinfo.AddPoint); double AddMoney = DataConverter.CLng(noinfo.AddMoney); //uinfos.UserPoint = uinfos.UserPoint - allpromoney; uinfos.UserPoint = uinfos.UserPoint - AddPoint; uinfos.Purse = uinfos.Purse - AddMoney; buser.UpDateUser(uinfos); Response.Redirect("MyMoney.aspx?NodeID=" + this.NodeID); } }
protected void EBtnSubmit_Click(object sender, EventArgs e)//添加文章 { IList <string> content = new List <string>(); string adminname = HttpContext.Current.Request.Cookies["ManageState"]["LoginName"]; adminname = StringHelper.Base64StringDecode(adminname); if (SiteConfig.SiteOption.FileRj == 1 && contentBll.SelHasTitle(txtTitle.Text.Trim())) { function.WriteErrMsg("该内容标题已存在!", "javascript:history.go(-1);"); } DataTable dt = mfieldBll.GetModelFieldAllListT(ModelID).Tables[0]; Call commonCall = new Call(); DataTable table = commonCall.GetDTFromPage(dt, Page, ViewState, content); M_CommonData CData = new M_CommonData(); CData.NodeID = NodeID; CData.ModelID = ModelID; CData.TableName = modelBll.GetModelById(ModelID).TableName; CData.Title = txtTitle.Text.Trim(); CData.Inputer = string.IsNullOrEmpty(txtInputer.Text) ? adminname : txtInputer.Text; CData.EliteLevel = ChkAudit.Checked ? 1 : 0; CData.InfoID = ""; CData.Hits = string.IsNullOrEmpty(txtNum.Text) ? 0 : DataConverter.CLng(txtNum.Text); CData.UpDateType = 2; CData.UpDateTime = DataConverter.CDate(txtdate.Text); CData.TagKey = Request.Form["tabinput"]; string status = ddlFlow.SelectedValue.Trim(); if (!string.IsNullOrEmpty(status)) { CData.Status = Convert.ToInt32(status); } // CData.Titlecolor = Titlecolor.Text; CData.Template = TxtTemplate_hid.Value; CData.CreateTime = DataConverter.CDate(txtAddTime.Text); CData.ProWeek = DataConverter.CLng(proweek.Text); CData.SpecialID = "," + string.Join(",", Spec_Hid.Value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)) + ","; CData.Pronum = DataConverter.CLng(pronum.Text); CData.BidType = DataConverter.CLng(BidType.SelectedValue); CData.IsBid = (CData.BidType > 0) ? 1 : 0; CData.BidMoney = DataConverter.CDouble(bidmoney.Text); CData.DefaultSkins = 0; CData.FirstNodeID = GetFriestNode(NodeID); CData.TitleStyle = ThreadStyle.Value; CData.ParentTree = GetParentTree(NodeID); //父级别树 CData.TopImg = Request.Form["selectpic"]; //首页图片 CData.PdfLink = Makepdf.Checked ? "pdf_" + DateTime.Now.ToString("yyyyMMddHHmmssfffffff") + ".pdf" : ""; CData.Subtitle = Subtitle.Text; CData.PYtitle = PYtitle.Text; CData.RelatedIDS = RelatedIDS_Hid.Value; CData.IsComm = Convert.ToInt32(IsComm_Radio.SelectedValue); int newID = contentBll.AddContent(table, CData);//插入信息给两个表,主表和从表:CData-主表的模型,table-从表 //推送 if (!string.IsNullOrEmpty(pushcon_hid.Value)) { string[] nodeArr = pushcon_hid.Value.Trim(',').Split(','); for (int i = 0; i < nodeArr.Length; i++) { CData.NodeID = Convert.ToInt32(nodeArr[i]); contentBll.AddContent(table, CData); } } #region 生成PDF //if (Makepdf.Checked) //{ // M_CommonData m_CommonData = contentBll.SelReturnModel(newID); // string strSql = "select source from " + CData.TableName + " where id=" + m_CommonData.ItemID; // string source = ""; // SqlDataReader dr = SqlHelper.ExecuteReader(System.Data.CommandType.Text, strSql); // if (dr.Read()) // { // source = dr["source"].ToString(); // } // dr.Close(); //} #endregion #region 关键词 B_KeyWord kll = new B_KeyWord(); if (!string.IsNullOrEmpty(CData.TagKey)) { string[] arrKey = CData.TagKey.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); for (int tt = 0; tt < arrKey.Length; tt++) { if (kll.IsExist(arrKey[tt])) { M_KeyWord kinfo = kll.GetKeyByName(arrKey[tt]); kinfo.QuoteTimes++; kinfo.LastUseTime = DateTime.Now; if (string.IsNullOrEmpty(kinfo.ArrGeneralID)) { kinfo.ArrGeneralID = newID.ToString() + ","; } else { kinfo.ArrGeneralID = kinfo.ArrGeneralID + newID.ToString() + ","; } kll.Update(kinfo); } else { M_KeyWord kinfo1 = new M_KeyWord(); kinfo1.KeyWordID = 0; kinfo1.KeywordText = arrKey[tt]; kinfo1.KeywordType = 1; kinfo1.LastUseTime = DateTime.Now; kinfo1.Hits = 0; kinfo1.Priority = 10; kinfo1.QuoteTimes = 1; kinfo1.ArrGeneralID = "," + newID.ToString() + ","; kll.Add(kinfo1); } } } #endregion ZLLog.ToDB(ZLEnum.Log.content, new M_Log() { UName = adminname, Source = Request.RawUrl, Action = "添加内容", Message = "标题:" + CData.Title + ",Gid:" + newID, Level = "add" }); //添加计划任务(审核时间),如果自动审核时间小于当前时间则忽略 if (!string.IsNullOrEmpty(CheckDate_T.Text) && Convert.ToDateTime(CheckDate_T.Text) > DateTime.Now) { AddSched(newID, CheckDate_T.Text, M_Content_ScheTask.TaskTypeEnum.AuditArt); contentBll.UpdateStatus(newID, (int)ZLEnum.ConStatus.UnAudit); } if (!string.IsNullOrEmpty(TimeDate_T.Text)) { AddSched(newID, TimeDate_T.Text, M_Content_ScheTask.TaskTypeEnum.UnAuditArt); } //积分 if (SiteConfig.UserConfig.InfoRule > 0) { B_User buser = new B_User(); 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 }); } } M_Node noinfo = nodeBll.GetNodeXML(NodeID); CreateHtmlDel createHtml = CreateHtmlFunc; createHtml.BeginInvoke(HttpContext.Current.Request, quickmake.Checked, CData, table, null, null); Response.Redirect("ContentShow.aspx?gid=" + newID + "&nodename=" + Server.UrlEncode(nodename.Value) + "&type=add"); }
protected void EBtnSubmit_Click(object sender, EventArgs e)//添加文章 { //M_UserInfo mu = buser.GetLogin(); M_Node nodeMod = nodeBll.GetNodeXML(NodeID); IList <string> content = new List <string>(); if (SiteConfig.SiteOption.FileRj == 1 && contentBll.SelHasTitle(txtTitle.Text.Trim())) { function.WriteErrMsg("该内容标题已存在!", "javascript:history.go(-1);"); } M_CommonData CData = new M_CommonData(); CData.NodeID = NodeID; CData.ModelID = ModelID; if (GeneralID > 0) { CData = contentBll.GetCommonData(GeneralID); } DataTable dt = mfieldBll.SelByModelID(CData.ModelID, false); Call commonCall = new Call(); DataTable table = commonCall.GetDTFromPage(dt, Page, ViewState, content); CData.TableName = modelBll.GetModelById(CData.ModelID).TableName; CData.Title = txtTitle.Text.Trim(); //CData.Inputer = mu.UserName; CData.EliteLevel = 0; CData.InfoID = ""; CData.UpDateType = 2; CData.TagKey = Request.Form["tabinput"]; CData.Status = nodeMod.SiteContentAudit; CData.DefaultSkins = 0; string parentTree = ""; CData.FirstNodeID = nodeBll.SelFirstNodeID(NodeID, ref parentTree); CData.ParentTree = parentTree; CData.TitleStyle = ThreadStyle.Value; CData.TopImg = Request.Form["selectpic"];//首页图片 CData.Subtitle = Subtitle.Text; CData.PYtitle = PYtitle.Text; CData.RelatedIDS = RelatedIDS_Hid.Value; CData.IsComm = 1; int newID = 0; if (GeneralID > 0)//修改内容 { CData.GeneralID = GeneralID; contentBll.UpdateContent(table, CData); newID = GeneralID; } else { newID = contentBll.AddContent(table, CData);//插入信息给两个表,主表和从表:CData-主表的模型,table-从表 } #region 关键词 B_KeyWord kll = new B_KeyWord(); if (!string.IsNullOrEmpty(CData.TagKey)) { string[] arrKey = CData.TagKey.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); for (int tt = 0; tt < arrKey.Length; tt++) { if (kll.IsExist(arrKey[tt])) { M_KeyWord kinfo = kll.GetKeyByName(arrKey[tt]); kinfo.QuoteTimes++; kinfo.LastUseTime = DateTime.Now; if (string.IsNullOrEmpty(kinfo.ArrGeneralID)) { kinfo.ArrGeneralID = newID.ToString() + ","; } else { kinfo.ArrGeneralID = kinfo.ArrGeneralID + newID.ToString() + ","; } kll.Update(kinfo); } else { M_KeyWord kinfo1 = new M_KeyWord(); kinfo1.KeyWordID = 0; kinfo1.KeywordText = arrKey[tt]; kinfo1.KeywordType = 1; kinfo1.LastUseTime = DateTime.Now; kinfo1.Hits = 0; kinfo1.Priority = 10; kinfo1.QuoteTimes = 1; kinfo1.ArrGeneralID = "," + newID.ToString() + ","; kll.Add(kinfo1); } } } #endregion //if (GeneralID <= 0)//添加时增加积分 //{ // //积分 // if (SiteConfig.UserConfig.InfoRule > 0) // { // buser.ChangeVirtualMoney(mu.UserID, new M_UserExpHis() // { // UserID = mu.UserID, // detail = "添加内容:" + txtTitle.Text + "增加积分", // score = SiteConfig.UserConfig.InfoRule, // ScoreType = (int)M_UserExpHis.SType.Point // }); // } // CreateHtmlDel createHtml = CreateHtmlFunc; // createHtml.BeginInvoke(HttpContext.Current.Request, quickmake.Checked, CData, table, null, null); // function.WriteSuccessMsg("添加成功!", "MyContent.aspx?NodeID=" + NodeID); //} //else //{ // function.WriteSuccessMsg("修改成功!", "MyContent.aspx?NodeID=" + CData.NodeID); //} }
protected void EBtnSubmit_Click(object sender, EventArgs e)//添加文章 { int nodeID = Convert.ToInt32(nodeDP.SelectedValue); if (nodeID < 0) { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请先选择栏目!!!');", true); return; } if (!AuthCheck(nodeID)) { function.WriteErrMsg("你没有对该栏目的添加权限!!!"); } M_CommonData CData = new M_CommonData(); DataTable dt = this.bfield.SelByModelID(modelID); DataTable table = new DataTable(); table.Columns.Add(new DataColumn("FieldName", typeof(string))); table.Columns.Add(new DataColumn("FieldType", typeof(string))); table.Columns.Add(new DataColumn("FieldValue", typeof(string))); //手动完成赋值 string[] fieldArr = { "Secret", "Urgency", "Importance" }; for (int i = 0; i < fieldArr.Length; i++) { DataRow dr = table.NewRow(); dr["FieldName"] = fieldArr[i]; dr["FieldType"] = "TextType"; dr["FieldValue"] = Request.Form[fieldArr[i]]; table.Rows.Add(dr); } //内容 DataRow dr2 = table.NewRow(); dr2["FieldName"] = "content"; dr2["FieldType"] = "MultipleHtmlType"; dr2["FieldValue"] = content.Text; table.Rows.Add(dr2); //所属部门 dr2 = table.NewRow(); dr2["FieldName"] = "UserGroupT"; dr2["FieldType"] = "TextType"; dr2["FieldValue"] = strBll.SelNameByUid(buser.GetLogin().UserID); table.Rows.Add(dr2); //附件 dr2 = table.NewRow(); dr2["FieldName"] = "Attach"; dr2["FieldType"] = "TextType"; dr2["FieldValue"] = SaveFile(); table.Rows.Add(dr2); //将无法获取的值,手动写入table中 if (!string.IsNullOrEmpty(Request.QueryString["Gid"])) { CData = bll.GetCommonData(Convert.ToInt32(Request.QueryString["Gid"])); } CData.NodeID = nodeID; CData.ModelID = modelID; CData.TableName = this.bmode.GetModelById(modelID).TableName; CData.Title = Title_T.Text.Trim(); //判断是否使用文件流程 CData.Status = 99; CData.EliteLevel = 0; CData.InfoID = ""; CData.SpecialID = ""; //CData.CreateTime = ""; CData.UpDateType = 2; CData.UpDateTime = DateTime.Now; string Keyword = this.TxtTagKey.Text.Trim().Replace(" ", "|"); ; CData.TagKey = Keyword; CData.Titlecolor = ""; CData.Template = ""; CData.CreateTime = DataConvert.CDate(CreateTime.Text); CData.ProWeek = 0; CData.Pronum = 0; CData.BidType = 0; CData.IsBid = (CData.BidType > 0) ? 1 : 0; CData.BidMoney = DataConverter.CDouble(0); CData.DefaultSkins = 0; CData.FirstNodeID = GetFriestNode(nodeID); CData.TitleStyle = Request.Form["ThreadStyle"]; CData.ParentTree = GetParentTree(nodeID); //父级别树 CData.TopImg = Request.Form["selectpic"]; //首页图片 CData.PdfLink = ""; CData.Subtitle = ""; CData.PYtitle = ""; int newID = 0; if (string.IsNullOrEmpty(Request.QueryString["Gid"]))//新增 { CData.Inputer = buser.GetLogin().UserName; CData.Hits = 0; newID = this.bll.AddContent(table, CData); //插入信息给两个表,主表和从表:CData-主表的模型,table-从表 B_KeyWord kll = new B_KeyWord(); //添加关键词 if (!string.IsNullOrEmpty(Keyword)) { string[] arrKey = Keyword.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); for (int tt = 0; tt < arrKey.Length; tt++) { if (kll.IsExist(arrKey[tt])) { M_KeyWord kinfo = kll.GetKeyByName(arrKey[tt]); kinfo.QuoteTimes++; kinfo.LastUseTime = DateTime.Now; if (string.IsNullOrEmpty(kinfo.ArrGeneralID)) { kinfo.ArrGeneralID = newID.ToString() + ","; } else { kinfo.ArrGeneralID = kinfo.ArrGeneralID + newID.ToString() + ","; } kll.Update(kinfo); } else { M_KeyWord kinfo1 = new M_KeyWord(); kinfo1.KeyWordID = 0; kinfo1.KeywordText = arrKey[tt]; kinfo1.KeywordType = 1; kinfo1.LastUseTime = DateTime.Now; kinfo1.Hits = 0; kinfo1.Priority = 10; kinfo1.QuoteTimes = 1; kinfo1.ArrGeneralID = "," + newID.ToString() + ","; kll.Add(kinfo1); } } } Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('添加成功');window.location.href='ContentManage.aspx?NodeID=" + nodeID + "'", true); } else //修改 { newID = CData.GeneralID; bll.UpdateContent(table, CData); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('修改成功');window.location.href='ContentManage.aspx?NodeID=" + nodeID + "'", true); } }
//保存项目 protected void EBtnSubmit_Click(object sender, EventArgs e) { 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; CData.NodeID = NodeID; 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, Operator = muser.UserID, OperatorIP = Request.UserHostAddress }); } } } /*-----------可用智能判断模型与节点绑定-------------------*/ M_Node nodeinfo = bnode.GetNodeXML(NodeID); if (nodeinfo.ContentModel != "") { string ContentModel = "," + nodeinfo.ContentModel + ","; if (ContentModel.IndexOf("," + ModelID.ToString() + ",") == -1) { nodeinfo.ContentModel = nodeinfo.ContentModel + "," + ModelID.ToString(); bnode.UpdateNode(nodeinfo); } } else { nodeinfo.ContentModel = ModelID.ToString(); bnode.UpdateNode(nodeinfo); } /*---------------------------------------------*/ CData.EliteLevel = elite; CData.InfoID = ""; CData.Template = TxtTemplate_hid.Value; CData.Hits = DataConverter.CLng(txtNum.Text); CData.UpDateType = 2; CData.UpDateTime = DataConverter.CDate(txtdate.Text); CData.Hits = string.IsNullOrEmpty(txtNum.Text) ? 0 : DataConverter.CLng(txtNum.Text); if (!string.IsNullOrEmpty(txtAddTime.Text)) { CData.CreateTime = DataConverter.CDate(txtAddTime.Text); } if (!string.IsNullOrEmpty(txtInputer.Text)) { CData.Inputer = txtInputer.Text; } string OldKey = CData.TagKey; CData.TagKey = Request.Form["tabinput"]; CData.Status = Convert.ToInt32(string.IsNullOrEmpty(ddlFlow.SelectedValue) ? "-3" : ddlFlow.SelectedValue);//-3为草稿状态 CData.ProWeek = DataConverter.CLng(proweek.Text); CData.Pronum = DataConverter.CLng(pronum.Text); CData.BidType = DataConverter.CLng(BidType.SelectedValue); CData.BidMoney = DataConverter.CDouble(bidmoney.Text); CData.Subtitle = Subtitle.Text; CData.PYtitle = PYtitle.Text; CData.FirstNodeID = GetFriestNode(NodeID); CData.TitleStyle = ThreadStyle.Value; CData.ParentTree = GetParentTree(NodeID); CData.TopImg = Request.Form["selectpic"];//首页图片 CData.SpecialID = Spec_Hid.Value; CData.RelatedIDS = RelatedIDS_Hid.Value; CData.IsComm = Convert.ToInt32(IsComm_Radio.SelectedValue); DataTable dt = bfield.GetModelFieldAllList(ModelID).Tables[0]; Call commonCall = new Call(); DataTable table = commonCall.GetDTFromPage(dt, Page, ViewState, content); contentBll.UpdateContent(table, CData); //推送 if (!string.IsNullOrEmpty(pushcon_hid.Value)) { string[] nodeArr = pushcon_hid.Value.Trim(',').Split(','); for (int i = 0; i < nodeArr.Length; i++) { CData.NodeID = Convert.ToInt32(nodeArr[i]); contentBll.AddContent(table, CData); } } #region 关键词 B_KeyWord kll = new B_KeyWord(); //if (!string.IsNullOrEmpty(Keyword)) //{ // if (string.IsNullOrEmpty(OldKey)) // { // string[] arrKey = Keyword.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); // for (int tt = 0; tt < arrKey.Length; tt++) // { // if (kll.IsExist(arrKey[tt])) // { // M_KeyWord kinfo = kll.GetKeyByName(arrKey[tt]); // kinfo.QuoteTimes++; // kinfo.LastUseTime = DateTime.Now; // if (string.IsNullOrEmpty(kinfo.ArrGeneralID)) // kinfo.ArrGeneralID = CData.GeneralID.ToString() + ","; // else // kinfo.ArrGeneralID = kinfo.ArrGeneralID + CData.GeneralID.ToString() + ","; // kll.Update(kinfo); // } // else // { // M_KeyWord kinfo1 = new M_KeyWord(); // kinfo1.KeyWordID = 0; // kinfo1.KeywordText = arrKey[tt]; // kinfo1.KeywordType = 1; // kinfo1.LastUseTime = DateTime.Now; // kinfo1.Hits = 0; // kinfo1.Priority = 10; // kinfo1.QuoteTimes = 1; // kinfo1.ArrGeneralID = "," + CData.GeneralID.ToString() + ","; // kll.Add(kinfo1); // } // } // } // else // { // string[] arrKey1 = Keyword.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); // string[] arrOld = OldKey.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); // for (int it = 0; it < arrKey1.Length; it++) // { // if (!FindInArr(arrOld, arrKey1[it])) // { // if (kll.IsExist(arrKey1[it])) // { // M_KeyWord kinfo = kll.GetKeyByName(arrKey1[it]); // kinfo.QuoteTimes++; // kinfo.LastUseTime = DateTime.Now; // if (string.IsNullOrEmpty(kinfo.ArrGeneralID)) // kinfo.ArrGeneralID = CData.GeneralID.ToString() + ","; // else // kinfo.ArrGeneralID = kinfo.ArrGeneralID + CData.GeneralID.ToString() + ","; // kll.Update(kinfo); // } // else // { // M_KeyWord kinfo1 = new M_KeyWord(); // kinfo1.KeyWordID = 0; // kinfo1.KeywordText = arrKey1[it]; // kinfo1.KeywordType = 1; // kinfo1.LastUseTime = DateTime.Now; // kinfo1.Hits = 0; // kinfo1.Priority = 10; // kinfo1.QuoteTimes = 1; // kinfo1.ArrGeneralID = "," + CData.GeneralID.ToString() + ","; // kll.Add(kinfo1); // } // } // } // } //} #endregion ZLLog.ToDB(ZLEnum.Log.content, new M_Log() { UName = adminname, Source = Request.RawUrl, Action = "修改内容", Message = "标题:" + CData.Title + ",Gid:" + CData.GeneralID, Level = "edit" }); //修改计划任务(审核时间) if (!CheckDate_Hid.Value.Equals(CheckDate_T.Text)) { UpdateSched(GeneralID, M_Content_ScheTask.TaskTypeEnum.AuditArt, CheckDate_T.Text); } //修改计划任务(过期时间) if (!TimeDate_Hid.Value.Equals(TimeDate_T.Text)) { UpdateSched(GeneralID, M_Content_ScheTask.TaskTypeEnum.UnAuditArt, TimeDate_T.Text); } if (!string.IsNullOrEmpty(Request.Form["HdnSpec"])) //专题 { string SpecID = Request.Form["HdnSpec"]; // HdnSpec.Value; if (SpecID.EndsWith(",")) { SpecID = SpecID.Substring(0, SpecID.LastIndexOf(",")); } } //修改多节点 string nodeid = (Request.Form["hfNode"] ?? "").TrimEnd(','); if (!string.IsNullOrEmpty(nodeid)) { string[] narr = nodeid.Split(','); bmn.DelByIDS(nodeid); M_MultiNode mmu = new M_MultiNode(); for (int i = 0; i < narr.Length; i++) { if (!string.IsNullOrEmpty(narr[i])) { mmu.N_NodeID = DataConverter.CLng(narr[i]); mmu.N_ItemID = GeneralID; bmn.GetInsert(mmu); } } } string iscreate = "0"; M_Node nodeMod = bnode.GetNodeXML(NodeID); CreateHtmlDel createHtml = CreateHtmlFunc; createHtml.BeginInvoke(HttpContext.Current.Request, createnew, CData, table, null, null); if (nodeMod.ListPageHtmlEx < 3 && quickmake.Checked == true) { iscreate = "1"; } Response.Redirect("ContentShow.aspx?gid=" + GeneralID + "&iscreate=" + iscreate + "&nodename=" + Server.UrlEncode(nodename.Value) + "&type=edit"); }
protected void EBtnSubmit_Click(object sender, EventArgs e) { if (this.Page.IsValid) { this.GeneralID = DataConverter.CLng(this.HdnItem.Value); M_CommonData CData = this.bll.GetCommonData(this.GeneralID); this.NodeID = CData.NodeID; this.ModelID = CData.ModelID; CData.Title = BaseClass.CheckInjection(this.txtTitle.Text); CData.GeneralID = this.GeneralID; //CData.EliteLevel = this.ChkAudit.Checked ? 1 : 0; CData.InfoID = ""; CData.SpecialID = ""; CData.ProWeek = DataConverter.CLng(this.proweek.Text); CData.Pronum = DataConverter.CLng(this.pronum.Text); CData.BidType = DataConverter.CLng(this.BidType.SelectedValue); //CData.IsBid = (CData.BidType > 0) ? 1 : 0; CData.BidMoney = DataConverter.CDouble(this.bidmoney.Text); CData.OrederClass = DataConverter.CLng(DropDownList1.SelectedValue.ToString()); CData.FirstNodeID = GetFriestNode(this.NodeID); CData.ParentTree = GetParentTree(this.NodeID); CData.TopImg = "";//首页图片 DataTable dt = this.bfield.GetModelFieldList(this.ModelID).Tables[0]; Call commonCall = new Call(); DataTable table = commonCall.GetDTFromPage(dt, this.Page, ViewState); string Keyword = BaseClass.CheckInjection(this.TxtTagKey.Text.Trim()); string OldKey = CData.TagKey; CData.TagKey = BaseClass.CheckInjection(Keyword); this.bll.UpdateContent(table, CData); B_KeyWord kll = new B_KeyWord(); if (!string.IsNullOrEmpty(Keyword)) { if (string.IsNullOrEmpty(OldKey)) { string[] arrKey = Keyword.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); for (int tt = 0; tt < arrKey.Length; tt++) { if (kll.IsExist(arrKey[tt])) { M_KeyWord kinfo = kll.GetKeyByName(arrKey[tt]); kinfo.QuoteTimes++; kinfo.LastUseTime = DateTime.Now; if (string.IsNullOrEmpty(kinfo.ArrGeneralID)) { kinfo.ArrGeneralID = CData.GeneralID.ToString() + ","; } else { kinfo.ArrGeneralID = kinfo.ArrGeneralID + CData.GeneralID.ToString() + ","; } kll.Update(kinfo); } else { M_KeyWord kinfo1 = new M_KeyWord(); kinfo1.KeyWordID = 0; kinfo1.KeywordText = BaseClass.CheckInjection(arrKey[tt]); kinfo1.KeywordType = 1; kinfo1.LastUseTime = DateTime.Now; kinfo1.Hits = 0; kinfo1.Priority = 10; kinfo1.QuoteTimes = 1; kinfo1.ArrGeneralID = "," + CData.GeneralID.ToString() + ","; kll.Add(kinfo1); } } } else { string[] arrKey1 = Keyword.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); string[] arrOld = OldKey.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); for (int it = 0; it < arrKey1.Length; it++) { if (!FindInArr(arrOld, arrKey1[it])) { if (kll.IsExist(arrKey1[it])) { M_KeyWord kinfo = kll.GetKeyByName(arrKey1[it]); kinfo.QuoteTimes++; kinfo.LastUseTime = DateTime.Now; if (string.IsNullOrEmpty(kinfo.ArrGeneralID)) { kinfo.ArrGeneralID = CData.GeneralID.ToString() + ","; } else { kinfo.ArrGeneralID = kinfo.ArrGeneralID + CData.GeneralID.ToString() + ","; } kll.Update(kinfo); } else { M_KeyWord kinfo1 = new M_KeyWord(); kinfo1.KeyWordID = 0; kinfo1.KeywordText = BaseClass.CheckInjection(arrKey1[it]); kinfo1.KeywordType = 1; kinfo1.LastUseTime = DateTime.Now; kinfo1.Hits = 0; kinfo1.Priority = 10; kinfo1.QuoteTimes = 1; kinfo1.ArrGeneralID = "," + CData.GeneralID.ToString() + ","; kll.Add(kinfo1); } } } } } Response.Redirect("MyProject.aspx?NodeID=" + this.NodeID); } }
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"); } }