private void UpdateTemplateByNode(M_Node node) { string[] ModelArr = node.ContentModel.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); nodeBll.DelModelTemplate(node.NodeID, node.ContentModel); for (int i = 0; i < ModelArr.Length; i++) { if (!string.IsNullOrEmpty(RequestEx["ModelTemplate_" + ModelArr[i]])) { //将模型模板设定写入数据库 string temp = RequestEx["ModelTemplate_" + ModelArr[i]]; if (nodeBll.IsExistTemplate(node.NodeID, DataConverter.CLng(ModelArr[i]))) { nodeBll.UpdateModelTemplate(node.NodeID, DataConverter.CLng(ModelArr[i]), temp); } else { nodeBll.AddModelTemplate(node.NodeID, DataConverter.CLng(ModelArr[i]), temp); } } } }
protected void EBtnSubmit_Click(object sender, EventArgs e) { M_Node node = new M_Node(); if (NodeID > 0) { node = nodeBll.SelReturnModel(NodeID); } else { node.ParentID = ParentID; } node.NodeDir = TxtNodeDir.Text; node.NodeName = TxtNodeName.Text; if (!nodeBll.CheckCanSave(node)) { function.WriteErrMsg("节发现同栏目下栏目名或标识名重复,请点击确定重新修改节点"); } #region 修改 //node.Viewinglimit = EDHid.Value.TrimEnd('|'); node.NodeType = 1; node.NodePic = TxtNodePicUrl.Text; node.NodeUrl = ""; node.NodeListUrl = ""; node.Tips = TxtTips.Text; node.Description = TxtDescription.Text; node.Meta_Keywords = TxtMetaKeywords.Text; node.Meta_Description = TxtMetaDescription.Text; node.OpenNew = DataConverter.CBool(RBLOpenType.SelectedValue); node.ItemOpenType = DataConverter.CBool(RBLItemOpenType.SelectedValue); node.PurviewType = DataConverter.CBool(RBLPurviewType.SelectedValue); node.CommentType = RBLCommentType.SelectedValue; node.HitsOfHot = DataConverter.CLng(TxtHitsOfHot.Text); node.ListTemplateFile = TxtTemplate_hid.Value; node.IndexTemplate = IndexTemplate_hid.Value;// Request.Form[TxtIndexTemplate.UniqueID]; node.LastinfoTemplate = LastinfoTemplate_hid.Value; node.ProposeTemplate = ProposeTemplate_hid.Value; node.HotinfoTemplate = HotinfoTemplate_hid.Value; node.ConsumePoint = DataConverter.CLng(TxtConsumePoint.Text); node.ConsumeType = DataConverter.CLng(Page.Request.Form["ConsumeType"]); node.ConsumeTime = DataConverter.CLng(TxtConsumeTime.Text); node.ConsumeCount = DataConverter.CLng(TxtConsumeCount.Text); node.Shares = DataConverter.CFloat(TxtShares.Text); node.OpenTypeTrue = RBLOpenType.SelectedValue; node.ItemOpenTypeTrue = RBLItemOpenType.SelectedValue; node.Custom = GetCustom(); node.SiteConfige = ""; node.AddPoint = DataConverter.CLng(TxtAddPoint.Text); node.AddMoney = DataConverter.CDouble(TxtAddMoney.Text); node.ClickTimeout = DataConverter.CLng(ClickTimeout.SelectedValue); node.AddUserExp = DataConverter.CLng(txtAddExp.Text); node.DeducUserExp = DataConverter.CLng(txtDeducExp.Text); node.CDate = DataConverter.CDate(CDate_T.Text); node.CUser = badmin.GetAdminLogin().AdminId; node.CUName = CUser_T.Text; node.ContentModel = (Request.Form["ChkModel"] ?? ""); string modellist = node.ContentModel; Int32 Nodetype = 0; StringBuilder NodeListTypeall = new StringBuilder(); NodeListTypeall.Append(""); DataTable dt = bllmodel.GetModels(node.ContentModel); if (dt != null) { foreach (DataRow dr in dt.Rows) { NodeListTypeall.Append("," + dr["ModelType"]); } } NodeListTypeall.Append(","); if (Convert.ToInt32(NodeListTypeall.ToString().IndexOf(",1,")) > -1 && Convert.ToInt32(NodeListTypeall.ToString().IndexOf(",2,")) > -1) { Nodetype = 3; } else if (Convert.ToInt32(NodeListTypeall.ToString().IndexOf(",2,")) > -1 && Convert.ToInt32(NodeListTypeall.ToString().IndexOf(",1,")) == -1) { Nodetype = 2; } else if (Convert.ToInt32(NodeListTypeall.ToString().IndexOf(",1,")) > -1 && Convert.ToInt32(NodeListTypeall.ToString().IndexOf(",2,")) == -1) { Nodetype = 1; } if (Convert.ToInt32(NodeListTypeall.ToString().IndexOf(",5,")) > -1) { Nodetype = 5; } //--------------------------- if (DropDownList1.SelectedValue != "0") { M_Pub pm = pll.GetSelect(DataConverter.CLng(DropDownList1.SelectedValue)); Nodetype = (pm.Public == 1) ? 7 : 6; } node.ListPageHtmlEx = DataConverter.CLng(ListPageHtmlEx_Rad.SelectedValue); node.ContentFileEx = DataConverter.CLng(ContentFileEx_Rad.SelectedValue); node.ListPageEx = DataConverter.CLng(ListPageEx_Rad.SelectedValue); node.LastinfoPageEx = DataConverter.CLng(LastinfoPageEx_Rad.SelectedValue);//LastinfoTemplate.UniqueID node.HotinfoPageEx = DataConverter.CLng(HotinfoPageEx.SelectedValue); node.ProposePageEx = DataConverter.CLng(ProposePageEx.SelectedValue); node.ContentPageHtmlRule = DataConverter.CLng(DDLContentRule.SelectedValue); node.SafeGuard = SafeGuard.Checked ? 1 : 0; node.HtmlPosition = DataConverter.CLng(RBLPosition.SelectedValue); node.NodeListType = DataConverter.CLng(Nodetype); node.Contribute = isSimple_CH.Checked ? 1 : 0; node.SiteContentAudit = DataConverter.CLng(SiteContentAudit_Rad.SelectedValue); node.AuditNodeList = ""; DataTable auitdt = nodeBll.GetNodeAuitDT(); DataRow auitDr = auitdt.Rows[0]; auitDr["View"] = SelCheck_RadioList.SelectedValue; string ViewGroupvalue = ""; foreach (ListItem dd in ViewGroup_Chk.Items) { if (dd.Selected) { if (ViewGroupvalue != "") { ViewGroupvalue += ","; } ViewGroupvalue += dd.Value; } } auitDr["ViewGroup"] = ViewGroupvalue; string ViewGroup2value = ""; foreach (ListItem dd in ViewGroup2_Chk.Items) { if (dd.Selected) { if (ViewGroup2value != "") { ViewGroup2value += ","; } ViewGroup2value += dd.Value; } } auitDr["ViewSunGroup"] = ViewGroup2value; string ViewGroup3value = ""; foreach (ListItem dd in input_Chk.Items) { if (dd.Selected) { if (ViewGroup3value != "") { ViewGroup3value += ","; } ViewGroup3value += dd.Value; } } auitDr["input"] = ViewGroup3value; string forumvalue = ""; foreach (ListItem dd in forum_Chk.Items) { if (dd.Selected) { if (forumvalue != "") { forumvalue += ","; } forumvalue += dd.Value; } } auitDr["forum"] = forumvalue; node.Purview = JsonConvert.SerializeObject(auitdt); if (NodeID > 0) { nodeBll.UpdateByID(node); } else { nodeBll.Insert(node); } //----------ZL_Node_Template string[] ModelArr = modellist.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); nodeBll.DelModelTemplate(node.NodeID, modellist); for (int i = 0; i < ModelArr.Length; i++) { if (!string.IsNullOrEmpty(Page.Request.Form["ModelTemplate_" + ModelArr[i]].Trim())) { //将模型模板设定写入数据库 string temp = Page.Request.Form["ModelTemplate_" + ModelArr[i]].Trim(); if (nodeBll.IsExistTemplate(node.NodeID, DataConverter.CLng(ModelArr[i]))) { nodeBll.UpdateModelTemplate(node.NodeID, DataConverter.CLng(ModelArr[i]), temp); } else { nodeBll.AddModelTemplate(node.NodeID, DataConverter.CLng(ModelArr[i]), temp); } } } //--工作流 droMod = droBll.SelByNodeID(NodeID); if (droMod == null)//添加 { droMod = new M_NodeBindDroit(); droMod.NodeId = NodeID; droMod.FID = DataConverter.CLng(ddlState.SelectedValue); droBll.AddNodeBinDroit(droMod); } else { droMod.FID = DataConverter.CLng(ddlState.SelectedValue); droBll.UpdateByID(droMod); } for (int i = 0; i <= AdminRole_EGV.Rows.Count - 1; i++) { GridViewRow row = AdminRole_EGV.Rows[i]; CheckBox cbox1 = (CheckBox)row.FindControl("chkSel1"); CheckBox cbox2 = (CheckBox)row.FindControl("chkSel2"); CheckBox cbox3 = (CheckBox)row.FindControl("chkSel3"); CheckBox cbox4 = (CheckBox)row.FindControl("chkSel4"); CheckBox cbox5 = (CheckBox)row.FindControl("chkSel5"); CheckBox cbox6 = (CheckBox)row.FindControl("chkSel6"); HiddenField hd = (HiddenField)row.FindControl("HiddenRID"); M_NodeRole nr = bnll.SelModelByRidAndNid(NodeID, Convert.ToInt32(hd.Value)); if (nr == null) { nr = new M_NodeRole(); nr.NID = NodeID; nr.RID = Convert.ToInt32(hd.Value); } nr.look = cbox1.Checked ? 1 : 0; nr.addTo = cbox2.Checked ? 1 : 0; nr.State = cbox3.Checked ? 1 : 0; nr.Modify = cbox4.Checked ? 1 : 0; nr.Columns = cbox5.Checked ? 1 : 0; nr.Comments = cbox6.Checked ? 1 : 0; bnll.InsertUpdate(nr); } if (DropDownList1.SelectedValue != "0") { M_Pub pm = pll.GetSelect(DataConverter.CLng(DropDownList1.SelectedValue)); if (!("," + pm.PubNodeID + ",").Contains("," + NodeID + ","))//判断互动模型是否绑定该节点 { string[] strarr = pm.PubNodeID.Split(','); StringBuilder sb = new StringBuilder(); for (int x = 0; x < strarr.Length; x++) { StringHelper.AppendString(sb, strarr[x]); } StringHelper.AppendString(sb, NodeID.ToString()); pm.PubNodeID = sb.ToString(); } pll.GetUpdate(pm); } else { M_Pub pp = pll.GetSelectNode(NodeID.ToString()); if (pp.Pubid > 0) { string[] strarr = pp.PubNodeID.Split(','); StringBuilder sb = new StringBuilder(); for (int x = 0; x < strarr.Length; x++) { if (!strarr[x].Equals(NodeID.ToString())) { StringHelper.AppendString(sb, strarr[x]); } } pp.PubNodeID = sb.ToString(); pll.GetUpdate(pp); } } for (int i = 0; i <= GroupAuth_EGV.Rows.Count - 1; i++) { CheckBox cbox1 = (CheckBox)GroupAuth_EGV.Rows[i].FindControl("chkSel1"); CheckBox cbox2 = (CheckBox)GroupAuth_EGV.Rows[i].FindControl("chkSel2"); CheckBox cbox3 = (CheckBox)GroupAuth_EGV.Rows[i].FindControl("chkSel3"); CheckBox cbox4 = (CheckBox)GroupAuth_EGV.Rows[i].FindControl("chkSel4"); CheckBox cbox5 = (CheckBox)GroupAuth_EGV.Rows[i].FindControl("chkSel5"); CheckBox cbox6 = (CheckBox)GroupAuth_EGV.Rows[i].FindControl("chkSel6"); CheckBox cbox7 = (CheckBox)GroupAuth_EGV.Rows[i].FindControl("chkSel11"); CheckBox cbox8 = (CheckBox)GroupAuth_EGV.Rows[i].FindControl("chkSel12"); M_UserPromotions ups = new M_UserPromotions(); ups.GroupID = Convert.ToInt32(GroupAuth_EGV.DataKeys[i].Value); if (cbox1.Checked) { ups.look = 1; } else { ups.look = 0; } if (cbox2.Checked) { ups.addTo = 1; } else { ups.addTo = 0; } if (cbox3.Checked) { ups.Modify = 1; } else { ups.Modify = 0; } if (cbox4.Checked) { ups.Deleted = 1; } else { ups.Deleted = 0; } if (cbox5.Checked) { ups.Columns = 1; } else { ups.Columns = 0; } if (cbox6.Checked) { ups.Comments = 1; } else { ups.Comments = 0; } if (cbox7.Checked) { ups.Down = 1; } else { ups.Down = 0; } if (cbox8.Checked) { ups.quote = 1; } else { ups.quote = 0; } ups.NodeID = NodeID; IsChild(ups); psll.GetInsertOrUpdate(ups); } #endregion function.WriteSuccessMsg("操作成功", "NodeManage.aspx"); }