protected void Page_Load(object sender, EventArgs e) { B_Admin badmin = new B_Admin(); if (!IsPostBack) { M_Pub pubinfo = pub.GetSelect(PubID); //string prowinfo = B_Role.GetPowerInfoByIDs(badmin.GetAdminLogin().RoleList); //if (!badmin.GetAdminLogin().RoleList.Contains(",1,") && !prowinfo.Contains("," + pubinfo.PubTableName + ",")) //{ // function.WriteErrMsg("无权限管理该互动信息!!"); //} string type = (Request.QueryString["type"] == null) ? "0" : Request.QueryString["type"].ToString(); //---------------------- PubName = pubinfo.PubName; string ModelID = (pubinfo.PubModelID == 0) ? "0" : pubinfo.PubModelID.ToString(); M_ModelInfo model = bmodel.GetModelById(DataConverter.CLng(ModelID)); this.HiddenNode.Value = ""; if (NodeID > 0) { this.HiddenNode.Value = "&nodeid=" + NodeID; } this.HdnModelID.Value = ModelID.ToString(); this.HiddenType.Value = type; this.ViewState["ModelID"] = ModelID.ToString(); this.ViewState["cType"] = "1"; DataBind(); } Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='" + CustomerPageAction.customPath2 + "Content/ContentManage.aspx'>内容管理</a></li><li><a href='" + Request.RawUrl + "'>互动模块管理</a></li><li class='active'>[" + PubName + "]互动信息</li>"); }
protected void Page_Load(object sender, EventArgs e) { ZoomLa.Common.function.AccessRulo(); B_Admin badmin = new B_Admin(); if (!this.Page.IsPostBack) { string Pubid = string.IsNullOrEmpty(Request.QueryString["Pubid"]) ? "0" : Request.QueryString["Pubid"].ToString(); pubMod = bpub.SelReturnModel(DataConverter.CLng(Pubid)); string prowinfo = B_Role.GetPowerInfoByIDs(badmin.GetAdminLogin().RoleList); if (!badmin.GetAdminLogin().RoleList.Contains(",1,") && !prowinfo.Contains("," + pubMod.PubTableName + ",")) { function.WriteErrMsg("无权限管理该互动信息!!"); } string Parentid = string.IsNullOrEmpty(Request.QueryString["Parentid"]) ? "0" : Request.QueryString["Parentid"].ToString(); int ModelID = DataConverter.CLng(bpub.GetSelect(DataConverter.CLng(Pubid)).PubModelID.ToString()); this.HdnType.Value = string.IsNullOrEmpty(Request.QueryString["small"]) ? null : Request.QueryString["small"].ToString(); if (DataConverter.CLng(Pubid) <= 0 || DataConverter.CLng(Parentid) <= 0) { function.WriteErrMsg("缺少用户参数!"); } //jc:查找相应模版实体 M_ModelInfo model = bmodel.GetModelById(ModelID); this.HdnPubid.Value = Pubid; this.HiddenParentid.Value = Parentid; this.HdnModel.Value = ModelID.ToString(); int ID = string.IsNullOrEmpty(Request.QueryString["ID"]) ? 0 : DataConverter.CLng(Request.QueryString["ID"]); this.HdnID.Value = ID.ToString(); this.LblModelName.Text = "回复" + model.ItemName; string Html = bfield.InputallHtml(ModelID, 0, new ModelConfig()); //GetPubModelHtmlall ModelHtml.Text = Html; /////////// DataTable UserData = new DataTable(); DataTable aas = ShowGrid(); int zong = aas == null ? 0 : aas.Rows.Count; int sID = string.IsNullOrEmpty(Request.QueryString["Parentid"]) ? 0 : DataConverter.CLng(Request.QueryString["Parentid"]); UserData = buser.GetUserModeInfo(model.TableName, sID, 18); DetailsView1.DataSource = UserData.DefaultView; DetailsView1.DataBind(); ////////////// Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='pubmanage.aspx'>互动管理</a></li><li>添加信息</li>"); } }
public int Pub_Del(string ids) { //if (conBll.DelByIDS(ids)) { return 1; } else { return 0; } int mid = Convert.ToInt32(ids.Split(':')[0]); int pid = Convert.ToInt32(ids.Split(':')[1]); M_Pub pinfos = pubBll.GetSelect(pid); if (pubBll.DeleteModel(pinfos.PubTableName, "ID='" + mid + "'")) { return(1); } else { return(0); } }
protected void Page_Load(object sender, EventArgs e) { function.AccessRulo(); B_Admin badmin = new B_Admin(); if (!this.IsPostBack) { int pubid = DataConverter.CLng(Request.QueryString["Pubid"]); ViewState["pubid"] = pubid.ToString(); M_Pub pubinfo = pub.GetSelect(pubid); string prowinfo = B_Role.GetPowerInfoByIDs(badmin.GetAdminLogin().RoleList); if (!badmin.GetAdminLogin().RoleList.Contains(",1,") && !prowinfo.Contains("," + pubinfo.PubTableName + ",")) { function.WriteErrMsg("无权限管理该互动模型!!"); } string ModelID = (pubinfo.PubModelID == 0) ? "0" : pubinfo.PubModelID.ToString(); if (DataConverter.CLng(ModelID) <= 0) { function.WriteErrMsg("无模块信息"); } int ID = string.IsNullOrEmpty(Request.QueryString["ID"]) ? 0 : DataConverter.CLng(Request.QueryString["ID"]); this.HdnID.Value = ID.ToString(); string type = (Request.QueryString["type"] == null) ? "0" : Request.QueryString["type"].ToString(); M_ModelInfo model = bmodel.GetModelById(DataConverter.CLng(ModelID)); this.HdnModelID.Value = ModelID.ToString(); this.HiddenType.Value = type; this.HiddenPubid.Value = pubid.ToString(); this.ViewState["ModelID"] = ModelID.ToString(); this.ViewState["cType"] = "1"; RepNodeBind(); int nodeid = (Request.QueryString["nodeid"] == null) ? 0 : DataConverter.CLng(Request.QueryString["nodeid"]); this.HiddenNode.Value = ""; if (nodeid == 0) { Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='pubmanage.aspx'>互动管理</a></li><li><a href='AddPub.aspx?Parentid=" + this.HdnID.Value + "&Pubid=" + this.HiddenPubid.Value + "' style='color:red;'>[添加回复]</a></li>"); } else { B_Node bbn = new B_Node(); M_Node nn = bbn.GetNodeXML(nodeid); Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='pubmanage.aspx'>互动管理</a></li><li><a href='Pubsinfo.aspx?nodeid=" + nodeid + "&Pubid=" + this.HiddenPubid.Value + "' style='color:red;'>" + nn.NodeName + "</a></li>"); this.HiddenNode.Value = "&nodeid=" + nodeid; } //this.Label1.Text = "<a href='AddPub.aspx?Parentid=" + this.HdnID.Value + "&Pubid=" + this.HiddenPubid.Value + "'>[ 添加回复 ]</a>"; } }
protected void Page_Load(object sender, EventArgs e) { function.AccessRulo(); B_Admin badmin = new B_Admin(); badmin.CheckIsLogin(); if (!this.Page.IsPostBack) { string Pubid = string.IsNullOrEmpty(Request.QueryString["Pubid"].ToString()) ? "0" : Request.QueryString["Pubid"].ToString(); pubMod = pubBll.SelReturnModel(DataConverter.CLng(Pubid)); string prowinfo = B_Role.GetPowerInfoByIDs(badmin.GetAdminLogin().RoleList); if (!badmin.GetAdminLogin().RoleList.Contains(",1,") && !prowinfo.Contains("," + pubMod.PubTableName + ",")) { function.WriteErrMsg("无权限管理该互动模型!!"); } string ModelID = bpub.GetSelect(DataConverter.CLng(Pubid)).PubModelID.ToString(); // int ModelID = string.IsNullOrEmpty(Request.QueryString["ModelID"]) ? 0 : DataConverter.CLng(Request.QueryString["ModelID"]); this.HiddenPubid.Value = Pubid; if (DataConverter.CLng(ModelID) <= 0) { function.WriteErrMsg("缺少用户模型ID参数!"); } //jc:查找相应模版实体 // M_ModelInfo model = bmodel.GetModelById(ModelID); string small = string.IsNullOrEmpty(Request.QueryString["small"]) ? "0" : Request.QueryString["small"].ToString(); this.HiddenSmall.Value = small; this.HdnModelID.Value = ModelID; M_ModelInfo model = bmodel.GetModelById(DataConverter.CLng(ModelID)); int ID = string.IsNullOrEmpty(Request.QueryString["ID"]) ? 0 : DataConverter.CLng(Request.QueryString["ID"]); this.HiddenID.Value = ID.ToString(); ViewState["ID"] = ID.ToString(); if (ID < 0) { function.WriteErrMsg("缺少ID参数!"); } DataTable UserData = new DataTable(); DataTable aas = ShowGrid(); int zong = aas.Rows.Count; UserData = buser.GetUserModeInfo(model.TableName, ID, 18); this.ptit.Text = UserData.Rows[0]["PubTitle"].ToString(); DetailsView1.DataSource = UserData.DefaultView; DetailsView1.DataBind(); Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='pubmanage.aspx'>互动管理</a></li> <li><a href='Pubsinfo.aspx?Pubid=" + Pubid + "&type=0'>互动信息管理</a></li><li>互动信息</li>"); } }
public ActionResult PubView() { int TopID = DataConverter.CLng(Request["menu"]); int PubID = DataConverter.CLng(Request["pubid"]); string Small = Request["small"] ?? ""; int ID = DataConverter.CLng(Request["ID"]); if (ID <= 0) { function.WriteErrMsg("缺少ID参数"); return(Content("")); } M_Pub pubMod = pubBll.GetSelect(PubID); int ModelID = pubMod == null ? 0 : pubMod.PubModelID; if (ModelID <= 0) { function.WriteErrMsg("缺少用户模型ID参数!"); return(Content("")); } M_ModelInfo model = modBll.GetModelById(DataConverter.CLng(ModelID)); DataTable DataDt = buser.GetUserModeInfo(model.TableName, ID, 18); DataTable newDt = new DataTable(); if (DataDt.Rows.Count > 0) { DataRow DataDr = DataDt.Rows[0]; DataTable FieldDt = fieldBll.GetModelFieldList(ModelID); newDt.Columns.Add("Title"); newDt.Columns.Add("Content"); DataRow dr1 = newDt.NewRow(); dr1["Title"] = "ID"; dr1["Content"] = DataDr["ID"]; newDt.Rows.Add(dr1); DataRow dr2 = newDt.NewRow(); dr2["Title"] = "用户名"; dr2["Content"] = DataDr["PubUserName"]; newDt.Rows.Add(dr2); DataRow dr3 = newDt.NewRow(); dr3["Title"] = "标题"; dr3["Content"] = DataDr["PubTitle"]; newDt.Rows.Add(dr3); DataRow dr4 = newDt.NewRow(); dr4["Title"] = "内容"; dr4["Content"] = DataDr["PubContent"]; newDt.Rows.Add(dr4); DataRow dr5 = newDt.NewRow(); dr5["Title"] = "IP地址"; dr5["Content"] = DataDr["PubIP"]; newDt.Rows.Add(dr5); DataRow dr6 = newDt.NewRow(); dr6["Title"] = "添加时间"; dr6["Content"] = DataDr["PubAddTime"]; newDt.Rows.Add(dr6); foreach (DataRow dr in FieldDt.Rows) { DataRow row = newDt.NewRow(); row["Title"] = dr["FieldAlias"]; row["Content"] = DataDr[dr["FieldName"].ToString()]; newDt.Rows.Add(row); } } ViewBag.Details = newDt; ViewBag.ReturnUrl = Small.ToLower().Equals("small") ? "ViewSmallPub?pubid=" + PubID + "&ID=" + TopID : "ViewPub?pubid=" + PubID; ViewBag.AddUrl = "AddPub?Pubid=" + PubID + "&Parentid=" + ID; return(View()); }
public ActionResult ShowPub() { GID = DataConverter.CLng(Request["ID"]); PubID = DataConverter.CLng(Request["pid"]); string menu = Request["menu"] ?? ""; string Optimal = Request["Optimal"] ?? ""; M_Pub pubMod = pubBll.GetSelect(PubID); if (pubMod != null) { switch (menu) { case "setinfo": { if (Optimal.Equals("0")) { pubBll.UpdatePubModelByOptimal(pubMod.PubTableName, GID); pubBll.UpdatePubModelById(pubMod.PubTableName, PubID); } else if (Optimal.Equals("1")) { pubBll.UpdatePubModelOptimal(pubMod.PubTableName, PubID); } } break; case "setdb": { if (Optimal.Equals("0")) { pubBll.Getdb(pubMod.PubTableName, GID); } else if (Optimal.Equals("2")) { pubBll.UpdatePubModelOptimal(pubMod.PubTableName, GID); } } break; case "setnodb": { if (Optimal.Equals("0")) { pubBll.Getnodb(pubMod.PubTableName, DataConverter.CLng(Request.QueryString["GID"])); } else if (Optimal.Equals("-1")) { pubBll.UpdatePubModelOptimal(pubMod.PubTableName, DataConverter.CLng(Request.QueryString["GID"])); } } break; } } M_CommonData comMod = conBll.GetCommonData(GID); int ModelID = comMod.ModelID; bool IsLoginUser = comMod.Inputer.Equals(mu.UserName); //列表数据 //PageSetting setting = IsLoginUser ? pubBll.SelPage(CPage, PSize, 0, GID, "", pubMod.PubTableName) : pubBll.SelPage(CPage, PSize, 0, GID, mu.UserName, pubMod.PubTableName); PageSetting setting = null; //详情数据 DataRow DataDr = conBll.GetContentByItems(comMod.TableName, comMod.GeneralID).Rows[0]; //要显示的数据 DataTable FieldDt = mfBll.GetModelFieldList(ModelID); //要显示的字段列表 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); } ViewBag.Details = newDt; ViewBag.IsLoginUser = IsLoginUser; PubTable = pubMod.PubTableName; return(View(setting)); }
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 Page_Load(object sender, EventArgs e) { if (Pid <= 0) { function.WriteErrMsg("参数错误!不存在此信息!"); } M_Pub mpub = pubBll.GetSelect(Pid); mu = buser.GetLogin(); if (mpub == null || mpub.Pubid < 1) { function.WriteErrMsg("互动信息不存在"); } M_APIResult retMod = new M_APIResult(); int spid = DataConvert.CLng(Request.Form["spfbrid"]); if (mu.UserID < 1) { retMod.retmsg = "未登录不可提交订单"; RepToClient(retMod.ToString()); return; } if (spid < 1) { retMod.retmsg = "未指定教师信息"; RepToClient(retMod.ToString()); return; } { //如果存在与该老师的进行中订单,则忽略 string where = "xsrid=" + mu.UserID + " AND spfbrid=" + spid; where += " AND status_order>=0 AND status_order<100"; if (DBCenter.IsExist("ZL_Pub_dsmx", where)) { retMod.retmsg = "已存在生效中的订单"; RepToClient(retMod.ToString()); return; } } M_UserInfo spmu = buser.SelReturnModel(spid); if (spmu.IsNull) { retMod.retmsg = "老师信息不存在"; RepToClient(retMod.ToString()); return; } //-----------------------获取用户提交的数据 //隐藏字段值 int PubContentid = DataConverter.CLng(Request.Form["PubContentid"]); int Parentid = DataConvert.CLng(Request.Form["Parentid"]); //用户提交 string pbtitle = Server.HtmlEncode(DataConvert.CStr(Request.Form["PubTitle"])); string pbcontent = Server.HtmlEncode(DataConvert.CStr(Request.Form["PubContent"])); if (!pbtitle.Contains("的"))//xxx的课程 { pbtitle = B_User.GetUserName(spmu.HoneyName, spmu.UserName) + "的课程"; } //-----------------------可提交判断 List <SqlParameter> sp = new List <SqlParameter>(); //-----------------------初始化参数 //删除超过保留期限的值 //pubBll.DeleteModel(mpub.PubTableName, "DateDiff(d,PubAddTime,getdate())>" + mpub.Pubkeep); //ModelField表中仅存了自定义的字段 B_CodeModel codeBll = new B_CodeModel(mpub.PubTableName); DataRow dr = codeBll.NewModel(); DataTable mfDT = mfBll.DB_SelByModel(mpub.PubModelID); mfDT.DefaultView.RowFilter = "sys_type=0"; mfDT = mfDT.DefaultView.ToTable(); //-----固定的系统字段 dr["Pubnum"] = 1; dr["PubIP"] = EnviorHelper.GetUserIP(); dr["PubUserID"] = mu.UserID; dr["PubUserName"] = mu.UserName; dr["Pubupid"] = mpub.Pubid; dr["PubAddTime"] = DateTime.Now; dr["Parentid"] = Parentid; dr["PubTitle"] = pbtitle; dr["PubContent"] = pbcontent; dr["Pubstart"] = mpub.PubIsTrue == 1 ? 0 : 1;//取反 dr["PubInputer"] = B_User.GetUserName(mu.HoneyName, mu.UserName); dr["PubContentid"] = PubContentid; //dr["cookflag"] = CookFlag; //=========订单初始化 dr["status_order"] = 0; dr["status_user"] = 0; dr["status_teacher"] = 0; dr["status_money"] = 0; dr["edate"] = ""; dr["fcAmount"] = 0; dr["fcDate"] = ""; //int djid = DataConvert.CLng(mu.ParentUserID); //if (djid < 1) { djid = DataConvert.CLng(Request["djid"]); } dr["djid"] = DataConvert.CLng(Request["djid"]); //------非系统字段 for (int i = 0; i < mfDT.Rows.Count; i++) { M_ModelField mfMod = new M_ModelField().GetModelFromReader(mfDT.Rows[i]); string value = Server.HtmlEncode(Request.Form[mfMod.FieldName] ?? ""); Parentid = DataConvert.CLng(Request.Form["Parentid"]); if (mfMod.IsNotNull && string.IsNullOrEmpty(value)) { RepToClient(mfMod.FieldName + "不能为空"); } dr[mfMod.FieldName] = value; switch (mpub.PubType) { #region 根据互动类型,进行空值判断 case 0: if (string.IsNullOrEmpty(pbcontent)) { RepToClient("评论内容不能为空!"); } break; case 1: if (string.IsNullOrEmpty(pbtitle)) { RepToClient("标题不能为空!"); } break; case 2: if (string.IsNullOrEmpty(pbtitle)) { RepToClient("标题不能为空!"); } if (string.IsNullOrEmpty(pbcontent)) { RepToClient("活动信息不能为空!"); } break; case 3: if (string.IsNullOrEmpty(pbtitle) || string.IsNullOrEmpty(pbcontent)) { RepToClient("标题与内容不能为空!"); } break; case 4: if (string.IsNullOrEmpty(pbtitle)) { RepToClient("标题不能为空!"); } break; case 5: break; case 7: //将评星控件的数据写入数据表中 dr["PubContent"] = Request.Params["scoreVal"]; break; case 8: //互动表单 break; #endregion } } codeBll.Insert(dr); retMod.retcode = M_APIResult.Success; RepToClient(retMod.ToString()); //Upaddnums(mpub); //更新总参与人数 }
//提交 protected void Submit_B_Click(object sender, EventArgs e) { M_Pub pubMod = new M_Pub(); bool addtrue = true; #region 验证模块 if (Mid < 1) { DataTable tempinfo = pubBll.SelByName(PubName.Text); if (tempinfo.Rows.Count > 0) { addtrue = false; function.WriteErrMsg("已存在此互动模块!请更换模块名称再试!!"); } DataTable PubInputLoadStrtable = pubBll.SelBy("", "PubInputLoadStr.Text", Mid.ToString()); if (PubInputLoadStrtable.Rows.Count > 0) { addtrue = false; function.WriteErrMsg("已经存在此提交标签!"); } DataTable PubLoadstrtable = pubBll.SelBy(PubLoadstr.Text, "", Mid.ToString()); if (PubLoadstrtable.Rows.Count > 0) { addtrue = false; function.WriteErrMsg("已经存在此互动标签!"); } } #endregion if (addtrue) { if (Mid > 0) { pubMod = pubBll.SelReturnModel(Mid); if (Menu.Equals("copy")) { pubMod.Pubid = 0; } } pubMod.PubAddnum = 0; pubMod.PubCreateTime = DateTime.Now; pubMod.PubBindPub = 0; pubMod.PubClass = DataConverter.CLng(this.PubClass.SelectedValue); pubMod.PubCode = PubCode.Checked ? 1 : 0; //界面处理显示结束时间,如果是最大则不显示 if (!string.IsNullOrEmpty(this.PubEndTime.Text)) { pubMod.PubEndTime = DataConverter.CDate(this.PubEndTime.Text.Replace("/", "-")); } else { pubMod.PubEndTime = DateTime.MaxValue; } pubMod.PubInputLoadStr = PubInputLoadStr.Text; pubMod.PubType = DataConverter.CLng(this.PubType.SelectedValue); pubMod.PubNodeID = ""; pubMod.PubTemplateID = ""; pubMod.PubIsDel = 0; pubMod.PubIsTrue = PubIsTrue.Checked ? 1 : 0; pubMod.PubLoadstr = PubLoadstr.Text; pubMod.PubLogin = PubLogin.Checked ? 1 : 0; pubMod.PubLoginUrl = PubLoginUrl.Text; pubMod.PubTableName = "ZL_Pub_" + PubTableName.Text; pubMod.PubName = PubName.Text; pubMod.PubOpenComment = PubOpenComment.Checked ? 1 : 0; pubMod.PubShowType = DataConverter.CLng(this.PubShowType.SelectedValue); //pubMod.PubTimeSlot = CookieNum_Rad.SelectedValue.Equals("0") ? 0 : DataConverter.CLng(CookieNum_T.Text); pubMod.Pubkeep = DataConverter.CLng(this.Pubkeep.Text); pubMod.PubInputTM = ""; pubMod.PubTemplate = ""; pubMod.Puberrmsg = Puberrmsg.Text; pubMod.PubFlag = pubflag.Checked ? 1 : 0; string perm = ""; if (CheckBox1.Checked) { perm += "Look"; } if (CheckBox2.Checked) { perm += ",Edit"; } if (CheckBox3.Checked) { perm += ",Del"; } if (CheckBox4.Checked) { perm += ",Sen"; } pubMod.PubPermissions = perm; pubMod.PubGourl = PubGourl.Text; pubMod.Public = RaPublic.Checked ? 1 : 0; //设置限制用户提交数量 if (this.PubOneOrMore.SelectedValue == "2") { pubMod.PubOneOrMore = DataConverter.CLng(this.PubOneOrMorenum.Text); } else { pubMod.PubOneOrMore = DataConverter.CLng(this.PubOneOrMore.SelectedValue); } //设置限制IP提交数量 if (this.PubIPOneOrMore.SelectedValue == "2") { pubMod.PubIPOneOrMore = DataConverter.CLng(this.PubIPOneOrMorenum.Text); } else { pubMod.PubIPOneOrMore = DataConverter.CLng(this.PubIPOneOrMore.SelectedValue); } pubMod.Interval = DataConverter.CLng(Interval_T.Text); string strPath = ""; string strPathname = ""; string PubInputTMurl = ""; string Tempinputstr = @""; //模型ID if (pubMod.Pubid == 0) { pubMod.PubModelID = pubBll.CreateModelInfo(pubMod);//建立数据表与模型Field,Model int Pubinsertid = pubBll.GetInsert(pubMod); #region 创建互动模板 string PubTemplateurl = ""; string Tmpstr = ""; M_Label lab = new M_Label(); B_Label blab = new B_Label(); lab.LabelAddUser = badmin.GetAdminLogin().AdminId; string getstr = ""; switch (pubMod.PubClass) { //0-内容 1-商城 2-黄页 3-店铺 4-会员 case 0: getstr = "ID"; break; case 1: getstr = "ID"; break; case 2: getstr = "Pageid"; break; case 3: getstr = "id"; break; case 4: getstr = "Userid"; break; case 5: getstr = "Nodeid"; break; case 6: getstr = ""; break; default: getstr = "ID"; break; } string pubcontdid = "-1"; if (pubMod.PubClass != 6) { pubcontdid = "{$GetRequest(" + getstr + ")$}"; } //创建标签 switch (pubMod.PubType) { case 0: //评论 //创建源标签 lab.LableName = pubMod.PubName + "调用标签"; lab.LabelCate = "互动标签"; lab.LableType = 4; lab.LabelTable = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid"; lab.LabelField = "" + pubMod.PubTableName + ".*,ZL_Pub.*"; lab.LabelWhere = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1"; lab.Param = ""; lab.LabelOrder = "" + pubMod.PubTableName + ".ID DESC"; lab.LabelCount = "10"; lab.Content = "{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n评论说明:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n评论时间:{Field=\"PubAddTime\"/}<br />{/Repeate}<br />\n{ZL.Page/}"; lab.Desc = pubMod.PubTableName + "分页标签"; lab.LabelNodeID = 0; blab.AddLabelXML(lab); Tmpstr = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}"; strPath = "默认评论" + pubMod.PubName + "模板.html"; strPathname = "默认评论" + pubMod.PubName + "模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; strPath = strPath.Replace("/", @"\"); FileSystemObject.WriteFile(strPath, Tmpstr); break; case 1: //投票 //创建标签 lab.LableName = pubMod.PubName + "调用标签"; lab.LabelCate = "互动标签"; lab.LableType = 4; lab.LabelTable = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid"; lab.LabelField = "" + pubMod.PubTableName + ".*,ZL_Pub.*"; lab.LabelWhere = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1"; lab.Param = ""; lab.LabelOrder = "" + pubMod.PubTableName + ".ID DESC"; lab.LabelCount = "10"; lab.Content = "{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n投票说明:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n投票时间:{Field=\"PubAddTime\"/}<br />{/Repeate}<br />\n{ZL.Page/}"; lab.Desc = pubMod.PubTableName + "分页标签"; lab.LabelNodeID = 0; blab.AddLabelXML(lab); Tmpstr = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}"; strPath = "默认投票" + pubMod.PubName + "模板.html"; strPathname = "默认投票" + pubMod.PubName + "模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; break; case 2: //活动 lab.LableName = pubMod.PubName + "调用标签"; lab.LabelCate = "互动标签"; lab.LableType = 4; lab.LabelTable = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid"; lab.LabelField = "" + pubMod.PubTableName + ".*,ZL_Pub.*"; lab.LabelWhere = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1"; lab.Param = ""; lab.LabelOrder = "" + pubMod.PubTableName + ".ID DESC"; lab.LabelCount = "10"; lab.Content = "<a href=PubAction.aspx?menu=hd&act=add&Pubid=" + Pubinsertid.ToString() + ">发起活动</a>\n{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n活动内容:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n提交时间:{Field=\"PubAddTime\"/}\n{/Repeate}<br />\n{ZL.Page/}"; lab.Desc = pubMod.PubTableName + "分页标签"; lab.LabelNodeID = 0; blab.AddLabelXML(lab); Tmpstr = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}"; strPath = "默认活动" + pubMod.PubName + "模板.html"; strPathname = "默认活动" + pubMod.PubName + "模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; break; case 3: //留言 lab.LableName = pubMod.PubName + "调用标签"; lab.LabelCate = "互动标签"; lab.LableType = 4; lab.LabelTable = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid"; lab.LabelField = "" + pubMod.PubTableName + ".*,ZL_Pub.*"; lab.LabelWhere = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1"; lab.Param = ""; lab.LabelOrder = "" + pubMod.PubTableName + ".ID DESC"; lab.LabelCount = "10"; lab.Content = "{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n留言内容:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n提交时间:{Field=\"PubAddTime\"/}\n{/Repeate}<br />\n{ZL.Page/}"; lab.Desc = pubMod.PubTableName + "分页标签"; lab.LabelNodeID = 0; blab.AddLabelXML(lab); Tmpstr = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}"; strPath = "默认留言" + pubMod.PubName + "模板.html"; strPathname = "默认留言" + pubMod.PubName + "模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; break; case 4: //问券 lab.LableName = pubMod.PubName + "调用标签"; lab.LabelCate = "互动标签"; lab.LableType = 4; lab.LabelTable = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid"; lab.LabelField = "" + pubMod.PubTableName + ".*,ZL_Pub.*"; lab.LabelWhere = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1"; lab.Param = ""; lab.LabelOrder = "" + pubMod.PubTableName + ".ID DESC"; lab.LabelCount = "10"; lab.Content = "{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n问券内容:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n提交时间:{Field=\"PubAddTime\"/}\n{/Repeate}<br />\n{ZL.Page/}<br />"; lab.Desc = pubMod.PubTableName + "分页标签"; lab.LabelNodeID = 0; blab.AddLabelXML(lab); Tmpstr = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}"; strPath = "默认问券" + pubMod.PubName + "模板.html"; strPathname = "默认问券" + pubMod.PubName + "模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; break; case 5: //统计 lab.LableName = pubMod.PubName + "调用标签"; lab.LabelCate = "互动标签"; lab.LableType = 2; lab.LabelTable = pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid"; lab.LabelField = pubMod.PubTableName + ".*,ZL_Pub.*"; lab.LabelWhere = pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " and Parentid=0 And " + pubMod.PubTableName + ".Pubstart=1"; lab.Param = ""; lab.LabelOrder = pubMod.PubTableName + ".ID DESC"; lab.LabelCount = "10"; lab.Content = "点击数:{Field=\"Pubnum\"/}"; lab.Desc = pubMod.PubTableName + "动态标签"; lab.LabelNodeID = 0; blab.AddLabelXML(lab); Tmpstr = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}"; strPath = "默认统计" + pubMod.PubName + "模板.html"; strPathname = "默认统计" + pubMod.PubName + "模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; break; case 6: //竞标 //创建标签 lab.LableName = pubMod.PubName + "调用标签"; lab.LabelCate = "互动标签"; lab.LableType = 4; lab.LabelTable = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid"; lab.LabelField = "" + pubMod.PubTableName + ".*,ZL_Pub.*"; lab.LabelWhere = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1"; lab.Param = ""; lab.LabelOrder = "" + pubMod.PubTableName + ".ID DESC"; lab.LabelCount = "10"; lab.Content = "{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n竞标说明:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n竞标时间:{Field=\"PubAddTime\"/}<br />{/Repeate}<br />\n{ZL.Page/}"; lab.Desc = pubMod.PubTableName + "分页标签"; lab.LabelNodeID = 0; blab.AddLabelXML(lab); Tmpstr = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}"; strPath = "默认竞标" + pubMod.PubName + "模板.html"; strPathname = "默认竞标" + pubMod.PubName + "模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; break; case 7: lab.LableName = pubMod.PubName + "调用标签"; lab.LabelCate = "互动标签"; lab.LableType = 1; lab.LabelTable = ""; lab.LabelField = ""; lab.LabelWhere = ""; lab.Param = ""; lab.LabelOrder = ""; lab.LabelCount = "10"; if (string.IsNullOrEmpty(starOPT.Text.Trim())) { function.WriteErrMsg("选项不能为空!!"); } string[] starOP = starOPT.Text.Trim().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); lab.Content = GetContent(starOP, Pubinsertid); lab.Desc = pubMod.PubTableName + "分页标签"; lab.LabelNodeID = 0; blab.AddLabelXML(lab); Tmpstr = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + PubInputLoadStr.Text + "/}"; strPath = "评星" + pubMod.PubName + "模板.html"; strPathname = "评星" + pubMod.PubName + "模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; break; case 8: break; default: function.WriteErrMsg("类型错误,该类型不存在!!!"); break; } strPath = strPath.Replace("/", @"\"); if (!string.IsNullOrEmpty(strPath)) { FileSystemObject.WriteFile(strPath, Tmpstr); } PubTemplateurl = "/互动模板/" + strPathname; #endregion #region 创建互动提交模板 switch (pubMod.PubType) { case 0: //评论 Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction.aspx""> <input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" /> <input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" /> <input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" /> <div class=""form-group""> <label for=""PubTitle"">评论标题:</label> <input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" />{PubCode/} </div> <div class=""form-group""> <label for=""PubContent"">评论内容:</label> <textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea> </div> <div class=""form-group text-center""> <button type=""submit"" class=""btn btn-default"">提交</button> <button type=""reset"" class=""btn btn-default"">重置</button> </div> </form>"; Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString()); strPath = "默认评论" + pubMod.PubName + "提交模板.html"; strPathname = "默认评论" + pubMod.PubName + "提交模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; break; case 1: //投票 Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction.aspx""> <input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" /> <input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" /> <input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" /> <div class=""form-group""> <label for=""PubTitle"">投票标题:</label> <input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" /> {PubCode/} </div> <div class=""form-group""> <label for=""PubContent"">投票内容:</label> <textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea> </div> <div class=""form-group text-center""> <button type=""submit"" class=""btn btn-default"">提交</button> <button type=""reset"" class=""btn btn-default"">重置</button> </div> </form>"; Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString()); strPath = "默认投票" + pubMod.PubName + "提交模板.html"; strPathname = "默认投票" + pubMod.PubName + "提交模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; break; case 2: //活动 Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction.aspx""> <input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" /> <input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" /> <input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" /> <div class=""form-group""> <label for=""PubTitle"">活动标题:</label> <input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" /> {PubCode/} </div> <div class=""form-group""> <label for=""PubContent"">活动内容:</label> <textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea> </div> <div class=""form-group text-center""> <button type=""submit"" class=""btn btn-default"">提交</button> <button type=""reset"" class=""btn btn-default"">重置</button> </div> </form>"; Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString()); strPath = "默认活动" + pubMod.PubName + "提交模板.html"; strPathname = "默认活动" + pubMod.PubName + "提交模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; break; case 3: //留言 Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction.aspx""> <input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" /> <input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" /> <input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" /> <div class=""form-group""> <label for=""PubTitle"">留言标题:</label> <input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" /> {PubCode/} </div> <div class=""form-group""> <label for=""PubContent"">留言内容:</label> <textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea> </div> <div class=""form-group text-center""> <button type=""submit"" class=""btn btn-default"">提交</button> <button type=""reset"" class=""btn btn-default"">重置</button> </div> </form>"; Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString()); strPath = "默认留言" + pubMod.PubName + "提交模板.html"; strPathname = "默认留言" + pubMod.PubName + "提交模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; break; case 4: //问券 Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction.aspx""> <input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" /> <input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" /> <input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" /> <div class=""form-group""> <label for=""PubTitle"">问券标题:</label> <input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" /> {PubCode/} </div> <div class=""form-group""> <label for=""PubContent"">问券内容:</label> <textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea> </div> <div class=""form-group text-center""> <button type=""submit"" class=""btn btn-default"">提交</button> <button type=""reset"" class=""btn btn-default"">重置</button> </div> </form>"; Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString()); strPath = "默认问券" + pubMod.PubName + "提交模板.html"; strPathname = "默认问券" + pubMod.PubName + "提交模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; break; case 5: //统计 Tempinputstr = @"<a href=/PubAction.aspx?pubid=" + Pubinsertid + "&PubContentid={PubContentid/}>通过链接提交</a>"; strPath = "默认统计" + pubMod.PubName + "提交模板.html"; strPathname = "默认统计" + pubMod.PubName + "提交模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; break; case 6: //竞标 Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction.aspx""> <input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" /> <input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" /> <input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" /> <div class=""form-group""> <label for=""PubTitle"">竞标标题:</label> <input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" /> {PubCode/} </div> <div class=""form-group""> <label for=""PubContent"">竞标内容:</label> <textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea> </div> <div class=""form-group text-center""> <button type=""submit"" class=""btn btn-default"">提交</button> <button type=""reset"" class=""btn btn-default"">重置</button> </div> </form>"; Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString()); strPath = "默认竞标" + pubMod.PubName + "提交模板.html"; strPathname = "默认竞标" + pubMod.PubName + "提交模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; break; case 7: //评星 if (string.IsNullOrEmpty(starOPT.Text.Trim())) { function.WriteErrMsg("选项不能为空!!"); } string[] starOP = starOPT.Text.Trim().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); Tempinputstr = GetContent(starOP, Pubinsertid); //存值方式Content中 //name:value,name:value然后用先获取contentID下的记录,然后再统计用lamda统计得分 strPath = "评星" + pubMod.PubName + "提交模板.html"; strPathname = "评星" + pubMod.PubName + "提交模板.html"; strPath = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/互动模板/" + strPath; break; default: break; } if (pubflag.Checked)//开启cookie验证 { Tempinputstr += @" if (!localStorage[""cookflag""]) { localStorage[""cookflag""] = GetRanPass(12); } if (!getCookie(""cookflag"")) { setCookie(""cookflag"", localStorage[""cookflag""]); }"; } strPath = strPath.Replace("/", @"\"); FileSystemObject.WriteFile(strPath, Tempinputstr); PubInputTMurl = "/互动模板/" + strPathname; #endregion pubMod = pubBll.GetSelect(Pubinsertid); pubMod.PubInputTM = PubInputTMurl;//提交窗口模板 pubMod.PubTemplate = PubTemplateurl; pubMod.Public = RaPublic.Checked ? 1 : 0; pubBll.GetUpdate(pubMod); function.WriteSuccessMsg("添加成功", pubMod.PubType == 8 ? "FormMangae.aspx" : "pubmanage.aspx"); } else { pubMod.PubTableName = ModelList_DP.SelectedValue; pubMod.PubInputTM = PubInputTM_hid.Value; pubMod.PubTemplate = PubTemplate_hid.Value; pubMod.Pubinfo = Pubinfo.Text; pubBll.GetUpdate(pubMod); function.WriteSuccessMsg("更新成功", pubMod.PubType == 8 ? "FormMangae.aspx" : "pubmanage.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { B_Admin badmin = new B_Admin(); if (!this.Page.IsPostBack) { string Pubid = string.IsNullOrEmpty(Request.QueryString["Pubid"].ToString()) ? "0" : Request.QueryString["Pubid"].ToString(); pubMod = bpub.SelReturnModel(DataConverter.CLng(Pubid)); string prowinfo = B_Role.GetPowerInfoByIDs(badmin.GetAdminLogin().RoleList); if (!badmin.GetAdminLogin().RoleList.Contains(",1,") && !prowinfo.Contains("," + pubMod.PubTableName + ",")) { function.WriteErrMsg("无权限管理该互动信息!!"); } int ModelID = DataConverter.CLng(bpub.GetSelect(DataConverter.CLng(Pubid)).PubModelID.ToString()); this.HdnPubid.Value = Pubid.ToString(); this.HdnType.Value = string.IsNullOrEmpty(Request.QueryString["small"]) ? null : Request.QueryString["small"].ToString(); if (DataConverter.CLng(Pubid) <= 0) { function.WriteErrMsg("缺少用户模型ID参数!"); } M_ModelInfo model = bmodel.GetModelById(ModelID); this.HdnModel.Value = ModelID.ToString(); int ID = string.IsNullOrEmpty(Request.QueryString["ID"]) ? 0 : DataConverter.CLng(Request.QueryString["ID"]); this.HdnID.Value = ID.ToString(); DataTable UserData = new DataTable(); UserData = buser.GetUserModeInfo(model.TableName, ID, 12); DataRow dr; if (UserData == null) { dr = null; } else { if (UserData.Rows.Count == 0) { dr = null; } else { dr = UserData.Rows[0]; } } if (dr == null) { this.LblModelName.Text = "添加" + model.ModelName; } else { this.LblModelName.Text = "修改" + model.ModelName; this.TextBox1.Text = dr["PubTitle"].ToString(); this.tx_PubContent.Text = dr["PubContent"].ToString(); this.HdnID.Value = dr["ID"].ToString(); } string Html = bfield.InputallHtml(ModelID, 0, new ModelConfig() { ValueDR = dr }); ModelHtml.Text = Html; Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='pubmanage.aspx'>互动管理</a></li><li>修改信息</li>"); } }
public void CreateFile(M_Node nodeMod) { string UName = this.TxtNodeDir.Text.Trim(); string Ulook = ""; if (!string.IsNullOrEmpty(Ulook)) { if (RadioButtonList1.SelectedValue == "0") { if (Ulook.IndexOf("http://") == -1) { Ulook = "http://" + Ulook; } } if (RadioButtonList1.SelectedValue == "1") { if (Ulook.IndexOf("~/") == -1) { Ulook = "~/" + Ulook; } } string USend = "~/ColumnList.aspx?NodeID=" + nodeMod.NodeID; #region 文件生成 USend = Ulook; string AbsPath = base.Request.PhysicalApplicationPath; if (USend.IndexOf("http://") > -1) { if (USend.IndexOf("/", 8) > -1 && USend.Length > USend.IndexOf("/", 8) + 1) { string USend2 = USend.Substring(USend.IndexOf("/", 8)); if (USend2.IndexOf(".") > -1) { USend2 = USend2.Substring(USend2.IndexOf(".")); } else { #region 文件生成 try { DirectoryInfo info = new DirectoryInfo(AbsPath + USend2 + @"\Default.aspx"); if (info.Exists) { // Response.Write("<script>alert('文件以');</script>"); } else { FileSystemObject.Create(AbsPath + USend2 + @"\Default.aspx", FsoMethod.File); FileSystemObject.Create(AbsPath + USend2 + @"\Index.aspx", FsoMethod.File); } } catch (FileNotFoundException) { function.WriteErrMsg("发生错误"); } catch (UnauthorizedAccessException) { function.WriteErrMsg("发生错误"); } #endregion } } } else { string USend3 = USend.Substring(2); if (USend.IndexOf(".") > -1) { // USend = USend.Substring(USend.IndexOf(".")); // Response.Write("<script>alert('" + USend3 + "');</script>"); } else { #region 文件生成 try { DirectoryInfo info = new DirectoryInfo(AbsPath + USend3); if (info.Exists) { // Response.Write("<script>alert('aa');</script>"); } else { FileSystemObject.Create(AbsPath + USend3 + @"\Default.aspx", FsoMethod.File); FileSystemObject.Create(AbsPath + USend3 + @"\Index.aspx", FsoMethod.File); } } catch (FileNotFoundException) { function.WriteErrMsg("发生错误"); } catch (UnauthorizedAccessException) { function.WriteErrMsg("发生错误"); } #endregion } } #endregion } if (DropDownList1.SelectedValue != "0") { M_Pub pm = pll.GetSelect(DataConverter.CLng(DropDownList1.SelectedValue)); pm.PubNodeID = nodeMod.NodeID.ToString(); pll.GetUpdate(pm); } }
protected void Page_Load(object sender, EventArgs e) { if (function.isAjax()) { ProcAjax(); } if (Pid <= 0) { function.WriteErrMsg("参数错误!不存在此信息!"); } M_Pub mpub = pubBll.GetSelect(Pid); if (mpub != null && mpub.Pubid > 0) { #region 是否需要登录PubLogin if (mpub.PubLogin == 1) { string logstr = mpub.PubLoginUrl; if (!buser.CheckLogin()) { if (string.IsNullOrEmpty(logstr)) { Response.Redirect("/User/Login?ReturnUrl=" + Request.UrlReferrer.PathAndQuery); } else { Response.Redirect(logstr); } Response.End(); } } #endregion #region 是否已经结束 if (mpub.PubEndTime < DateTime.Now) { function.WriteErrMsg("Sorry,此互动已经结束!不接收任何提交的数据!"); Response.End(); } #endregion string cookflag = Request.Cookies["cookflag"] == null ? "" : Request.Cookies["cookflag"].Value; string PubInputer = Request.Form["PubInputer"]; int PubContentid = DataConverter.CLng(Request.Form["PubContentid"]); //初始化参数 int pubitemid = 0; int Pubnum = 0; int Parentid = 0; int userid = 0; string username = ""; //IP可发信息数量 int pubipnum = mpub.PubIPOneOrMore; //是否需要审核 bool isinto = false; //用户提交 string pbtitle = Server.HtmlEncode(Request.Form["PubTitle"]); string pbcontent = Server.HtmlEncode(Request.Form["PubContent"]); //----------------------------------------------------------------- if (mpub.PubCode == 1) { if (!ZoomlaSecurityCenter.VCodeCheck(Request.Form["VCode_hid"], Request.Form["VCode"])) { Response.Write("<script>alert('验证码错误!');window.history.go(-1);</script>"); Response.Flush(); Response.End(); } } if (buser.CheckLogin()) { M_UserInfo mu = buser.GetLogin(); userid = mu.UserID; username = mu.UserName; } //查找是否存在主题 DataTable temptable = mfBll.SelectTableName(mpub.PubTableName, "PubContentid=" + PubContentid + " and Pubupid=" + Pid + " and Parentid=0"); //同IP的同一篇文章回复次数 int msgCount = pubBll.SelMsgCount(mpub, PubContentid, mpub.Pubid, EnviorHelper.GetUserIP()); //最后回复时间 DataTable selecttime = mfBll.SelectTableName(mpub.PubTableName, "PubContentid=" + PubContentid + " and Pubupid=" + Pid + " and PubIP='" + EnviorHelper.GetUserIP() + "' order by id desc"); //判断是否存在,获得数据的值 if (temptable.Rows.Count > 0) { pubitemid = DataConverter.CLng(temptable.Rows[0]["ID"]); Pubnum = DataConverter.CLng(temptable.Rows[0]["Pubnum"]); } //删除超过保留期限的值 pubBll.DeleteModel(mpub.PubTableName, "DateDiff(d,PubAddTime,getdate())>" + mpub.Pubkeep); switch (pubipnum) { case 0: Parentid = 0; isinto = true; break; case 1: //Only One Parentid = temptable.Rows.Count == 0 ? 0 : Parentid = DataConverter.CLng(temptable.Rows[0]["ID"]); isinto = msgCount < 1; break; default: Parentid = temptable.Rows.Count == 0 ? 0 : Parentid = DataConverter.CLng(temptable.Rows[0]["ID"]); isinto = msgCount < pubipnum; break; } //开启cookies身份判断(主用于移动端例如微信浏览器) if (isinto && mpub.PubFlag == 1 && Request.Cookies["cookflag"] != null) { if (string.IsNullOrEmpty(cookflag)) { function.WriteErrMsg("身份信息不正确,无法参与互动!"); } SqlParameter[] sp = new SqlParameter[] { new SqlParameter("cookflag", cookflag) }; string sql = " cookflag=@cookflag"; DataTable pubinfoDT = mfBll.SelectTableName(mpub.PubTableName, sql, sp); if (pubinfoDT.Rows.Count >= mpub.PubTimeSlot) { function.WriteErrMsg("很抱歉,每人只能提交" + mpub.PubFlag + "次"); isinto = false; } } //用户信息数量限制 if (isinto && mpub.PubOneOrMore > 0 && !string.IsNullOrEmpty(username)) { SqlParameter[] sp2 = new SqlParameter[] { new SqlParameter("uname", username) }; string sql2 = "PubContentid=" + PubContentid + " and Pubupid=" + mpub.Pubid + " and PubUserName=@uname order by id desc"; DataTable pubinfoDT = mfBll.SelectTableName(mpub.PubTableName, sql2, sp2); if (mpub.PubOneOrMore == 3) { if (pubinfoDT.Select("PubUserID=" + userid).Length > 1) { function.WriteErrMsg("很抱歉,对于此次互动,您只能参与一次!"); } } isinto = pubinfoDT.Rows.Count < mpub.PubOneOrMore; } if (!isinto)//不符合添加条件 { if (!string.IsNullOrEmpty(mpub.Puberrmsg)) { Response.Write("<script>alert('" + mpub.Puberrmsg + "');window.history.go(-1);</script>"); } else { Response.Write("<script>window.history.go(-1);</script>"); } Response.End(); return; } DateTime PubAddTimes = DateTime.MinValue; if (selecttime.Rows.Count > 0 && Parentid > 0) { PubAddTimes = DataConverter.CDate(selecttime.Rows[0]["PubAddTime"]); } //TimeSpan timespan = DateTime.Now - PubAddTimes;//时间间隔,用于限定用户第二次提交限制 //double TotalSecondsnum = timespan.TotalSeconds; //ModelField表中仅存了自定义的字段 B_CodeModel codeBll = new B_CodeModel(mpub.PubTableName); DataRow dr = codeBll.NewModel(); DataTable mfDT = mfBll.DB_SelByModel(mpub.PubModelID); mfDT.DefaultView.RowFilter = "sys_type=0"; mfDT = mfDT.DefaultView.ToTable(); //-----固定的系统字段 dr["Pubnum"] = 1; dr["PubIP"] = EnviorHelper.GetUserIP(); dr["PubUserID"] = userid; dr["PubUserName"] = username; dr["Pubupid"] = mpub.Pubid; dr["PubAddTime"] = DateTime.Now; dr["Parentid"] = DataConvert.CLng(Request.Form["Parentid"]); dr["PubTitle"] = pbtitle; dr["PubContent"] = pbcontent; dr["Pubstart"] = mpub.PubIsTrue == 1 ? 0 : 1;//取反 dr["PubInputer"] = PubInputer; dr["PubContentid"] = PubContentid; //dr["Mood"] = Request.Form["Mood"]; if (dr.Table.Columns.Contains("cookflag")) { dr["cookflag"] = cookflag; } //------非系统字段 for (int i = 0; i < mfDT.Rows.Count; i++) { M_ModelField mfMod = new M_ModelField().GetModelFromReader(mfDT.Rows[i]); string value = Server.HtmlEncode(Request.Form[mfMod.FieldName] ?? ""); Parentid = DataConvert.CLng(Request.Form["Parentid"]); if (mfMod.IsNotNull && string.IsNullOrEmpty(value)) { Response.Write("<script>alert('" + mfMod.FieldName + "不能为空!');window.history.go(-1);</script>"); Response.End(); } dr[mfMod.FieldName] = value; switch (mpub.PubType) { #region 根据互动类型,进行空值判断 case 0: if (string.IsNullOrEmpty(pbcontent)) { Response.Write("<script>alert('评论内容不能为空!');window.history.go(-1);</script>"); Response.End(); } break; case 1: if (string.IsNullOrEmpty(pbtitle)) { Response.Write("<script>alert('标题不能为空!');window.history.go(-1);</script>"); Response.End(); } break; case 2: if (string.IsNullOrEmpty(pbtitle)) { Response.Write("<script>alert('标题不能为空!');window.history.go(-1);</script>"); Response.End(); } if (string.IsNullOrEmpty(pbcontent)) { Response.Write("<script>alert('活动信息不能为空!');window.history.go(-1);</script>"); Response.End(); } break; case 3: if (string.IsNullOrEmpty(pbtitle) || string.IsNullOrEmpty(pbcontent)) { Response.Write("<script>alert('标题与内容不能为空!');window.history.go(-1);</script>"); Response.End(); } break; case 4: if (string.IsNullOrEmpty(pbtitle)) { Response.Write("<script>alert('标题不能为空!');window.history.go(-1);</script>"); Response.End(); } break; case 5: break; case 7: //将评星控件的数据写入数据表中 dr["PubContent"] = Request.Params["scoreVal"]; break; case 8: //互动表单 break; #endregion } //if (Parentid > 0) //{ // //更新主题信息 // SqlParameter[] sqlparacc = new SqlParameter[1]; // sqlparacc[0] = new SqlParameter("Pubnum", SqlDbType.Int); // sqlparacc[0].Value = Pubnum + 1; // pubBll.UpdateModel(sqlparacc, mpub.PubTableName, "id=" + pubitemid.ToString() + ""); //} } codeBll.Insert(dr); Upaddnums(mpub); //更新总参与人数 } }
public IActionResult PubAdd_Submit() { M_Pub pubMod = new M_Pub(); if (Mid > 0) { pubMod = pubBll.SelReturnModel(Mid); } pubMod.PubName = GetParam("PubName"); bool addtrue = true; #region 验证模块 if (Mid < 1) { pubMod.PubLoadstr = GetParam("PubLoadstr"); pubMod.PubInputLoadStr = GetParam("PubInputLoadStr"); pubMod.PubTableName = B_Pub.PREFIX + GetParam("PubTableName"); DataTable tempinfo = pubBll.SelByName(pubMod.PubName); if (tempinfo.Rows.Count > 0) { addtrue = false; return(WriteErr("已存在此互动模块!请更换模块名称再试!!", "javascript:history.back(-2);")); } DataTable PubInputLoadStrtable = pubBll.SelBy("", "PubInputLoadStr.Text", Mid.ToString()); if (PubInputLoadStrtable.Rows.Count > 0) { addtrue = false; return(WriteErr("已经存在此提交标签!")); } DataTable PubLoadstrtable = pubBll.SelBy(pubMod.PubLoadstr, "", Mid.ToString()); if (PubLoadstrtable.Rows.Count > 0) { addtrue = false; return(WriteErr("已经存在此互动标签!")); } } #endregion if (addtrue) { pubMod.PubClass = DataConverter.CLng(GetParam("PubClass")); pubMod.PubCode = DataConvert.CLng(GetParam("PubCode")); //界面处理显示结束时间,如果是最大则不显示 if (!string.IsNullOrEmpty(GetParam("PubEndTime"))) { pubMod.PubEndTime = DataConverter.CDate(GetParam("PubEndTime").Replace("/", "-")); } else { pubMod.PubEndTime = DateTime.MaxValue; } pubMod.PubType = DataConverter.CLng(GetParam("PubType")); pubMod.PubIsTrue = DataConvert.CLng(GetParam("PubIsTrue")); pubMod.PubLogin = DataConvert.CLng(GetParam("PubLogin")); //pubMod.PubLoginUrl = PubLoginUrl.Text; pubMod.PubOpenComment = DataConvert.CLng(GetParam("PubOpenComment")); pubMod.PubShowType = DataConverter.CLng(GetParam("PubShowType")); pubMod.Pubkeep = DataConverter.CLng(GetParam("Pubkeep")); pubMod.Puberrmsg = Request.Form["Puberrmsg"]; pubMod.PubPermissions = GetParam("PubPermissions"); pubMod.PubGourl = GetParam("PubGourl"); pubMod.Public = DataConvert.CLng(GetParam("RaPublic")); pubMod.VerifyMode = Request.Form["verify_chk"]; pubMod.PubIPOneOrMore = DataConverter.CLng(GetParam("PubIPOneOrMore")); pubMod.Interval = DataConverter.CLng(GetParam("Interval_T")); pubMod.Pubinfo = GetParam("Pubinfo"); string PubInputTMurl = ""; string Tempinputstr = @""; //模型ID if (pubMod.Pubid == 0) { string saveDir = function.VToP(SiteConfig.SiteOption.TemplateDir + "/互动模板/"); string saveName = ""; pubMod.PubModelID = pubBll.CreateModelInfo(pubMod);//建立数据表与模型Field,Model int Pubinsertid = pubBll.GetInsert(pubMod); #region 创建互动引用模板 string PubTemplateurl = ""; //模板路径 string Tmpstr = ""; //引用标签 M_Label lab = new M_Label(); B_Label blab = new B_Label(); lab.LabelAddUser = adminMod.AdminId; string pubcontdid = "@ID"; lab.Param = "ID,0,2,"; //创建标签 switch (pubMod.PubType) { case 0: //评论 //创建源标签 lab.LabelName = pubMod.PubName + "调用标签"; lab.LabelCate = "互动标签"; lab.LabelType = 4; lab.LabelTable = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid"; lab.LabelField = "" + pubMod.PubTableName + ".*,ZL_Pub.*"; lab.LabelWhere = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1"; lab.LabelOrder = "" + pubMod.PubTableName + ".ID DESC"; lab.LabelCount = "10"; lab.Content = "{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n评论说明:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n评论时间:{Field=\"PubAddTime\"/}<br />{/Repeate}<br />\n{ZL.Page/}"; lab.Desc = pubMod.PubTableName + "分页标签"; lab.LabelNodeID = 0; blab.AddLabelXML(lab); Tmpstr = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + pubMod.PubInputLoadStr + "/}"; saveName = "默认评论" + pubMod.PubName + "模板.html"; break; case 1: //投票 //创建标签 lab.LabelName = pubMod.PubName + "调用标签"; lab.LabelCate = "互动标签"; lab.LabelType = 4; lab.LabelTable = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid"; lab.LabelField = "" + pubMod.PubTableName + ".*,ZL_Pub.*"; lab.LabelWhere = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1"; lab.LabelOrder = "" + pubMod.PubTableName + ".ID DESC"; lab.LabelCount = "10"; lab.Content = "{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n投票说明:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n投票时间:{Field=\"PubAddTime\"/}<br />{/Repeate}<br />\n{ZL.Page/}"; lab.Desc = pubMod.PubTableName + "分页标签"; lab.LabelNodeID = 0; blab.AddLabelXML(lab); Tmpstr = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + pubMod.PubInputLoadStr + "/}"; saveName = "默认投票" + pubMod.PubName + "模板.html"; break; case 2: //活动 lab.LabelName = pubMod.PubName + "调用标签"; lab.LabelCate = "互动标签"; lab.LabelType = 4; lab.LabelTable = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid"; lab.LabelField = "" + pubMod.PubTableName + ".*,ZL_Pub.*"; lab.LabelWhere = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1"; lab.LabelOrder = "" + pubMod.PubTableName + ".ID DESC"; lab.LabelCount = "10"; lab.Content = "<a href=PubAction?menu=hd&act=add&Pubid=" + Pubinsertid.ToString() + ">发起活动</a>\n{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n活动内容:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n提交时间:{Field=\"PubAddTime\"/}\n{/Repeate}<br />\n{ZL.Page/}"; lab.Desc = pubMod.PubTableName + "分页标签"; lab.LabelNodeID = 0; blab.AddLabelXML(lab); Tmpstr = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + pubMod.PubInputLoadStr + "/}"; saveName = "默认活动" + pubMod.PubName + "模板.html"; break; case 3: //留言 lab.LabelName = pubMod.PubName + "调用标签"; lab.LabelCate = "互动标签"; lab.LabelType = 4; lab.LabelTable = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid"; lab.LabelField = "" + pubMod.PubTableName + ".*,ZL_Pub.*"; lab.LabelWhere = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1"; lab.LabelOrder = "" + pubMod.PubTableName + ".ID DESC"; lab.LabelCount = "10"; lab.Content = "{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n留言内容:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n提交时间:{Field=\"PubAddTime\"/}\n{/Repeate}<br />\n{ZL.Page/}"; lab.Desc = pubMod.PubTableName + "分页标签"; lab.LabelNodeID = 0; blab.AddLabelXML(lab); Tmpstr = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + pubMod.PubInputLoadStr + "/}"; saveName = "默认留言" + pubMod.PubName + "模板.html"; break; case 4: //问券 lab.LabelName = pubMod.PubName + "调用标签"; lab.LabelCate = "互动标签"; lab.LabelType = 4; lab.LabelTable = "" + pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid"; lab.LabelField = "" + pubMod.PubTableName + ".*,ZL_Pub.*"; lab.LabelWhere = "" + pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " And " + pubMod.PubTableName + ".Pubstart=1"; lab.LabelOrder = "" + pubMod.PubTableName + ".ID DESC"; lab.LabelCount = "10"; lab.Content = "{Repeate}\n用户名:{Field=\"PubUserName\"/}<br />\n问券内容:{Field=\"PubContent\"/}<br />\n用户IP:{Field=\"PubIP\"/}<br />\n提交时间:{Field=\"PubAddTime\"/}\n{/Repeate}<br />\n{ZL.Page/}<br />"; lab.Desc = pubMod.PubTableName + "分页标签"; lab.LabelNodeID = 0; blab.AddLabelXML(lab); Tmpstr = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + pubMod.PubInputLoadStr + "/}"; saveName = "默认问券" + pubMod.PubName + "模板.html"; break; case 5: //统计 lab.LabelName = pubMod.PubName + "调用标签"; lab.LabelCate = "互动标签"; lab.LabelType = 2; lab.LabelTable = pubMod.PubTableName + " left join ZL_Pub on " + pubMod.PubTableName + ".Pubupid=ZL_Pub.Pubid"; lab.LabelField = pubMod.PubTableName + ".*,ZL_Pub.*"; lab.LabelWhere = pubMod.PubTableName + ".Pubupid=" + Pubinsertid.ToString() + " And " + pubMod.PubTableName + ".PubContentid=" + pubcontdid + " and Parentid=0 And " + pubMod.PubTableName + ".Pubstart=1"; lab.LabelOrder = pubMod.PubTableName + ".ID DESC"; lab.LabelCount = "10"; lab.Content = "点击数:{Field=\"Pubnum\"/}"; lab.Desc = pubMod.PubTableName + "动态标签"; lab.LabelNodeID = 0; blab.AddLabelXML(lab); Tmpstr = "{ZL.Label id=\"" + pubMod.PubName + "调用标签\"/}\n{Pub." + pubMod.PubInputLoadStr + "/}"; saveName = "默认统计" + pubMod.PubName + "模板.html"; break; case 6: //竞标 case 7: case 8: break; default: return(WriteErr("类型错误,该类型不存在!!!")); break; } if (!string.IsNullOrEmpty(saveName)) { FileSystemObject.WriteFile(saveDir + saveName, Tmpstr); } PubTemplateurl = "/互动模板/" + saveName; #endregion #region 创建互动提交模板 switch (pubMod.PubType) { case 0: //评论 Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction""> <input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" /> <input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" /> <input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" /> <div class=""form-group""> <label for=""PubTitle"">评论标题:</label> <input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" />{PubCode/} </div> <div class=""form-group""> <label for=""PubContent"">评论内容:</label> <textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea> </div> <div class=""form-group text-center""> <button type=""submit"" class=""btn btn-default"">提交</button> <button type=""reset"" class=""btn btn-default"">重置</button> </div> </form>"; Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString()); saveName = "默认评论" + pubMod.PubName + "提交模板.html"; break; case 1: //投票 Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction""> <input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" /> <input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" /> <input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" /> <div class=""form-group""> <label for=""PubTitle"">投票标题:</label> <input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" /> {PubCode/} </div> <div class=""form-group""> <label for=""PubContent"">投票内容:</label> <textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea> </div> <div class=""form-group text-center""> <button type=""submit"" class=""btn btn-default"">提交</button> <button type=""reset"" class=""btn btn-default"">重置</button> </div> </form>"; Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString()); saveName = "默认投票" + pubMod.PubName + "提交模板.html"; break; case 2: //活动 Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction""> <input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" /> <input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" /> <input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" /> <div class=""form-group""> <label for=""PubTitle"">活动标题:</label> <input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" /> {PubCode/} </div> <div class=""form-group""> <label for=""PubContent"">活动内容:</label> <textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea> </div> <div class=""form-group text-center""> <button type=""submit"" class=""btn btn-default"">提交</button> <button type=""reset"" class=""btn btn-default"">重置</button> </div> </form>"; Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString()); saveName = "默认活动" + pubMod.PubName + "提交模板.html"; break; case 3: //留言 Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction""> <input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" /> <input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" /> <input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" /> <div class=""form-group""> <label for=""PubTitle"">留言标题:</label> <input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" /> {PubCode/} </div> <div class=""form-group""> <label for=""PubContent"">留言内容:</label> <textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea> </div> <div class=""form-group text-center""> <button type=""submit"" class=""btn btn-default"">提交</button> <button type=""reset"" class=""btn btn-default"">重置</button> </div> </form>"; Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString()); saveName = "默认留言" + pubMod.PubName + "提交模板.html"; break; case 4: //问券 Tempinputstr = @"<form name=""form{PubID/}"" method=""post"" action=""/PubAction""> <input type=""hidden"" name=""PubID"" id=""PubID"" value=""{PubID/}"" /> <input type=""hidden"" name=""PubContentid"" id=""PubContentid"" value=""{PubContentid/}"" /> <input type=""hidden"" name=""PubInputer"" id=""PubInputer"" value=""{PubInputer/}"" /> <div class=""form-group""> <label for=""PubTitle"">问券标题:</label> <input type=""text"" class=""form-control"" id=""PubTitle"" name=""PubTitle"" /> {PubCode/} </div> <div class=""form-group""> <label for=""PubContent"">问券内容:</label> <textarea class=""form-control"" name=""PubContent"" cols=""50"" rows=""10"" id=""PubContent""></textarea> </div> <div class=""form-group text-center""> <button type=""submit"" class=""btn btn-default"">提交</button> <button type=""reset"" class=""btn btn-default"">重置</button> </div> </form>"; Tempinputstr = Tempinputstr.Replace(@"{PubID/}", Pubinsertid.ToString()); saveName = "默认问券" + pubMod.PubName + "提交模板.html"; break; case 5: //统计 case 6: //竞标 default: break; } if (!string.IsNullOrEmpty(saveName)) { FileSystemObject.WriteFile(saveDir + saveName, Tempinputstr); } PubInputTMurl = "/互动模板/" + saveName; #endregion pubMod = pubBll.GetSelect(Pubinsertid); pubMod.PubInputTM = PubInputTMurl;//提交窗口模板 pubMod.PubTemplate = PubTemplateurl; pubBll.GetUpdate(pubMod); } else { pubMod.PubInputTM = GetParam("PubInputTM_hid"); pubMod.PubTemplate = GetParam("PubTemplate_hid"); pubBll.GetUpdate(pubMod); } } return(WriteOK("操作成功", pubMod.PubType == 8 ? "FormManage" : "PubManage")); }