예제 #1
0
        protected void SaveBtn_Click(object sender, EventArgs e)
        {
            bool isnew = true; int newid = 0;

            if (PubID > 0)
            {
                pubMod = pubBll.SelReturnModel(PubID);
                newid  = pubMod.Pubid;
                isnew  = false;
            }
            pubMod.PubName     = Title_T.Text;
            pubMod.PubTemplate = Intro_T.Text;
            pubMod.Pubinfo     = Json_Hid.Value;
            if (isnew)
            {
                pubMod.PubTableName  = "ZL_Pub_" + PubName_T.Text.Replace(" ", "");
                pubMod.PubType       = 8;
                pubMod.PubCreateTime = DateTime.Now;
                pubMod.PubEndTime    = DateTime.MaxValue;
                if (ZoomLa.SQLDAL.DBHelper.Table_IsExist(pubMod.PubTableName))
                {
                    pubMod.PubTableName += "_" + function.GetRandomString(4);
                    //function.WriteErrMsg(pubMod.PubTableName + "表已存在,请更换表名", "javascript:history.go(-1);");
                }
                pubBll.CreateModelInfo(pubMod);
                newid = pubBll.insert(pubMod);
            }
            else
            {
                pubBll.UpdateByID(pubMod);
            }
            Response.Redirect("/Rss/FormView.aspx?pid=" + newid);
        }
