public ActionResult ShowPubList() { M_CommonData mc = conBll.GetCommonData(DataConverter.CLng(Mid)); M_UserPromotions upsinfo = ups.GetSelect(mc.NodeID, mu.GroupID); if (upsinfo.pid != 0 && upsinfo.look != 1) { function.WriteErrMsg("您所在会员组无查看权限!"); return(Content("")); } DataTable FieldDt = this.mfBll.GetModelFieldList(mc.ModelID); DataRow DataDr = conBll.GetContentByItems(mc.TableName, mc.GeneralID).Rows[0]; DataTable newDt = new DataTable(); newDt.Columns.Add("Title"); newDt.Columns.Add("Content"); DataRow dr1 = newDt.NewRow(); dr1["Title"] = "ID"; dr1["Content"] = DataDr["GeneralID"]; newDt.Rows.Add(dr1); DataRow dr2 = newDt.NewRow(); dr2["Title"] = "标题"; dr2["Content"] = DataDr["Title"]; newDt.Rows.Add(dr2); foreach (DataRow dr in FieldDt.Rows) { DataRow row = newDt.NewRow(); row["Title"] = dr["FieldAlias"]; row["Content"] = DataDr[dr["FieldName"].ToString()]; newDt.Rows.Add(row); } return(View(newDt)); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (string.IsNullOrEmpty(Request.QueryString["NodeID"])) { //显示所有节点 } else { int nodeID = Convert.ToInt32(Request.QueryString["NodeID"].Trim()); //权限 promMod = promBll.GetSelect(nodeID, buser.GetLogin().GroupID); if (promMod != null) { if (promMod.addTo > 0) { addBtn.Visible = true; } if (promMod.Deleted > 0) { batDelBtn.Visible = true; } } } DataBind(); } }
/// <summary> ///更新记录 /// </summary> /// <param name="UserPromotions"></param> /// <returns></returns> public bool GetUpdate(M_UserPromotions model) { string sqlStr = "UPDATE [dbo].[ZL_UserPromotions] SET [GroupID] = @GroupID,[NodeID] = @NodeID,[ModelID] = @ModelID,[look] = @look,[addTo] = @addTo,[Modify] = @Modify,[Columns] = @Columns,[Comments] = @Comments,[Deleted]=@Deleted,[quote]=@quote,[down]=@quote WHERE [pid] = @pid"; SqlParameter[] cmdParams = model.GetParameters(); return(SqlHelper.ExecuteSql(sqlStr, cmdParams)); }
/// <summary> /// 从节点添加 /// </summary> /// <param name="userpromotions"></param> /// <returns></returns> public int GetInsertByNodeGroup(M_UserPromotions userpromotions) { string sqlStr = "INSERT INTO [dbo].[ZL_UserPromotions] ([GroupID],[NodeID],[look],[addTo],[Modify],[Columns],[Comments],[Deleted],[quote],[down]) VALUES (@GroupID,@NodeID,@look,@addTo,@Modify,@Columns,@Comments,@Deleted,@quote,@down);select @@IDENTITY"; SqlParameter[] cmdParams = userpromotions.GetParameters(); return(SqlHelper.ObjectToInt32(SqlHelper.ExecuteScalar(CommandType.Text, sqlStr, cmdParams))); }
/// <summary> /// 从节点更新 /// </summary> /// <param name="userpromotions"></param> /// <returns></returns> public bool GetUpdateByNodeGroup(M_UserPromotions userpromotions) { string sqlStr = "UPDATE [dbo].[ZL_UserPromotions] SET [look] = @look,[addTo] = @addTo,[Modify] = @Modify,[Columns] = @Columns,[Comments] = @Comments,[Deleted]=@Deleted,[quote]=@quote,[down]=@down WHERE [GroupID] = @GroupID and [NodeID] = @NodeID"; SqlParameter[] cmdParams = userpromotions.GetParameters(); return(SqlHelper.ExecuteSql(sqlStr, cmdParams)); }
/// <summary> /// 存在则更新,否则更新 /// </summary> /// <param name="userpromotions"></param> /// <returns></returns> public bool GetInsertOrUpdate(M_UserPromotions userpromotions) { string sqls = "Select count(*) from [dbo].[ZL_UserPromotions] where [GroupID] = @GroupID and [NodeID] = @NodeID"; SqlParameter[] cmdParams = userpromotions.GetParameters(); int Pcount = SqlHelper.ObjectToInt32(SqlHelper.ExecuteScalar(CommandType.Text, sqls, cmdParams)); if (Pcount > 0) { string sqlStr = "UPDATE [dbo].[ZL_UserPromotions] SET [look] = @look,[addTo] = @addTo,[Modify] = @Modify,[Columns] = @Columns,[Comments] = @Comments,[Deleted]=@Deleted,[quote]=@quote,[down]=@down WHERE [GroupID] = @GroupID and [NodeID] = @NodeID"; return(SqlHelper.ExecuteSql(sqlStr, cmdParams)); } else { string sqlStr = "INSERT INTO [dbo].[ZL_UserPromotions] ([GroupID],[NodeID],[look],[addTo],[Modify],[Columns],[Comments],[Deleted],[quote],[down]) VALUES (@GroupID,@NodeID,@look,@addTo,@Modify,@Columns,@Comments,@Deleted,@quote,@down);select @@IDENTITY"; return(SqlHelper.ObjectToInt32(SqlHelper.ExecuteScalar(CommandType.Text, sqlStr, cmdParams)) > 0); } }
protected void Del(string ID) { M_UserInfo infos = buser.GetLogin(); M_UserPromotions upsinfo = ups.GetSelect(NodeID, infos.GroupID); if (upsinfo.pid != 0) { if (upsinfo.Deleted != 1) { function.WriteErrMsg("您所在会员组无删除权限!"); } } string Id = ID; string title = this.bll.GetCommonData(DataConverter.CLng(Id)).Title; bll.SetDel(DataConverter.CLng(Id)); MyBind(); }
//将其父节点的浏览权限添加进去 protected void IsChild(M_UserPromotions ups) { M_UserPromotions upsMod = new M_UserPromotions(); int pid = nodeBll.GetNode(ups.NodeID).ParentID; if (pid > 0) { upsMod = psll.GetSelect(pid, ups.GroupID); if (upsMod == null) { return; } if (upsMod.look == 0) { upsMod.look = 1; upsMod.addTo = 1; psll.GetUpdate(upsMod); } IsChild(upsMod); } }
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"); }
protected void EBtnBacthSet_Click(object sender, EventArgs e) { for (int i = 0; i < this.LstNodes.Items.Count; i++) { if (!this.LstNodes.Items[i].Selected) { continue; } int nodetype = 0; //节点信息 int nodeid = DataConverter.CLng(this.LstNodes.Items[i].Value); M_Node node = nodeBll.GetNodeXML(nodeid); if (this.ChkOpenType.Checked) { node.OpenTypeTrue = this.RBLOpenType.SelectedValue; } if (this.ChkItemOpen.Checked) { node.ItemOpenTypeTrue = this.RBLItemOpenType.SelectedValue; } if (this.ChkPurview.Checked) { node.PurviewType = DataConverter.CBool(this.RBLPurviewType.SelectedValue); } if (this.ChkComment.Checked) { node.CommentType = this.RBLCommentType.SelectedValue; } if (this.ChkHits.Checked) { node.HitsOfHot = DataConverter.CLng(this.TxtHitsOfHot.Text); } if (this.Bat_isSimple_Chk.Checked) { node.Contribute = isSimple_CH.Checked ? 1 : 0; } if (this.Bat_SafeGuard_Chk.Checked) { node.SafeGuard = SafeGuard.Checked ? 1 : 0; } if (this.ChkClickTimeout.Checked) { node.ClickTimeout = DataConverter.CLng(this.ClickTimeout.Text); } if (this.ChkTemp.Checked) { node.ListTemplateFile = TxtTemplate_hid.Value; } if (this.ChkITemp.Checked) { node.IndexTemplate = TxtIndexTemplate_hid.Value; } if (this.Chk1Temp.Checked) { node.LastinfoTemplate = LastinfoTemplate_hid.Value; } if (this.Chk2Temp.Checked) { node.HotinfoTemplate = HotinfoTemplate_hid.Value; } if (this.Chk3Temp.Checked) { node.ProposeTemplate = ProposeTemplate_hid.Value; } if (this.ChkModelID.Checked) { string modellist = this.Page.Request.Form["ChkModel"]; node.ContentModel = modellist; string[] ModelArr = modellist.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); this.nodeBll.DelModelTemplate(node.NodeID, modellist); for (int j = 0; j < ModelArr.Length; j++) { if (bllmodel.GetModelById(DataConverter.CLng(ModelArr[j])).ModelType == 2) { if (nodetype == 1) { nodetype = 3; } else if (nodetype == 2) { nodetype = 2; } else { nodetype = 2; } if (nodetype == 5) { nodetype = 5; } } else if (bllmodel.GetModelById(DataConverter.CLng(ModelArr[j])).ModelType == 1) { if (nodetype == 5) { nodetype = 5; } else if (nodetype == 1) { nodetype = 1; } else if (nodetype == 2) { nodetype = 3; } else { nodetype = 1; } } else if (bllmodel.GetModelById(DataConverter.CLng(ModelArr[j])).ModelType == 5) { nodetype = 5; } if (!string.IsNullOrEmpty(this.Page.Request.Form["TxtModelTemplate_" + ModelArr[j]].Trim())) { //将模型模板设定写入数据库 string temp = this.Page.Request.Form["TxtModelTemplate_" + ModelArr[j]].Trim(); if (this.nodeBll.IsExistTemplate(node.NodeID, DataConverter.CLng(ModelArr[j]))) { this.nodeBll.UpdateModelTemplate(node.NodeID, DataConverter.CLng(ModelArr[j]), temp); } else { this.nodeBll.AddModelTemplate(node.NodeID, DataConverter.CLng(ModelArr[j]), temp); } } } node.NodeListType = nodetype; } if (this.ChkListEx.Checked) { node.ListPageHtmlEx = DataConverter.CLng(this.RBLListEx.SelectedValue); } if (this.ChkListPageEx.Checked) { node.ListPageEx = DataConverter.CLng(this.ListPageEx.SelectedValue); } if (this.ChkLastinfoPageEx.Checked) { node.LastinfoPageEx = DataConverter.CLng(this.LastinfoPageEx.SelectedValue); } if (this.ChkHotinfoPageEx.Checked) { node.HotinfoPageEx = DataConverter.CLng(this.HotinfoPageEx.SelectedValue); } if (this.ChkProposePageEx.Checked) { node.ProposePageEx = DataConverter.CLng(this.ProposePageEx.SelectedValue); } if (this.ChkContentEx.Checked) { node.ContentFileEx = DataConverter.CLng(this.RBLContentEx.SelectedValue); } if (this.ChkPosition.Checked) { node.HtmlPosition = DataConverter.CLng(this.RBLPosition.SelectedValue); } if (this.ChkContentRule.Checked) { node.ContentPageHtmlRule = DataConverter.CLng(this.DDLContentRule.SelectedValue); } if (this.ChkConsumePoint.Checked) { node.ConsumePoint = DataConverter.CLng(this.TxtConsumePoint.Text); } if (this.ChkPay.Checked) { this.TxtAddMoney.Text = node.AddMoney.ToString(); this.TxtAddPoint.Text = node.AddPoint.ToString(); this.txtAddExp.Text = node.AddUserExp.ToString(); } if (this.ChkDeducExp.Checked) { this.txtDeducExp.Text = node.DeducUserExp.ToString(); } if (this.ChConsumeType.Checked) { switch (node.ConsumeType) { case 0: this.Radio1.Checked = true; break; case 1: this.Radio2.Checked = true; break; case 2: this.Radio3.Checked = true; break; case 3: this.Radio4.Checked = true; break; case 4: this.Radio5.Checked = true; break; default: this.Radio6.Checked = true; break; } this.TxtConsumeCount.Text = node.ConsumeCount.ToString(); this.TxtConsumeTime.Text = node.ConsumeTime.ToString(); } if (this.ChkBGroup.Checked) { BGroup.DataSource = gpBll.GetGroupList(); BGroup.DataBind(); } if (this.ChkShares.Checked) { this.TxtShares.Text = node.Shares.ToString(); } #region 前台权限,需整理 if (this.ChkUserView.Checked) { DataTable auitdt = nodeBll.GetNodeAuitDT(); DataRow auitdr = auitdt.Rows[0]; auitdr["View"] = UserAuit_RadioList.SelectedValue; string ViewGroupvalue = ""; foreach (ListItem dd in this.ViewGroup.Items) { if (dd.Selected) { if (ViewGroupvalue != "") { ViewGroupvalue += ","; } ViewGroupvalue += dd.Value; } } auitdr["ViewGroup"] = ViewGroupvalue; string ViewGroup2value = ""; foreach (ListItem dd in this.ViewGroup2.Items) { if (dd.Selected) { if (ViewGroup2value != "") { ViewGroup2value += ","; } ViewGroup2value += dd.Value; } } auitdr["ViewSunGroup"] = ViewGroup2value; string ViewGroup3value = ""; foreach (ListItem dd in this.ViewGroup3.Items) { if (dd.Selected) { if (ViewGroup3value != "") { ViewGroup3value += ","; } ViewGroup3value += dd.Value; } } auitdr["input"] = ViewGroup3value; string forumvalue = ""; foreach (ListItem dd in this.forum.Items) { if (dd.Selected) { if (forumvalue != "") { forumvalue += ","; } forumvalue += dd.Value; } } auitdr["forum"] = forumvalue; node.Purview = JsonConvert.SerializeObject(auitdt); } #endregion this.nodeBll.UpdateNode(node); #region 角色 if (NodeRole.Checked) { DataTable nrDT = B_Role.SelectNodeRoleNode(nodeid); for (int ii = 0; ii <= Egv.Rows.Count - 1; ii++) { CheckBox cbox1 = (CheckBox)Egv.Rows[ii].FindControl("chkSel1"); CheckBox cbox2 = (CheckBox)Egv.Rows[ii].FindControl("chkSel2"); CheckBox cbox3 = (CheckBox)Egv.Rows[ii].FindControl("chkSel3"); CheckBox cbox4 = (CheckBox)Egv.Rows[ii].FindControl("chkSel4"); CheckBox cbox5 = (CheckBox)Egv.Rows[ii].FindControl("chkSel5"); CheckBox cbox6 = (CheckBox)Egv.Rows[ii].FindControl("chkSel6"); if (cbox1.Checked || cbox2.Checked || cbox3.Checked || cbox4.Checked || cbox5.Checked || cbox6.Checked) { M_NodeRole nr = bnll.SelModelByRidAndNid(nodeid, Convert.ToInt32(Egv.DataKeys[ii].Value)); if (nr == null) { nr = new M_NodeRole(); nr.NID = nodeid; nr.RID = Convert.ToInt32(Egv.DataKeys[ii].Value); } if (cbox1.Checked) { nr.look = 1; } else { nr.look = 0; } if (cbox2.Checked) { nr.Modify = 1; } else { nr.Modify = 0; } if (cbox3.Checked) { nr.State = 1; } else { nr.State = 0; } if (cbox4.Checked) { nr.addTo = 1; } else { nr.addTo = 0; } if (cbox5.Checked) { nr.Columns = 1; } else { nr.Columns = 0; } if (cbox6.Checked) { nr.Comments = 1; } else { nr.Comments = 0; } DataRow[] drs = nrDT.Select("Rid='" + nr.RID + "' And Nid='" + nodeid + "'"); if (drs != null && drs.Length > 0) { nr.RN_ID = Convert.ToInt32(drs[0]["RN_ID"]); } else { nr.RN_ID = 0; } bnll.InsertUpdate(nr); } else { DataTable nn = bnll.GetSelectNodeANDRid(nodeid, Egv.DataKeys[ii].Value + ""); if (nn != null && nn.Rows.Count > 0) { bnll.GetDelete(DataConverter.CLng(nn.Rows[0]["RN_ID"])); } } } } if (this.NodeURole.Checked) { for (int ij = 0; ij <= GridView1.Rows.Count - 1; ij++) { CheckBox cbox1 = (CheckBox)GridView1.Rows[ij].FindControl("chkSel1"); CheckBox cbox2 = (CheckBox)GridView1.Rows[ij].FindControl("chkSel2"); CheckBox cbox3 = (CheckBox)GridView1.Rows[ij].FindControl("chkSel3"); CheckBox cbox4 = (CheckBox)GridView1.Rows[ij].FindControl("chkSel4"); CheckBox cbox5 = (CheckBox)GridView1.Rows[ij].FindControl("chkSel5"); CheckBox cbox6 = (CheckBox)GridView1.Rows[ij].FindControl("chkSel6"); CheckBox cbox7 = (CheckBox)GridView1.Rows[ij].FindControl("chkSel11"); CheckBox cbox8 = (CheckBox)GridView1.Rows[ij].FindControl("chkSel12"); //HiddenField hd = (HiddenField)GridView1.Rows[i].FindControl("HiddenGroupID"); //if (cbox1.Checked || cbox2.Checked || cbox3.Checked || cbox4.Checked || cbox5.Checked || cbox6.Checked) //{ M_UserPromotions ups = new M_UserPromotions(); ups.GroupID = Convert.ToInt32(GridView1.DataKeys[ij].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 = DataConverter.CLng(nodeid); //ups.NodeID = DataConverter.CLng(this.HdnNodeID.Value); psll.GetInsertOrUpdate(ups); } } #endregion } function.WriteSuccessMsg("批量设置成功", customPath2 + "Content/NodeManage.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataTable table = cll.SelectByUserName(ull.GetLogin().UserName, ull.GetLogin().GroupID); DropDownList1.DataSource = table; DropDownList1.DataTextField = "Classname"; DropDownList1.DataValueField = "id"; DropDownList1.DataBind(); this.DropDownList1.Items.Insert(0, new ListItem("请选择分类", "")); this.UserInfo = buser.GetLogin(); if (string.IsNullOrEmpty(base.Request.QueryString["GeneralID"])) { function.WriteErrMsg("没有指定要修改的内容ID!"); } else { this.GeneralID = DataConverter.CLng(base.Request.QueryString["GeneralID"]); } M_CommonData Cdata = this.bll.GetCommonData(this.GeneralID); if (UserInfo.UserName != Cdata.Inputer) { function.WriteErrMsg("不能编辑不属于自己输入的内容!"); } this.NodeID = Cdata.NodeID; this.ModelID = Cdata.ModelID; DropDownList1.SelectedValue = Cdata.OrederClass.ToString(); if (bmode.GetModelById(this.ModelID).ModelType == 2) { string i = ""; DataTable dt = bpbll.ProductSearch(7, GeneralID.ToString()); if (dt.Rows.Count > 0) { i = dt.Rows[0]["ID"].ToString(); } Response.Redirect("addproduct.aspx?menu=edit&ID=" + i + "&ModelID=" + this.ModelID + "&NodeID=" + this.NodeID);//跳转到商城 } if (bmode.GetModelById(this.ModelID).ModelType == 5) { string i = ""; DataTable dt = butbll.ProductSearch(7, GeneralID.ToString(), buser.GetLogin().UserID); if (dt.Rows.Count > 0) { i = dt.Rows[0]["ID"].ToString(); } Response.Redirect("../UserShop/ProductAdd.aspx?menu=edit&ID=" + i + "&ModelID=" + this.ModelID + "&NodeID=" + this.NodeID);//跳转到店铺 } string ModelName = this.bmode.GetModelById(this.ModelID).ModelName; string NodeName = this.bnode.GetNodeXML(this.NodeID).NodeName; this.NodeName_L.Text = "修改" + NodeName; this.EBtnSubmit.Text += this.bmode.GetModelById(this.ModelID).ItemName; this.Label2.Text = NodeName; this.txtTitle.Text = Cdata.Title; this.TxtTagKey.Text = Cdata.TagKey; this.pronum.Text = Cdata.Pronum.ToString(); this.proweek.Text = Cdata.ProWeek.ToString(); this.BidType.SelectedValue = Cdata.BidType.ToString(); this.bidmoney.Text = Cdata.BidMoney.ToString("F2"); this.HdnItem.Value = this.GeneralID.ToString(); DataTable dtContent = this.bll.GetContent(this.GeneralID); this.ModelHtml.Text = this.bfield.GetUpdateHtmlUser(this.ModelID, NodeID, dtContent); DataSet ds = bfield.GetProModelFieldS(this.ModelID.ToString()); this.Title_L.Text = GetAlias("Title", ds.Tables[0]); } M_UserInfo infos = buser.GetLogin(); M_UserPromotions upsinfo = ups.GetSelect(this.NodeID, infos.GroupID); #region 权限 GetNodePreate(this.NodeID); #endregion }
/// <summary> ///添加记录 /// </summary> /// <param name="UserPromotions"></param> /// <returns></returns> public int GetInsert(M_UserPromotions model) { return(Sql.insert(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model))); }
/// <summary> ///添加记录 /// </summary> /// <param name="UserPromotions"></param> /// <returns></returns> public int GetInsert(M_UserPromotions model) { return(DBCenter.Insert(model)); }