예제 #2
0
        //互动模型需要扩展
        public void RestoreByName(string name)
        {
            B_Model      modelBll = new B_Model();
            B_ModelField fieldBll = new B_ModelField();
            B_Pub        pubBll   = new B_Pub();
            string       ppath    = SafeSC.PathDeal(pdir + name);

            if (!File.Exists(ppath))
            {
                function.WriteErrMsg("备份文件[" + name + "]不存在");
            }
            //清空数据
            modelBll.DeleteAll();
            foreach (string tbname in tbnames)
            {
                SqlHelper.ExecuteSql("TRUNCATE TABLE " + tbname);
            }
            SqlHelper.ExecuteSql("TRUNCATE TABLE ZL_CommonModel");
            //开始恢复
            DataSet ds = new DataSet();

            ds.ReadXml(ppath);
            //批量导入部分数据
            SqlHelper.Insert_Bat(ds.Tables["ZL_Node"], SqlHelper.ConnectionString);
            if (ds.Tables["ZL_Pub"] != null)
            {
                SqlHelper.Insert_Bat(ds.Tables["ZL_Pub"], SqlHelper.ConnectionString);
            }
            if (ds.Tables["ZL_Node_ModelTemplate"] != null)
            {
                SqlHelper.Insert_Bat(ds.Tables["ZL_Node_ModelTemplate"], SqlHelper.ConnectionString);
            }
            if (ds.Tables["ZL_UserPromotions"] != null)
            {
                SqlHelper.Insert_Bat(ds.Tables["ZL_UserPromotions"], SqlHelper.ConnectionString);
            }
            if (ds.Tables["ZL_NodeRole"] != null)
            {
                SqlHelper.Insert_Bat(ds.Tables["ZL_NodeRole"], SqlHelper.ConnectionString);
            }
            //恢复模型数据与其对应的表
            DataTable modelDT = ds.Tables["ZL_Model"];
            DataTable fieldDT = ds.Tables["ZL_ModelField"];
            DataTable pubDT   = ds.Tables["ZL_Pub"];

            foreach (DataRow dr in modelDT.Rows)
            {
                M_ModelInfo modelMod = new M_ModelInfo().GetModelFromReader(dr);
                ZoomLa.SQLDAL.DBHelper.Table_Del(modelMod.TableName);
                switch (modelMod.ModelType.ToString())
                {
                case "3":    //用户模型和黄页申请模型
                    modelBll.AddUserModel(modelMod);
                    break;

                case "6":    //店铺申请模型
                    modelBll.AddStoreModel(modelMod);
                    break;

                case "7":    //互动模型
                    if (pubDT == null)
                    {
                        break;
                    }
                    M_Pub pubmodel = new M_Pub();
                    pubmodel.PubName      = modelMod.ModelName;
                    pubmodel.PubTableName = modelMod.TableName;
                    DataRow[] drs = pubDT.Select("PubModelID=" + modelMod.ModelID);
                    pubmodel.PubType = drs.Length > 0 ? DataConvert.CLng(drs[0]["PubType"]) : 0;
                    pubBll.CreateModelInfo(pubmodel);
                    break;

                case "8":    //功能模型
                    modelBll.AddFunModel(modelMod);
                    break;

                default:    //内容模型、商城模型、黄页内容模型、店铺商品模型
                    modelBll.AddModel(modelMod);
                    break;
                }
            }
            //恢复字段
            if (fieldDT != null && fieldDT.Rows.Count > 0)
            {
                fieldDT.DefaultView.RowFilter = "sys_type ='false'";
                foreach (DataRow dr in fieldDT.DefaultView.ToTable().Rows)
                {
                    int modelID = DataConvert.CLng(dr["ModelID"]);
                    if (modelID < 1)
                    {
                        continue;
                    }
                    DataRow[] drs = modelDT.Select("ModelID='" + modelID + "'");
                    //OA不处理,未找到不处理
                    if (drs.Length < 1 || drs[0]["ModelType"].ToString().Equals("12"))
                    {
                        continue;
                    }
                    M_ModelInfo  modelMod = new M_ModelInfo().GetModelFromReader(drs[0]);
                    M_ModelField fieldMod = new M_ModelField().GetModelFromReader(dr);
                    //Pub表会报重复
                    if (fieldBll.IsExists(modelMod.ModelID, fieldMod.FieldName))
                    {
                        continue;
                    }
                    if (DBCenter.DB.Table_Exist(modelMod.TableName)) //互动表可能未创建,忽略
                    {
                        fieldBll.AddModelField(modelMod, fieldMod);
                    }
                }
                SqlHelper.ExecuteSql("TRUNCATE TABLE ZL_ModelField");
                SqlHelper.Insert_Bat(fieldDT, SqlHelper.ConnectionString);
            }
        }
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(this.TxtTableName.Text))
            {
                string str = this.TxtTableName.Text;
                bool   b   = this.bll.isExistTableName(LblTablePrefix.Text + str);
                if (b)
                {
                    function.WriteErrMsg("数据库表名已存在,请重新输入!", CustomerPageAction.customPath + "/Content/AddEditModel.aspx");
                    return;
                }
            }
            M_ModelInfo info = new M_ModelInfo();

            if (ModelID < 1)
            {
                info.ModelID   = 0;
                info.TableName = this.LblTablePrefix.Text + this.TxtTableName.Text;
            }
            else
            {
                info           = bll.SelReturnModel(ModelID);
                info.TableName = this.TxtTableName.Text;
            }
            info.ModelName   = this.TxtModelName.Text;
            info.ItemName    = this.TxtItemName.Text;
            info.ItemUnit    = this.TxtItemUnit.Text;
            info.ItemIcon    = this.TxtItemIcon.Text;
            info.Description = this.TxtDescription.Text;
            info.ModelType   = ModelType;
            info.MultiFlag   = true;
            info.SysModel    = rblCopy.Checked ? 1 : 0;
            info.Islotsize   = rblIslotsize.Checked;
            info.Thumbnail   = FileFactory.Checked ? "1" : "0";
            if (info.ModelID < 1)
            {
                info.FromModel = 0;
                switch (ModelType.ToString())
                {
                case "3":    //用户模型和黄页申请模型
                    info.MultiFlag = DataConverter.CBool(this.RBLMultiFlag.SelectedValue);
                    this.bll.AddUserModel(info);
                    break;

                case "6":    //店铺申请模型
                    this.bll.AddStoreModel(info);
                    break;

                case "7":    //互动模型
                    M_Pub pubmodel = new M_Pub();
                    pubmodel.PubName      = info.ModelName;
                    pubmodel.PubTableName = info.TableName;
                    pubmodel.PubType      = DataConverter.CLng(this.PubType.SelectedValue);
                    pll.CreateModelInfo(pubmodel);
                    break;

                case "8":    //功能模型
                    this.bll.AddFunModel(info);
                    break;

                case "12":                   //OA办公模型
                    this.bll.AddModel(info); //基于内容模型,增加自定义字段
                    //bf.AddModelField(info, "content", "内容", "MultipleHtmlType","text");
                    //string[] fieldArr = { "Secret:机密", "Urgency:紧急程度", "Importance:重要性", "Attach:附件", "UserGroupT:所属部门" };
                    //for (int i = 0; i < fieldArr.Length; i++)
                    //{
                    //    bf.AddModelField(info, fieldArr[i].Split(':')[0], fieldArr[i].Split(':')[1], "TextType", "nvarchar");
                    //}
                    break;

                default:    //内容模型、商城模型、黄页内容模型、店铺商品模型
                    CreateDataLabel(info);
                    this.bll.AddModel(info);
                    break;
                }
                Response.Redirect("ModelManage.aspx?ModelType=" + ModelType);
            }
            else
            {
                switch (ModelType.ToString())
                {
                case "3":
                    info.MultiFlag = DataConverter.CBool(this.RBLMultiFlag.SelectedValue);
                    break;

                case "7":
                    break;
                }
                this.bll.UpdateModel(info);
                Response.Redirect("ModelManage.aspx?ModelType=" + ModelType);
            }
        }
예제 #4
0
        public IActionResult ModelAdd_Submit()
        {
            string modelName = RequestEx["TxtModelName"];

            if (string.IsNullOrEmpty(modelName))
            {
                return(WriteErr("模型名称不能为空"));
            }
            //----------------------------------------
            M_ModelInfo info = new M_ModelInfo();

            if (Mid < 1)
            {
                string modelTbName = (bll.GetTablePrefix(ModelType) + RequestEx["TxtTableName"]).Replace(" ", "");
                info.MultiFlag = true;
                info.TableName = modelTbName;
                if (bll.isExistTableName(modelTbName))
                {
                    return(WriteErr("数据库表名已存在,请重新输入!"));
                }
            }
            else
            {
                info = bll.SelReturnModel(Mid);
                //info.TableName = TxtTableName.Text;
            }
            info.ModelName   = modelName;
            info.ItemName    = RequestEx["TxtItemName"];
            info.ItemUnit    = RequestEx["TxtItemUnit"];
            info.ItemIcon    = RequestEx["ItemIcon_T"];
            info.Description = RequestEx["TxtDescription"];
            info.ModelType   = ModelType;
            info.SysModel    = DataConvert.CLng(RequestEx["rblCopy"]);
            info.Islotsize   = DataConverter.CLng(RequestEx["rblIslotsize"]) == 1;
            //info.Thumbnail = FileFactory.Checked ? "1" : "0";
            if (info.ModelID < 1)
            {
                info.FromModel = 0;
                switch (ModelType.ToString())
                {
                case "3":    //用户模型和黄页申请模型
                    bll.AddUserModel(info);
                    break;

                case "6":    //店铺申请模型
                    bll.AddStoreModel(info);
                    break;

                case "7":    //互动模型
                {
                    B_Pub pll      = new B_Pub();
                    M_Pub pubmodel = new M_Pub();
                    pubmodel.PubName      = info.ModelName;
                    pubmodel.PubTableName = info.TableName;
                    pubmodel.PubType      = DataConverter.CLng(GetParam("PubType"));
                    if (string.IsNullOrEmpty(info.ItemIcon))
                    {
                        info.ItemIcon = "zi zi_comment";
                    }
                    pll.CreateModelInfo(pubmodel, info);
                }
                break;

                case "8":    //功能模型
                    bll.AddFunModel(info);
                    break;

                case "12":              //OA办公模型
                    bll.AddModel(info); //基于内容模型,增加自定义字段
                    break;

                default:    //内容模型、商城模型、黄页内容模型、店铺商品模型
                    if (bll.IsExistModelName(info.ModelName))
                    {
                        return(WriteErr("模型名称[" + info.ModelName + "]已存在"));
                    }
                    //CreateDataLabel(info);
                    bll.AddModel(info);
                    break;
                }
            }
            else
            {
                bll.UpdateByID(info);
            }
            return(RedirectToAction("ModelManage"));
        }
예제 #5
0
        //提交
        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");
                }
            }
        }
예제 #6
0
        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"));
        }