Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminGroupBll.Power_Judge(4);
        if (!string.IsNullOrEmpty(Request.QueryString["ModelId"]))
        {
            try
            {
                ModelId = int.Parse(Request.QueryString["ModelId"]);
            }
            catch { }
        }

        if (ModelId == 0)
        {
            ModelId = 1;
        }
        InfoModel = InfoModelBll.GetModel(ModelId);
        if (InfoModel == null)
        {
            Function.ShowMsg(0, "<li>所属模型不存在或已经被删除</li>");
        }
        if(!Page.IsPostBack)
        {
            BindModel();
            ReviewBind();
        }
    }
Exemplo n.º 2
0
    public DataSet GetModelHtmlValue(string ChId, string Id)
    {
        int MyChId = int.Parse(ChId);
        ChannelModel = MyChId <= 0 ? null : ChannelBll.GetChannel(MyChId);
        MInfoModel = BInfoModel.GetModel(ChannelModel.ModelType);
        DataTable dt=new DataTable();
        DataRow dr = BInfoOper.GetInfo(MInfoModel.TableName, int.Parse(Id));
        dt = dr.Table.Copy();
        dt.Clear();
        dt.ImportRow(dr);
        dt.TableName = "DrInfo";

        DataSet ds = new DataSet();
        try
        {
            ds.Tables.Add(BModelField.GetList(ChannelModel.ModelType).Copy());
            ds.Tables.Add(dt);
        }
        catch(Exception ex)
        {
            Response.Write(ex);
        }

        return ds;
    }
Exemplo n.º 3
0
 public int Add(M_InfoModel model)
 {
     int num = this.dal.Add(model);
     this.dal.AddTable(model.TableName);
     try
     {
         Directory.CreateDirectory(Param.SiteRootPath + "/upload/" + model.UploadPath);
     }
     catch
     {
     }
     return num;
 }
Exemplo n.º 4
0
    protected void repContentListBind(int modelId)
    {
        AspNetPager.Visible = true;
        InfoModel = InfoModelBll.GetModel(modelId);
        if (InfoModel == null)
            Function.ShowMsg(0, "<li>模型参数错误!</li><li><a href='javascript:history.back();'>返回上一级</a></li>");
        DataTable dtContent = new DataTable();
        dtContent.Columns.Add("Id", typeof(int));
        dtContent.Columns.Add("Title", typeof(string));
        dtContent.Columns.Add("RowIndex", typeof(int));
        dtContent.Columns.Add("AddTime", typeof(DateTime));
        dtContent.Columns.Add("ModelType", typeof(int));
        int rowIndex = 0;

        TableName = InfoModel.TableName;
        int recordCount = 0;
        DataTable dt = InfoOperBll.GetUserInfoList(TableName, UserModel.UserID, "", "", 0, "0", "3", "", "", "", -1, AspNetPager.CurrentPageIndex, AspNetPager.PageSize, ref recordCount);
        if (dt.Rows.Count <= 0)
        {
            Label1.Text = "<font color=blue>暂无任何稿件!</font>"; return;
        }

        foreach (DataRow dr in dt.Rows)
        {
            DataRow dr2 = dtContent.NewRow();
            dr2["Id"] = dr["Id"];
            dr2["Title"] = dr["Title"];
            dr2["RowIndex"] = rowIndex;
            rowIndex++;
            dr2["AddTime"] = dr["AddTime"];
            dr2["ModelType"] = dr["ModelType"];
            dtContent.Rows.Add(dr2);
        }
        dt.Dispose();
        DataView dv = new DataView(dtContent);
        dv.Sort = "AddTime desc";
        dv.RowFilter = "RowIndex<10";
        repContentList.DataSource = dv;
        repContentList.DataBind();
        AspNetPager.RecordCount = recordCount;
        AspNetPager.CustomInfoHTML = string.Format("当前第{0}/{1}页 共{2}条留言 每页显示{3}条", AspNetPager.CurrentPageIndex, AspNetPager.PageCount, AspNetPager.RecordCount, AspNetPager.PageSize);

        dv.Dispose();
    }
Exemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminGroupBll.Power_Judge(42);
        litMsg.Text = "";
        if (!string.IsNullOrEmpty(Request.QueryString["IdStr"]))
            IdStr = Request.QueryString["IdStr"];
        if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
        {
            try
            {
                ChId = int.Parse(Request.QueryString["ChId"]);
            }
            catch { }
        }
        ChannelModel = ChannelBll.GetChannel(ChId);
        if (ChannelModel == null)
        {
            Function.ShowSysMsg(0, "<li>所属频道不存在或已经被删除</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>");
        }
        InfoModel = InfoModelBll.GetModel(ChannelModel.ModelType);
        if (InfoModel == null)
        {
            Function.ShowSysMsg(0, "<li>所属模型不存在或已经被删除</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>");
        }
        if (!string.IsNullOrEmpty(Request.QueryString["ColId"]))
        {
            try
            {
                ColId = int.Parse(Request.QueryString["ColId"]);
            }
            catch { }
        }

        if (!IsPostBack)
        {
            txtByArticleIdStr.Text = IdStr;
            BindLeft();
            BindRight();
        }
    }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AdminGroupBll.Power_Judge(3);
     Response.Cache.SetNoStore();
     if (!string.IsNullOrEmpty(Request.QueryString["Id"]))
     {
         try
         {
             InfoId = int.Parse(Request.QueryString["Id"]);
         }
         catch { }
     }
     if (!string.IsNullOrEmpty(Request.QueryString["ModelId"]))
     {
         try
         {
             ModelId = int.Parse(Request.QueryString["ModelId"]);
         }
         catch { }
     }
     InfoModel = InfoModelBll.GetModel(ModelId);
     if (InfoModel == null)
     {
         Response.Write("<script>alert('所属模型不存在或已经被删除');window.close();</script>");
         Response.End();
         return;
     }
     InfoDr = CreateBll.GetInfoById(InfoModel.TableName, InfoId);
     ChId = (int)InfoDr["chid"];
     if (InfoDr == null)
     {
         Function.ShowSysMsg(0, "<li>所属内容不存在或已经被删除</li>");
     }
     if (!IsPostBack)
     {
         Bind();
         SetListItem();
     }
 }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request.QueryString["ModelId"]))
        {
            try
            {
                ModelId = int.Parse(Request.QueryString["ModelId"]);
            }
            catch { }
        }

        if (!Page.IsPostBack)
        {
            MInfoModel = BInfoModel.GetModel(ModelId);
            txtModelHtml.Text = MInfoModel.ModelHtml;

            DataTable dt = new DataTable();
            dt = BModelField.GetList(ModelId);
            StringBuilder sb = new StringBuilder();

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (i == dt.Rows.Count - 1)
                    {
                        sb.Append("<tr>\r\n<td align=\"right\" class=\"bqleft\">" + dt.Rows[i]["Alias"].ToString() + ":</td>\r\n<td class=\"bqright\">" + GetShowStyle(dt.Rows[i]["Name"].ToString(), dt.Rows[i]["IsNotNull"].ToString(), dt.Rows[i]["Type"].ToString(), dt.Rows[i]["Content"].ToString(), dt.Rows[i]["Description"].ToString()) + "</td>\r\n</tr>");
                    }
                    else
                    {
                        sb.Append("<tr>\r\n<td align=\"right\" class=\"bqleft\">" + dt.Rows[i]["Alias"].ToString() + ":</td>\r\n<td class=\"bqright\">" + GetShowStyle(dt.Rows[i]["Name"].ToString(), dt.Rows[i]["IsNotNull"].ToString(), dt.Rows[i]["Type"].ToString(), dt.Rows[i]["Content"].ToString(), dt.Rows[i]["Description"].ToString()) + "</td>\r\n</tr>\r\n");
                    }
                }

                SysModelHtml.Text = sb.ToString();
            }
        }
    }
Exemplo n.º 8
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string modelName = txtModelName.Text.Trim();
        if(modelName==string.Empty)
        {
            Function.ShowSysMsg(0, "<li>模型名称必须填写</li><li><a href='javascript:history.back();'>返回上一页</a></li>");
        }
        string tableName = txtTableName.Text.Trim();
        if(tableName==string.Empty)
        {
            Function.ShowSysMsg(0, "<li>表名称必须填写</li><li><a href='javascript:history.back();'>返回上一页</a></li>");
        }
        string patt = "^[a-zA-Z0-9]+$";
        if(!Regex.IsMatch(tableName,patt,RegexOptions.IgnoreCase))
        {
            Function.ShowSysMsg(0, "<li>表名称必须由字母或数字组成</li><li><a href='javascript:history.back();'>返回上一页</a></li>");
        }
        string uploadPath = txtUploadPath.Text.Trim();
        if(uploadPath==string.Empty)
        {
             Function.ShowSysMsg(0, "<li>上传文件存放目录必须填写</li><li><a href='javascript:history.back();'>返回上一页</a></li>");
        }
        patt = "[a-zA-Z][a-zA-Z0-9]*$";
        if(!Regex.IsMatch(uploadPath,patt,RegexOptions.IgnoreCase))
        {
            Function.ShowSysMsg(0, "<li>存放目录必须以字母开头,由字母或数字组成</li><li><a href='javascript:history.back();'>返回上一页</a></li>");
        }
        string uploadSize = txtUploadSize.Text.Trim();
        if(!Function.CheckNumber(uploadSize))
        {
            Function.ShowSysMsg(0, "<li>允许上传的文件大小必须为0或正整数</li><li><a href='javascript:history.back();'>返回上一页</a></li>");
        }

        M_InfoModel infoModel = new M_InfoModel();
        infoModel.ModelId = ModelId;
        infoModel.ModelName = txtModelName.Text.Trim();
        infoModel.ModelDesc = txtModelDesc.Text.Trim();
        infoModel.TableName = litU.Text + txtTableName.Text.Trim();
        infoModel.UploadPath = txtUploadPath.Text.Trim();
        infoModel.UploadSize = int.Parse(txtUploadSize.Text.Trim());
        infoModel.ModelHtml = "";
        infoModel.IsHtml = bool.Parse(IsHtml.SelectedValue);
        if (infoModel.ModelId == 0)
        {
            bool isValidate = InfoModelBll.CheckTableValidate(infoModel.TableName);
            if (!isValidate)
            {
                Function.ShowSysMsg(0, "<li>所设置的表名已经存在</li><li><a href='javascript:history.back()'>返回上一页</a></li>");
            }

            //isValidate = InfoModelBll.CheckUploadPathValidate(infoModel.UploadPath);
            //if (!isValidate)
            //{
            //    Function.ShowSysMsg(0, "<li>所设置文件存放目录已经存在</li><li><a href='javascript:history.back()'>返回上一页</a></li>");
            //}
            InfoModelBll.Add(infoModel);
        }
        else
        {
            InfoModelBll.Update(infoModel);
            B_Channel channelBll = new B_Channel();
            channelBll.ClearCache();
        }
        Function.ShowSysMsg(1, "<li>模型设置成功</li><li><a href='infomodel/ModelList.aspx'>返回模型管理列表</a></li>");
    }
Exemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //AdminBll.CheckMulitLogin();
        //AdminModel = AdminBll.GetLoginModel();
        //AdminUserModel = AdminBll.GetModel(AdminModel.UserId);

        UserBll.CheckIsLogin();
        UserModel = UserBll.GetUser(UserBll.GetCookie().LogName);
        UserGroupModel = UserGroupBll.GetModel(UserModel.GroupID);

        if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
        {
            try
            {
                ChannelId = int.Parse(Request.QueryString["ChId"]);
            }
            catch { }
        }

        ChannelModel = ChannelId <= 0 ? null : ChannelBll.GetChannel(ChannelId);
        MInfoModel = BInfoModel.GetModel(ChannelModel.ModelType);

        if (!Page.IsPostBack)
        {
            txtTemplatePath.Attributes.Add("readonly", "");

            if (!ColumnBll.ChkHasColumnByChId(ChannelId))
            {
                Function.ShowMsg(0, "<li>本频道下没有栏目,不能添加信息!请联系站点管理员</li><li><a href='javascript:window.history.back()'>返回上一步</a></li>");
            }

            if (!string.IsNullOrEmpty(Request.QueryString["ColId"]))
            {
                try
                {
                    ColumnId = int.Parse(Request.QueryString["ColId"]);
                }
                catch { }
            }

            //litNav.Text = ChannelModel.TypeName + " 管理 &gt;&gt; <a href='InfoList.aspx?ChId=" + ChannelId + "'>站点" + ChannelModel.TypeName + "列表</a> &gt;&gt; 设置" + ChannelModel.TypeName;

            //绑定自定义字段
            ModelHtml.Text = MInfoModel.ModelHtml;

            FilePicPath.Text = MInfoModel.UploadPath + "|" + MInfoModel.UploadSize.ToString();

            TableName = MInfoModel.TableName;

            BindSpeacil();
            BindGroup();
            UserCateBound();
        }
    }
Exemplo n.º 10
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        CheckValidate();

        ChannelId = int.Parse(Request.QueryString["ChId"]);
        int sColId = int.Parse(Request.Form["ddlColId"]);
        int sId = int.Parse(Request.QueryString["Id"]);

        #region 系统字段获取值
        string sTitle = txtTitle.Text;
        string sTitleColor = txtTitleColor.Text;
        string sTitleFontType = ddlTitleFontType.SelectedValue;
        int sTitleType = 1;

        if (rbImg.Checked == true)
        {
            sTitleType = 2;
        }
        string sTitleImgPath = txtTitleImgPath.Text;
        //int sUId = AdminModel.UserId;
        //string sUName = AdminModel.LoginName;
        //string sUserType = "1";
        //int sAdminUId = AdminModel.UserId;
        //string sAdminUName = AdminModel.LoginName;
        //int sStatus = 3;
        int sHitCount = int.Parse(txtHitCount.Text);
        DateTime sAddTime = DateTime.Now;
        DateTime sUpdateTime = DateTime.Now;
        string sTemplatePath = txtTemplatePath.Text;
        int sPageType = int.Parse(rdBtnPageType.SelectedValue);

        int sIsCreated = 0;
        if (chkBoxIsCreate.Checked)
        {
            sIsCreated = 1;
        }
        int sUserCateId = 0;
        int sPointCount = int.Parse(txtPointCount.Text);
        string rdBtnChargeType = Request.Form["ChargeType"];
        int sChargeType = 0;

        if (rdBtnChargeType == "rdBtnChargeType1")
        {
            sChargeType = 1;
        }
        else if (rdBtnChargeType == "rdBtnChargeType2")
        {
            sChargeType = 2;
        }
        else if (rdBtnChargeType == "rdBtnChargeType3")
        {
            sChargeType = 3;
        }
        else if (rdBtnChargeType == "rdBtnChargeType4")
        {
            sChargeType = 4;
        }
        else if (rdBtnChargeType == "rdBtnChargeType5")
        {
            sChargeType = 5;
        }
        else if (rdBtnChargeType == "rdBtnChargeType6")
        {
            sChargeType = 6;
        }

        int sChargeHourCount = int.Parse(txtChargeHourCount.Text);
        int sChargeViewCount = int.Parse(txtChargeViewCount.Text);
        int sIsOpened = int.Parse(rdBtnIsOpened.SelectedValue);

        string sGroupIdStr = "";

        if (sIsOpened == 0)
        {
            sGroupIdStr = "|";
            foreach (ListItem li in chkBoxGroupIdStr.Items)
            {
                if (li.Selected)
                {
                    sGroupIdStr += li.Value + "|";
                }
            }
        }

        int sIsDeleted = 0;

        int sIsRecommend = 0;
        if (chkBoxIsRecommend.Checked)
        {
            sIsRecommend = 1;
        }

        int sIsTop = 0;
        if (chkBoxIsTop.Checked)
        {
            sIsTop = 1;
        }

        int sIsFocus = 0;
        if (chkBoxIsFocus.Checked)
        {
            sIsFocus = 1;
        }

        int sIsSideShow = 0;
        if (chkBoxIsSideShow.Checked)
        {
            sIsSideShow = 1;
        }

        #region 关键字
        string sTagIdStr = string.Empty;
        string sTagNameStr = txtTagNameStr.Text.Trim();
        sTagNameStr = Regex.Replace(sTagNameStr, @"\s+", "|", RegexOptions.IgnoreCase);
        if (sTagNameStr.Length != 0)
        {
            if (sTagNameStr.StartsWith("|"))
                sTagNameStr = sTagNameStr.Substring(1, sTagNameStr.Length - 1);
            if (sTagNameStr.EndsWith("|"))
                sTagNameStr = sTagNameStr.Substring(0, sTagNameStr.Length - 1);
            B_Tag tagBll = new B_Tag();
            DataRow dr = tagBll.AddTagStr(sTagNameStr, ChannelModel.ModelType, 0, "后台管理员");
            if (dr != null)
            {
                sTagIdStr = "|" + dr[0] + "|";
                sTagNameStr = "|" + dr[1] + "|";
            }
            else
            {
                sTagIdStr = "";
                sTagNameStr = "";
            }
        }
        #endregion

        int sIsAllowComment = 0;
        if (chkBoxIsAllowComment.Checked)
        {
            sIsAllowComment = 1;
        }

        string idStr = "";
        string sSpecialIdStr = "";
        for (int i = 0; i < lBoxTopicIdStr.Items.Count; i++)
        {
            if (lBoxTopicIdStr.Items[i].Selected)
            {
                idStr += lBoxTopicIdStr.Items[i].Value + "|";
            }
        }
        if (idStr != "")
        {
            sSpecialIdStr = "|" + idStr;
        }

        //if (sIsCreated)
        //{
        //}
        #endregion

        //获取表字段
        ChannelModel = ChannelId <= 0 ? null : ChannelBll.GetChannel(ChannelId);
        MInfoModel = BInfoModel.GetModel(ChannelModel.ModelType);

        //定义DataTable
        DataTable dt = new DataTable();
        dt.Columns.Add(new DataColumn("FieldName", typeof(string)));
        dt.Columns.Add(new DataColumn("FieldValue", typeof(string)));

        #region
        DataRow dr99 = dt.NewRow();
        dr99[0] = "Id";
        dr99[1] = sId;
        dt.Rows.Add(dr99);

        DataRow dr0 = dt.NewRow();
        dr0[0] = "ColId";
        dr0[1] = sColId;
        dt.Rows.Add(dr0);

        DataRow dr1 = dt.NewRow();
        dr1[0] = "Title";
        dr1[1] = sTitle;
        dt.Rows.Add(dr1);

        DataRow dr2 = dt.NewRow();
        dr2[0] = "TitleColor";
        dr2[1] = sTitleColor;
        dt.Rows.Add(dr2);

        DataRow dr3 = dt.NewRow();
        dr3[0] = "TitleFontType";
        dr3[1] = sTitleFontType;
        dt.Rows.Add(dr3);

        DataRow dr4 = dt.NewRow();
        dr4[0] = "TitleType";
        dr4[1] = sTitleType;
        dt.Rows.Add(dr4);

        DataRow dr5 = dt.NewRow();
        dr5[0] = "TitleImgPath";
        dr5[1] = sTitleImgPath;
        dt.Rows.Add(dr5);

        //DataRow dr6 = dt.NewRow();
        //dr6[0] = "UId";
        //dr6[1] = sUId;
        //dt.Rows.Add(dr6);

        //DataRow dr7 = dt.NewRow();
        //dr7[0] = "UName";
        //dr7[1] = sUName;
        //dt.Rows.Add(dr7);

        //DataRow dr8 = dt.NewRow();
        //dr8[0] = "UserType";
        //dr8[1] = sUserType;
        //dt.Rows.Add(dr8);

        //DataRow dr9 = dt.NewRow();
        //dr9[0] = "AdminUId";
        //dr9[1] = sAdminUId;
        //dt.Rows.Add(dr9);

        //DataRow dr10 = dt.NewRow();
        //dr10[0] = "AdminUName";
        //dr10[1] = sAdminUName;
        //dt.Rows.Add(dr10);

        //DataRow dr11 = dt.NewRow();
        //dr11[0] = "Status";
        //dr11[1] = sStatus;
        //dt.Rows.Add(dr11);

        DataRow dr12 = dt.NewRow();
        dr12[0] = "HitCount";
        dr12[1] = sHitCount;
        dt.Rows.Add(dr12);

        DataRow dr13 = dt.NewRow();
        dr13[0] = "AddTime";
        dr13[1] = sAddTime;
        dt.Rows.Add(dr13);

        DataRow dr14 = dt.NewRow();
        dr14[0] = "UpdateTime";
        dr14[1] = sUpdateTime;
        dt.Rows.Add(dr14);

        DataRow dr15 = dt.NewRow();
        dr15[0] = "TemplatePath";
        dr15[1] = sTemplatePath;
        dt.Rows.Add(dr15);

        DataRow dr16 = dt.NewRow();
        dr16[0] = "PageType";
        dr16[1] = sPageType;
        dt.Rows.Add(dr16);

        DataRow dr17 = dt.NewRow();
        dr17[0] = "IsCreated";
        dr17[1] = sIsCreated;
        dt.Rows.Add(dr17);

        DataRow dr18 = dt.NewRow();
        dr18[0] = "UserCateId";
        dr18[1] = sUserCateId;
        dt.Rows.Add(dr18);

        DataRow dr19 = dt.NewRow();
        dr19[0] = "PointCount";
        dr19[1] = sPointCount;
        dt.Rows.Add(dr19);

        DataRow dr20 = dt.NewRow();
        dr20[0] = "ChargeType";
        dr20[1] = sChargeType;
        dt.Rows.Add(dr20);

        DataRow dr21 = dt.NewRow();
        dr21[0] = "ChargeHourCount";
        dr21[1] = sChargeHourCount;
        dt.Rows.Add(dr21);

        DataRow dr22 = dt.NewRow();
        dr22[0] = "ChargeViewCount";
        dr22[1] = sChargeViewCount;
        dt.Rows.Add(dr22);

        DataRow dr23 = dt.NewRow();
        dr23[0] = "IsOpened";
        dr23[1] = sIsOpened;
        dt.Rows.Add(dr23);

        DataRow dr24 = dt.NewRow();
        dr24[0] = "GroupIdStr";
        dr24[1] = sGroupIdStr;
        dt.Rows.Add(dr24);

        DataRow dr25 = dt.NewRow();
        dr25[0] = "IsDeleted";
        dr25[1] = sIsDeleted;
        dt.Rows.Add(dr25);

        DataRow dr26 = dt.NewRow();
        dr26[0] = "IsRecommend";
        dr26[1] = sIsRecommend;
        dt.Rows.Add(dr26);

        DataRow dr27 = dt.NewRow();
        dr27[0] = "IsTop";
        dr27[1] = sIsTop;
        dt.Rows.Add(dr27);

        DataRow dr28 = dt.NewRow();
        dr28[0] = "IsFocus";
        dr28[1] = sIsFocus;
        dt.Rows.Add(dr28);

        DataRow dr29 = dt.NewRow();
        dr29[0] = "IsSideShow";
        dr29[1] = sIsSideShow;
        dt.Rows.Add(dr29);

        DataRow dr30 = dt.NewRow();
        dr30[0] = "TagIdStr";
        dr30[1] = sTagIdStr;
        dt.Rows.Add(dr30);

        DataRow dr31 = dt.NewRow();
        dr31[0] = "TagNameStr";
        dr31[1] = sTagNameStr;
        dt.Rows.Add(dr31);

        DataRow dr32 = dt.NewRow();
        dr32[0] = "IsAllowComment";
        dr32[1] = sIsAllowComment;
        dt.Rows.Add(dr32);

        DataRow dr33 = dt.NewRow();
        dr33[0] = "SpecialIdStr";
        dr33[1] = sSpecialIdStr;
        dt.Rows.Add(dr33);
        #endregion

        //以下是自动添加字段获得值
        DataTable dt1 = new DataTable();
        dt1 = BModelField.GetList(ChannelModel.ModelType);

        for (int i = 0; i < dt1.Rows.Count; i++)
        {
            DataRow dr = dt.NewRow();
            dr[0] = dt1.Rows[i]["Name"].ToString();

            //联动获取数据开始
            //二级联动
            if (dt1.Rows[i]["Type"].ToString() == "ErLinkageType")
            {
                dr[1] = Request.Form["txt_" + dt1.Rows[i]["Name"].ToString()];
                dt.Rows.Add(dr);

                dr = dt.NewRow();
                dr[0] = dt1.Rows[i]["Name"].ToString() + "_Id";
                dr[1] = Request.Form["txt_" + dt1.Rows[i]["Name"].ToString() + "_Id"];
                dt.Rows.Add(dr);

                string SmallName = BModelField.GetFieldContent(dt1.Rows[i]["Content"].ToString(), 2, 1);
                dr = dt.NewRow();
                dr[0] = SmallName;
                dr[1] = Request.Form["txt_" + SmallName];
                dt.Rows.Add(dr);

                dr = dt.NewRow();
                dr[0] = SmallName + "_Id";
                dr[1] = Request.Form["txt_" + SmallName + "_Id"];
                dt.Rows.Add(dr);
            }
            else
            {
                switch (dt1.Rows[i]["Type"].ToString())
                {
                    case "ListBoxType":
                        if (Request.Form["txt_" + dt1.Rows[i]["Name"].ToString() + ""] == "" || Request.Form["txt_" + dt1.Rows[i]["Name"].ToString() + ""] == null)
                        {
                            dr[1] = Request.Form["txt_" + dt1.Rows[i]["Name"].ToString() + ""];
                        }
                        else
                        {
                            dr[1] = Request.Form["txt_" + dt1.Rows[i]["Name"].ToString() + ""].Replace(" ", "").ToString();
                        }
                        dr[1] = "," + dr[1] + ",";
                        break;
                    case "MultipleTextType":
                        dr[1] = Request.Form["txt_" + dt1.Rows[i]["Name"].ToString() + ""];
                        break;
                    default:
                        dr[1] = Request.Form["txt_" + dt1.Rows[i]["Name"].ToString() + ""];
                        break;
                }

                dt.Rows.Add(dr);
            }
        }

        //添加信息
        BInfoModel.UpdateInfoModel(dt, MInfoModel.TableName);
        if(chkBoxIsCreate.Checked)
        {
            DataRow dr = CreateBll.GetInfoById(MInfoModel.TableName, Id);
            CreateBll.CreateSingleInfo(dr);
        }
        Function.ShowSysMsg(1, "<li>成功修改信息</li><li><a href='info/InfoList.aspx?ChId=" + ChannelId + "&ColId=" + sColId + "'>返回信息列表</a> <a href='info/UpdateInfo.aspx?ChId=" + ChannelId + "&ColId=" + sColId + "&Id="+sId+"'>重新修改</a></li>");
    }
Exemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminBll.CheckMulitLogin();
        AdminModel = AdminBll.GetLoginModel();
        AdminUserModel = AdminBll.GetModel(AdminModel.UserId);

        AjaxPro.Utility.RegisterTypeForAjax(typeof(system_info_UpdateInfo));

        if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
        {
            try
            {
                ChannelId = int.Parse(Request.QueryString["ChId"]);
            }
            catch { }
        }
        ChannelModel = ChannelId <= 0 ? null : ChannelBll.GetChannel(ChannelId);
        MInfoModel = BInfoModel.GetModel(ChannelModel.ModelType);

        Id = int.Parse(Request.QueryString["Id"]);
        if (Id > 0 && !AdminGroupBll.Power_Channel(ChannelId, ColumnId, AdminUserModel.GroupId, 3))
        {
            Function.ShowSysMsg(0, "<li>你没有该栏目下的修改权限</li>");
        }
        drInfo = BInfoOper.GetInfo(MInfoModel.TableName, Id);

        if (!Page.IsPostBack)
        {
            txtTemplatePath.Attributes.Add("readonly", "");

            if (!ColumnBll.ChkHasColumnByChId(ChannelId))
            {
                Function.ShowSysMsg(0, "<li>本频道下没有栏目,不能添加信息!</li><li>建议您先添加栏目</li><li><a href='info/SetColumn.aspx?ChId=" + ChannelId + "'>添加栏目</a> <a href='info/ColumnList.aspx?ChId=" + ChannelId + "'>栏目管理</a></li>");
            }

            if (!string.IsNullOrEmpty(Request.QueryString["ColId"]))
            {
                try
                {
                    ColumnId = int.Parse(Request.QueryString["ColId"]);
                }
                catch { }
            }

            litNav.Text = ChannelModel.TypeName + "管理 &gt;&gt; <a href='InfoList.aspx?ChId=" + ChannelId + "'>站点" + ChannelModel.TypeName + "列表</a> &gt;&gt; 设置" + ChannelModel.TypeName;

            //绑定自定义字段
            ModelHtml.Text = MInfoModel.ModelHtml;

            //DataTable dt1 = new DataTable();
           // dt1 = BModelField.GetList(ChannelModel.ModelType);

            //dt1.Clear();
            //dt1.Dispose();

            FilePicPath.Text = MInfoModel.UploadPath + "|" + MInfoModel.UploadSize.ToString();

            TableName = MInfoModel.TableName;

            BindSpeacil();
            BindGroup();

            //赋值
            GetShow();
        }
    }
Exemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        lbMessageBox.Text = "";
        UserBll.CheckIsLogin();
        LoginModel = UserBll.GetCookie();
        UserModel = UserBll.GetUser(LoginModel.UserID);
        UserGroupModel = UserGroupBll.GetModel(UserModel.GroupID);
        if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
        {
            try
            {
                ChId = int.Parse(Request.QueryString["ChId"]);
            }
            catch { }
        }
        ChannelModel = ChannelBll.GetChannel(ChId);
        if (ChannelModel == null)
        {
            return;
        }
        InfoModel = InfoModelBll.GetModel(ChannelModel.ModelType);
        if (InfoModel == null)
        {
            return;
        }
        hylnkSetInfo.Text = "添加" + ChannelModel.TypeName;
        switch (InfoModel.ModelId)
        {
            default:
                hylnkSetInfo.NavigateUrl = "AddInfo.aspx?ChId=" + ChId;
                break;
            case 1:
                hylnkSetInfo.NavigateUrl = "SetArticle.aspx?ChId=" + ChId;
                break;
            case 2:
                hylnkSetInfo.NavigateUrl = "SetImage.aspx?ChId=" + ChId;
                break;
            case 3:
                hylnkSetInfo.NavigateUrl = "SetDownLoad.aspx?ChId=" + ChId;
                break;
        }
        if (!string.IsNullOrEmpty(Request.QueryString["Status"]))
        {
            string statusText = Request.QueryString["Status"].ToLower();
            if (statusText == "all" || statusText == string.Empty)
            {
                Status = "-99";
            }
            else if (statusText == "rec")
            {
                Status = "-1";
            }
            else if (statusText == "wait")
            {
                Status = "0,1,2";
            }
            else if (statusText == "yes")
            {
                Status = "3";
            }
            else if (statusText == "no")
            {
                Status = "-2";
            }
        }

        if (!string.IsNullOrEmpty(Request.QueryString["UserCateId"]))
        {
            try
            {
                UserCateId = int.Parse(Request.QueryString["UserCateId"]);
            }
            catch { }
        }

        #region 获取搜索字段
        if (!string.IsNullOrEmpty(Request.QueryString["FieldName"]))
        {
            FieldName = Request.QueryString["FieldName"];
        }
        if (!string.IsNullOrEmpty(Request.QueryString["Keyword"]))
        {
            Keyword = Request.QueryString["Keyword"].Trim();
            if (!IsPostBack)
            {
                txtKeyword.Text = Keyword;
            }
        }
        #endregion

        if (!IsPostBack)
        {
            InitProperty();
            Bind();
            BindUserCate();
            ddlsortName.Items[0].Text = ChannelModel.TypeName + "标题";
            if (gvInfoList.Rows.Count > 0)
                gvInfoList.HeaderRow.Cells[2].Text = ChannelModel.TypeName + "标题";
        }
    }
Exemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminBll.CheckMulitLogin();
        AdminModel = AdminBll.GetLoginModel();
        AdminUserModel = AdminBll.GetModel(AdminModel.UserId);

        litMsg.Text = "";
        SiteModel = SiteBll.GetSiteModel();
        InfoSiteModel = SiteBll.GetInfoModel();
        if (SiteModel == null)
        {
            Function.ShowSysMsg(0, "<li>全站参数获取错误</li>");
        }
        txtTemplatePath.Attributes.Add("readonly", "");
        txtUpdateDateTime.Attributes.Add("readonly", "");
        txtHeaderColor.Attributes.Add("readonly", "");
        txtViewer.Attributes.Add("readonly", "");
        HistoryTime = InfoSiteModel.HistoryTime;
        if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
        {
            try
            {
                ChannelId = int.Parse(Request.QueryString["ChId"]);
            }
            catch { }
        }
        if (!ColumnBll.ChkHasColumnByChId(ChannelId))
        {
            Function.ShowSysMsg(0, "<li>本频道下没有栏目,不能添加信息</li><li>建议您先添加栏目</li><li><a href='info/SetColumn.aspx?ChId=" + ChannelId + "'>添加栏目</a> <a href='info/ColumnList.aspx?ChId=" + ChannelId + "'>栏目管理</a></li>");
        }
        ChannelModel = ChannelId <= 0 ? null : ChannelBll.GetChannel(ChannelId);
        if (ChannelModel == null || ChannelModel.ModelType != 1)
        {
            Function.ShowSysMsg(0, "<li>频道参数错误</li>");
        }
        //保存路径
        InfoModel = InfoModelBll.GetModel(ChannelModel.ModelType);
        FilePicPath.Text = InfoModel.UploadPath + "|" + InfoModel.UploadSize.ToString();
        if (!string.IsNullOrEmpty(Request.QueryString["ColId"]))
        {
            try
            {
                ColumnId = int.Parse(Request.QueryString["ColId"]);
            }
            catch { }
        }
        ColumnModel = ColumnId <= 0 ? null : ColumnBll.GetColumn(ColumnId);
        if (ColumnId > 0 && ColumnModel == null)
        {
            Function.ShowSysMsg(0, "<li>所选栏目不存在或已经被删除</li>");
        }

        if (Request.QueryString["Id"] != null && Request.QueryString["Id"] != "")
        {
            try
            {
                ArticleId = int.Parse(Request.QueryString["Id"]);
            }
            catch { }
        }
        if (ArticleId > 0 && !AdminGroupBll.Power_Channel(ChannelId, ColumnId, AdminUserModel.GroupId, 3))
        {
            Function.ShowSysMsg(0, "<li>你没有该栏目下的修改权限</li>");
        }
        if (!IsPostBack)
        {
            txtUpdateDateTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
            if (HistoryTime == 0)
            {
                txtExpireTime.Text = "9999-01-01";
            }
            else
            {
                txtExpireTime.Text = DateTime.Now.AddDays(HistoryTime).ToString("yyyy-MM-dd");
            }
            for (int i = 0; i <= 20; i++)
            {
                ddlHeaderSize.Items.Add(new ListItem(i + "px", i + "px"));
                ddlHeaderSize.SelectedValue = "12px";
            }
            if (ArticleId > 0)
                litNav.Text = "<a href='ColumnList.aspx?Chid=" + ChannelId + "'>" + ChannelModel.ChName + "</a> &gt;&gt; 修改" + ChannelModel.TypeName;
            else
                litNav.Text = "<a href='ColumnList.aspx?Chid=" + ChannelId + "'>" + ChannelModel.ChName + "</a> &gt;&gt; 添加" + ChannelModel.TypeName;
            BindSpeacil();
            BindGroup();
            if (ArticleId > 0)
            {
                ShowInfo(ArticleId);
            }
        }
    }
Exemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminGroupBll.Power_Judge(35);
        if (!string.IsNullOrEmpty(Request.QueryString["ModelId"]))
        {
            try
            {
                ModelId = int.Parse(Request.QueryString["ModelId"]);
            }
            catch { }

            try
            {
                FieldId = int.Parse(Request.QueryString["FieldId"]);
            }
            catch { }
        }

        infoModel = InfoModelBll.GetModel(ModelId);

        if (!Page.IsPostBack)
        {

            if (ModelId != 0)
            {

                if (infoModel == null)
                {
                    Function.ShowSysMsg(0, "<li>模型不存在或已经被删除</li><li><a href='infomodel/ModelList.aspx'>返回模型管理列表</a></li>");
                }

                if (infoModel.IsSystem)
                {
                    Function.ShowSysMsg(0, "<li>系统模型不允许列出字段</li><li><a href='infomodel/ModelList.aspx'>返回模型管理列表</a></li>");
                }
            }

            ModelName.Text = infoModel.ModelName;
            ErLinkage_Value.Attributes.Add("readonly", "");
            ErLinkage_Value_Show.Attributes.Add("readonly", "");
            SanLinkage_Value.Attributes.Add("readonly", "");

            GetShow();
        }
    }
Exemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminBll.CheckMulitLogin();
        M_LoginAdmin loginAdminModel = AdminBll.GetLoginModel();
        AdminModel = AdminBll.GetModel(loginAdminModel.UserId);
        SiteModel = SiteBll.GetSiteModel();

        #region 频道,模型,栏目参数检验
        if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
        {
            try
            {
                ChId = int.Parse(Request.QueryString["ChId"]);
            }
            catch { }
        }
        ChannelModel = ChannelBll.GetChannel(ChId);
        if (ChannelModel == null)
        {
            Function.ShowSysMsg(0, "<li>所属频道不存在或已经被删除</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>");
        }
        InfoModel = InfoModelBll.GetModel(ChannelModel.ModelType);
        if (InfoModel == null)
        {
            Function.ShowSysMsg(0, "<li>所属模型不存在或已经被删除</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>");
        }

        if (!string.IsNullOrEmpty(Request.QueryString["ColId"]))
        {
            try
            {
                ColumnId = int.Parse(Request.QueryString["ColId"]);
            }
            catch { }
        }
        ColumnModel = ColumnBll.GetColumn(ColumnId);
        if (ColumnId != 0 && ColumnModel == null)
        {
            Function.ShowSysMsg(0, "<li>所属栏目不存在或已经被删除</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>");
        }
        #endregion

        SetNav();
        AuditingLevel = PowerGroupBll.Power_Auditing(ChId, AdminModel.GroupId);
        SetBtnStatus();

        #region 获取搜索字段
        if (!string.IsNullOrEmpty(Request.QueryString["FieldName"]))
        {
            FieldName = Request.QueryString["FieldName"];
        }
        if (!string.IsNullOrEmpty(Request.QueryString["Keyword"]))
        {
            Keyword = Request.QueryString["Keyword"].Trim();
            if (!IsPostBack)
            {
                txtKeyword.Text = Keyword;
            }
        }
        #endregion

        #region 设置审核参数
        if (!string.IsNullOrEmpty(Request.QueryString["Status"]))
        {
            string status = Request.QueryString["Status"].ToLower();
            if (status == "no")
            {
                switch (AuditingLevel)
                {
                    default: Status = "-99"; break;
                    case "1": Status = "0"; break;
                    case "2": Status = "0,1"; break;
                    case "3": Status = "0,1,2"; break;
                }
            }
            else
            {
                Status = "3";
            }
        }
        #endregion

        #region 设置投稿参数
        if (!string.IsNullOrEmpty(Request.QueryString["UserType"]))
        {
            try
            {
                UserType = int.Parse(Request.QueryString["UserType"]);
            }
            catch { }
        }
        #endregion

        if (!IsPostBack)
        {
            InitProperty();
            BindColumn();
            BindChannel();
            Bind();
            ddlsortName.Items[0].Text = ChannelModel.TypeName + "标题";
            if (gvInfoList.Rows.Count > 0)
                gvInfoList.HeaderRow.Cells[1].Text = ChannelModel.TypeName + "标题";
        }
    }
Exemplo n.º 16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetNoStore();

        if (!string.IsNullOrEmpty(Request.QueryString["ModelId"]))
        {
            try
            {
                ModelId = int.Parse(Request.QueryString["ModelId"]);
            }
            catch { }
        }

        MInfoModel = BInfoModel.GetModel(ModelId);
        ModelName.Text = MInfoModel.ModelName;
    }
Exemplo n.º 17
0
 public int Update(M_InfoModel model)
 {
     return this.dal.Update(model);
 }
Exemplo n.º 18
0
 public string GetAStr(object objInfoId)
 {
     int infoId = int.Parse(objInfoId.ToString());
     ChannelM = ChannelBll.GetChannel(Chid);
     int modelId = ChannelM.ModelType;
     InfoModelM = InfoModelBll.GetModel(modelId);                                                                                    //取得对应Id的模板信息
     string tableName = InfoModelM.TableName;                                                                                        //取得模型的表名
     DataRow dr = CreateBll.GetInfoById(tableName, infoId);
     string getUrl = CreateBll.GetInfoUrl(dr, 1);
     return getUrl;
 }
Exemplo n.º 19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //AdminBll.CheckMulitLogin();
        //AdminModel = AdminBll.GetLoginModel();
        //AdminUserModel = AdminBll.GetModel(AdminModel.UserId);
        AjaxPro.Utility.RegisterTypeForAjax(typeof(user_info_UpdateInfo));

        UserBll.CheckIsLogin();
        UserModel = UserBll.GetUser(UserBll.GetCookie().LogName);
        UserGroupModel = UserGroupBll.GetModel(UserModel.GroupID);

        if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
        {
            try
            {
                ChannelId = int.Parse(Request.QueryString["ChId"]);
            }
            catch { }
        }

        ChannelModel = ChannelId <= 0 ? null : ChannelBll.GetChannel(ChannelId);
        MInfoModel = BInfoModel.GetModel(ChannelModel.ModelType);

        Id = int.Parse(Request.QueryString["Id"]);
        drInfo = BInfoOper.GetInfo(MInfoModel.TableName, Id);

        if (!Page.IsPostBack)
        {
            txtTemplatePath.Attributes.Add("readonly", "");

            if (!ColumnBll.ChkHasColumnByChId(ChannelId))
            {
                Function.ShowMsg(0, "<li>本频道下没有栏目,不能添加信息!</li><li>建议您先添加栏目</li><li><a href='info/SetColumn.aspx?ChId=" + ChannelId + "'>添加栏目</a> <a href='info/ColumnList.aspx?ChId=" + ChannelId + "'>栏目管理</a></li>");
            }

            if (!string.IsNullOrEmpty(Request.QueryString["ColId"]))
            {
                try
                {
                    ColumnId = int.Parse(Request.QueryString["ColId"]);
                }
                catch { }
            }

            //litNav.Text = ChannelModel.TypeName + " 管理 &gt;&gt; <a href='InfoList.aspx?ChId=" + ChannelId + "'>站点" + ChannelModel.TypeName + "列表</a> &gt;&gt; 设置" + ChannelModel.TypeName;

            //绑定自定义字段
            ModelHtml.Text = MInfoModel.ModelHtml;

            FilePicPath.Text = MInfoModel.UploadPath + "|" + MInfoModel.UploadSize.ToString();

            TableName = MInfoModel.TableName;

            BindSpeacil();
            BindGroup();
            UserCateBound();

            //赋值
            GetShow();
        }
    }
Exemplo n.º 20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminBll.CheckMulitLogin();
        AdminModel = AdminBll.GetLoginModel();
        AdminUserModel = AdminBll.GetModel(AdminModel.UserId);

        if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
        {
            try
            {
                ChannelId = int.Parse(Request.QueryString["ChId"]);
            }
            catch { }
        }

        ChannelModel = ChannelId <= 0 ? null : ChannelBll.GetChannel(ChannelId);
        MInfoModel = BInfoModel.GetModel(ChannelModel.ModelType);

        if (!Page.IsPostBack)
        {
            txtTemplatePath.Attributes.Add("readonly", "");

            if (!ColumnBll.ChkHasColumnByChId(ChannelId))
            {
                Function.ShowSysMsg(0, "<li>本频道下没有栏目,不能添加信息!</li><li>建议您先添加栏目</li><li><a href='info/SetColumn.aspx?ChId=" + ChannelId + "'>添加栏目</a> <a href='info/ColumnList.aspx?ChId=" + ChannelId + "'>栏目管理</a></li>");
            }

            if (!string.IsNullOrEmpty(Request.QueryString["ColId"]))
            {
                try
                {
                    ColumnId = int.Parse(Request.QueryString["ColId"]);
                }
                catch { }
            }

            litNav.Text = ChannelModel.TypeName + "管理 &gt;&gt; <a href='InfoList.aspx?ChId=" + ChannelId + "'>站点" + ChannelModel.TypeName + "列表</a> &gt;&gt; 设置" + ChannelModel.TypeName;

            //绑定自定义字段
            ModelHtml.Text = MInfoModel.ModelHtml;

            FilePicPath.Text = MInfoModel.UploadPath + "|" + MInfoModel.UploadSize.ToString();

            TableName = MInfoModel.TableName;

            BindSpeacil();
            BindGroup();
        }
    }
Exemplo n.º 21
0
        public bool AddCollectionData(string contentAddress, M_Collection collectionM)
        {
            bool flag = true;
            string fieldName = string.Empty;
            string fieldValue = string.Empty;
            string tableName = string.Empty;
            string content = this.GetContent(contentAddress, collectionM);
            this.ColumnM = this.ColumnBll.GetColumn(collectionM.ColId);
            this.ChannelM = this.ChannelBll.GetChannel(this.ColumnM.ChId);
            this.ModelM = this.InfoModelBll.GetModel(this.ChannelM.ModelType);
            tableName = this.ModelM.TableName.Replace("\"", "");
            fieldName = content.Split(new char[] { '┃' })[0].ToString();
            fieldValue = content.Split(new char[] { '┃' })[1].ToString();
            fieldName = fieldName.Substring(0, fieldName.Length - 1);
            string str5 = ",colid,uid,usertype,adminuid,updatetime,IsRecommend,IsFocus,IsSideShow,IsTop,isAllowComment,IsCreated,HitCount,TemplatePath,SpecialIdStr,Status";
            string str6 = ",expiretime,IsIrregular,IsHeader,StarLevel";
            if (this.ModelM.ModelId == 1)
            {
                fieldName = fieldName + str5 + str6;
            }
            else
            {
                fieldName = fieldName + str5;
            }
            fieldValue = fieldValue.Substring(0, fieldValue.Length - 1);
            fieldValue = ((string.Concat(new object[] { fieldValue, "$", collectionM.ColId, "$" }) + "0$") + "1$" + "0$") + DateTime.Now.ToString() + "$";
            string str7 = "0$";
            string str8 = "0$";
            string str9 = "0$";
            string str10 = "0$";
            string str11 = "0$";
            string str12 = "0$";
            string str13 = "0$";
            string str14 = "0$";
            string proterySet = collectionM.ProterySet;
            if (proterySet != "")
            {
                string[] strArray = proterySet.Split(new char[] { ',' });
                for (int i = 0; i < (strArray.Length - 1); i++)
                {
                    switch (int.Parse(strArray[i].ToString()))
                    {
                        case 0:
                            str7 = "1$";
                            break;

                        case 1:
                            str8 = "1$";
                            break;

                        case 2:
                            str9 = "1$";
                            break;

                        case 3:
                            str10 = "1$";
                            break;

                        case 4:
                            str11 = "1$";
                            break;

                        case 5:
                            str12 = "1$";
                            break;

                        case 6:
                            str13 = "1$";
                            break;

                        case 7:
                            str14 = "1$";
                            break;
                    }
                }
            }
            fieldValue = ((((fieldValue + str7 + str8 + str10 + str11 + str13 + str14) + collectionM.HiteCount + "$") + this.ColumnM.InfoTemplatePath + "$") + collectionM.SpecialId + "$") + "3";
            if (this.ModelM.ModelId == 1)
            {
                fieldValue = (string.Concat(new object[] { fieldValue, "$", DateTime.Now.AddDays(500000.0), "$" }) + str12) + str9 + collectionM.StarLevel;
            }
            try
            {
                this.CollectionData(tableName, fieldName, fieldValue);
            }
            catch
            {
                flag = false;
            }
            return flag;
        }
Exemplo n.º 22
0
        private string GetContent(M_Collection collectionM, string contentStr)
        {
            this.ColumnM = this.ColumnBll.GetColumn(collectionM.ColId);
            this.ChannelM = this.ChannelBll.GetChannel(this.ColumnM.ChId);
            this.ModelM = this.InfoModelBll.GetModel(this.ChannelM.ModelType);
            this.SiteModel = this.SiteBll.GetSiteModel();
            B_ConvertImage image = new B_ConvertImage(this.SiteModel.Domain, this.ModelM.UploadPath);
            string simpleFilterRule = collectionM.SimpleFilterRule;
            string pattern = string.Empty;
            string complexityFilterRule = collectionM.ComplexityFilterRule;
            if (complexityFilterRule != "")
            {
                string[] strArray = complexityFilterRule.Split(new char[] { ',' });
                for (int i = 0; i < strArray.Length; i++)
                {
                    this.SuperiorM = this.SuperiorBll.GetIdBySuperior(int.Parse(strArray[i].ToString()));
                    pattern = this.TransferStr(this.SuperiorM.StartCode) + "((?:.|\n)*?)" + this.TransferStr(this.SuperiorM.EndCode);
                    contentStr = this.SuperiorHtml(contentStr, pattern);
                }
            }
            if (simpleFilterRule != "")
            {
                string[] strArray2 = simpleFilterRule.Split(new char[] { ',' });
                for (int j = 0; j < (strArray2.Length - 1); j++)
                {
                    switch (int.Parse(strArray2[j].ToString()))
                    {
                        case 0:
                            contentStr = this.FilterObject(contentStr);
                            break;

                        case 1:
                            contentStr = this.FilterScript(contentStr);
                            break;

                        case 2:
                            contentStr = this.FilterStyle(contentStr);
                            break;

                        case 3:
                            contentStr = this.FilterDiv(contentStr);
                            break;

                        case 4:
                            contentStr = this.FilterSpan(contentStr);
                            break;

                        case 5:
                            contentStr = this.FilterTableProtery(contentStr);
                            break;

                        case 6:
                            contentStr = this.FilterImg(contentStr);
                            break;

                        case 7:
                            contentStr = this.FilterFont(contentStr);
                            break;

                        case 8:
                            contentStr = this.FilterA(contentStr);
                            break;

                        case 9:
                            contentStr = this.RemoveHtml(contentStr);
                            break;
                    }
                }
            }
            contentStr = image.ConvertLocalImagePath(contentStr);
            contentStr = image.ConvertContent(contentStr);
            return contentStr;
        }
Exemplo n.º 23
0
    private string GetContent(string obj)
    {
        int recrodCount = 0;
        string styleContent = string.Empty;
        string returnValue = obj;
        string[] styleArr = null;
        ChannelM = ChannelBll.GetChannel(Chid);
        if (ChannelM != null)
        {
            //标签设置的参数
            string row = string.Empty;
            string length = string.Empty;
            string style = string.Empty;
            string target = string.Empty;

            //标签参数值
            int rowValue = 0;
            int lengthValue = 0;

            //参数标识
            bool paramFlag = true;
            string errorInfo = string.Empty;

            string getValue = string.Empty;
            int modelId = ChannelM.ModelType;
            InfoModelM = InfoModelBll.GetModel(modelId);                                                                                    //取得对应Id的模板信息
            string tableName = InfoModelM.TableName;                                                                                        //取得模型的表名
            DataTable dt = AnomalyBll.GetList(Chid, 1, 20, ref recrodCount);
            styleContent = GetLabel(obj.ToString());
            styleArr = styleContent.Split('|');
            for (int i = 0; i < styleArr.Length; i++)
            {
                GetParamValue(styleArr[i], "row", ref row);
                GetParamValue(styleArr[i], "length", ref length);
                GetParamValue(styleArr[i], "style", ref style);
                GetParamValue(styleArr[i], "target", ref target);

                if (Function.CheckNumber(row) && int.Parse(row) >= 1)
                    rowValue = int.Parse(row) - 1;
                else
                {
                    paramFlag = false;
                    errorInfo = "row的参数值不是数字并且数字是大于等于一";
                }

                if (Function.CheckNumber(length) && int.Parse(length) >= 0)
                    lengthValue = int.Parse(length);
                else
                {
                    paramFlag = false;
                    errorInfo = "length的参数值不是数字并且数字是大于零";
                }

                if (paramFlag)
                {
                    if (int.Parse(row) <= dt.Rows.Count)
                    {
                        if (style != string.Empty && target != string.Empty)
                            getValue = "<a href=\"" + GetAStr(dt.Rows[rowValue]["InfoId"]) + "\" style=\"" + style + "\" target=\"" + target + "\" >" + Function.SubStr(dt.Rows[rowValue]["Title"].ToString(), lengthValue) + "</a>";
                        else if (style != string.Empty)
                            getValue = "<a href=\"" + GetAStr(dt.Rows[rowValue]["InfoId"]) + "\" style=\"" + style + "\">" + Function.SubStr(dt.Rows[rowValue]["Title"].ToString(), lengthValue) + "</a>";
                        else if (target != string.Empty)
                            getValue = "<a href=\"" + GetAStr(dt.Rows[rowValue]["InfoId"]) + "\" target=\"" + target + "\" >" + Function.SubStr(dt.Rows[rowValue]["Title"].ToString(), lengthValue) + "</a>";
                        else
                            getValue = "<a href=\"" + GetAStr(dt.Rows[rowValue]["InfoId"]) + " >" + Function.SubStr(dt.Rows[rowValue]["Title"].ToString(), lengthValue) + "</a>";
                        returnValue = returnValue.Replace(styleArr[i].ToString(), getValue);
                    }
                    else
                    {
                        returnValue = returnValue.Replace(styleArr[i].ToString(), "&nbsp;");
                    }
                }
                else
                {
                    return errorInfo;
                }
            }

        }
        return returnValue;
    }
Exemplo n.º 24
0
 public int Update(M_InfoModel model)
 {
     return this.Add(model);
 }
Exemplo n.º 25
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string tableName = ModelTable.Text.Trim();
        if (tableName == string.Empty)
        {
            Response.Write("<script language=javascript>alert('表名称必须填写');window.close();</script>");
            Response.End();
        }
        string patt = "^[a-zA-Z0-9]+$";
        if (!Regex.IsMatch(tableName, patt, RegexOptions.IgnoreCase))
        {
            Response.Write("<script language=javascript>alert('表名称必须由字母或数字组成');window.close();</script>");
            Response.End();
        }

        M_InfoModel infoModel = new M_InfoModel();
        infoModel.ModelName = MInfoModel.ModelName;
        infoModel.ModelDesc = MInfoModel.ModelDesc;
        infoModel.TableName = "Ky_U_" + tableName;
        infoModel.UploadPath = MInfoModel.UploadPath;
        infoModel.UploadSize = MInfoModel.UploadSize;
        infoModel.ModelHtml = MInfoModel.ModelHtml;

        bool isValidate = BInfoModel.CheckTableValidate(infoModel.TableName);
        if (!isValidate)
        {
            Response.Write("<script language=javascript>alert('所设置的表名已经存在');window.close();</script>");
            Response.End();
        }
        int NewModelId = BInfoModel.Add(infoModel);

        string FieldType = "nvarchar";
        string DefaultValue = "";
        DataTable dt = BModelField.GetList(ModelId);
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                switch (dt.Rows[i]["Type"].ToString())
                {
                    case "TextType":
                        FieldType = "nvarchar";
                        break;
                    case "MultipleTextType":
                        FieldType = "ntext";
                        break;
                    case "MultipleHtmlType":
                        FieldType = "ntext";
                        break;
                    case "RadioType":
                        FieldType = "nvarchar";
                        DefaultValue = BModelField.GetFieldContent(dt.Rows[i]["Content"].ToString(), 2, 1).ToString();
                        break;
                    case "ListBoxType":
                        FieldType = "nvarchar";
                        break;
                    case "NumberType":
                        FieldType = "nvarchar";
                        break;
                    default:
                        break;
                }

                MModelField.ModelId = NewModelId;
                MModelField.Name = dt.Rows[i]["Name"].ToString();
                MModelField.Alias = dt.Rows[i]["Alias"].ToString();
                //MModelField.Tips = MyTips;
                MModelField.Description = dt.Rows[i]["Description"].ToString();
                MModelField.IsNotNull = bool.Parse(dt.Rows[i]["IsNotNull"].ToString());
                MModelField.IsSearchForm = bool.Parse(dt.Rows[i]["IsSearchForm"].ToString());
                MModelField.Type = dt.Rows[i]["Type"].ToString();
                MModelField.Content = dt.Rows[i]["Content"].ToString();
                MModelField.AddDate = DateTime.Now;

                if (BModelField.IsNotField(infoModel.TableName, dt.Rows[i]["Name"].ToString()))
                {
                    BModelField.Add(MModelField);   //记录字段表
                    BModelField.AddField(infoModel.TableName, dt.Rows[i]["Name"].ToString(), FieldType, DefaultValue);  //增加字段
                }
                else
                {
                    Function.ShowSysMsg(0, "<li>该字段已经存在</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>");
                }
            }
        }

        dt.Clear();
        dt.Dispose();

        Response.Write("<script language=javascript>alert('成功复制" + MInfoModel.ModelName + "');window.dialogArguments.location.reload();window.close();</script>");
        Response.End();
    }
Exemplo n.º 26
0
 public int Add(M_InfoModel model)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@modelid", model.ModelId), new SqlParameter("@modelname", model.ModelName), new SqlParameter("@modeldesc", model.ModelDesc), new SqlParameter("@tablename", model.TableName), new SqlParameter("@uploadpath", model.UploadPath), new SqlParameter("@uploadsize", model.UploadSize), new SqlParameter("@ModelHtml", model.ModelHtml), new SqlParameter("@IsHtml", model.IsHtml) };
     return Convert.ToInt32(SqlHelper.ExecuteScalar(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_Model_Set", commandParameters));
 }
Exemplo n.º 27
0
 public void UpdateModelHtml(M_InfoModel model)
 {
     this.dal.UpdateModelHtml(model);
 }
Exemplo n.º 28
0
 public void UpdateModelHtml(M_InfoModel model)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@ModelHtml", model.ModelHtml), new SqlParameter("@ModelId", model.ModelId) };
     SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_Model_ModelHtml", commandParameters);
 }
Exemplo n.º 29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DownLoadBll.ClearDownCount();
        if (!string.IsNullOrEmpty(Request.QueryString["SId"]))
        {
            try
            {
                SId = int.Parse(Request.QueryString["SId"]);
            }
            catch { }
        }
        if (!string.IsNullOrEmpty(Request.QueryString["AId"]))
        {
            try
            {
                AId = int.Parse(Request.QueryString["AId"]);
            }
            catch { }
        }

        DataRow adr = DownAddressBll.GetAddressPath(AId,SId);
        if (adr == null)
        {
            Function.ShowMsg(0,"<li>访问的内容不存在或已经被删除</li>");
        }
        int Id = (int)adr["downloaddataid"];
        DataRow dr = CreateBll.GetInfoById("kydownloaddata", Id);
        if (dr == null)
        {
            Function.ShowMsg(0,"<li>访问的内容不存在或已经被删除</li>");
            return;
        }
        bool server_isOpened = adr["isopened"].ToString() == string.Empty ||(bool)adr["isopened"]?true:false;
        if (!server_isOpened)
        {
            Function.ShowMsg(0,"<li>所属服务器已经被管理员禁用</li>");
            return;
        }
        InfoModel = InfoModelBll.GetModel(3);
        if (InfoModel == null)
        {
            Function.ShowMsg(0,"<li>所属内容模型不存在或已经被删除</li>");
            return;
        }

        CheckUrl();
        int chId = (int)dr["chid"];
        int colId = (int)dr["colid"];
        string title = (string)dr["title"];
        int pointCount = (int)dr["pointcount"];
        int payType = (int)dr["chargetype"];
        int isOpened = (int)dr["isopened"];
        string groupIdStr = (string)dr["groupidstr"];
        bool colIsOpened = (bool)dr["colisopened"];
        int chargeHourCount = (int)dr["chargehourcount"];
        int chargViewCount = (int)dr["chargeviewcount"];
        if (pointCount > 0 || isOpened == 0 || (isOpened == 2 && !colIsOpened))
        {
            M_User userLoginModel = UserBll.GetCookie();
            M_User userModel = UserBll.GetUser(userLoginModel.UserID);
            int userId = userModel.UserID;
            string userName = userModel.LogName;
            string userGroupId = userModel.GroupID.ToString();
            decimal goldNum = userModel.YellowBoy;
            DateTime userExpirtTime = userModel.ExpireTime;
            userLoginModel = null;
            M_UserGroup userGroupModel = UserGroupBll.GetModel(userModel.GroupID);
            string powerStr = userGroupModel.ColumnPower;
            #region 继承栏目认证
            if (isOpened == 2 && !colIsOpened)
            {
                bool isAccess = UserGroupBll.Power_ColumnPower(chId, colId, powerStr, 1);
                if (!isAccess)
                {
                    Function.ShowMsg(0,"<li>您所在的用户组无法访问该内容,请联系系统管理员</li>");
                }
            }
            #endregion

            #region 内容认证
            if (isOpened == 0 && groupIdStr.IndexOf("|" + userGroupId + "|") == -1)
            {
                Function.ShowMsg(0,"<li>您所在的用户组无法访问该内容,请联系系统管理员</li>");
            }
            #endregion

            #region 收费
            if (pointCount > 0)
            {
                int reduceType = int.Parse(UserGroupBll.Power_UserGroup("ChargingType", 0, powerStr));//重复计费方式
                int dayViewCount = int.Parse(UserGroupBll.Power_UserGroup("SmashMoney", 0, powerStr));//有效期每天最大浏览次数
                string msg = string.Empty;
                bool isPay = false;//是否付费
                isPay = userLogBll.CheckIsPay(payType, ModelId, Id, userId, chargeHourCount, chargViewCount);
                if (!isPay)
                {
                    bool flag = userLogBll.CheckReducePointCondition(reduceType, userId, goldNum, pointCount, userExpirtTime, dayViewCount, ref msg);
                    if (!flag)//不满足扣费条件
                    {
                        Function.ShowMsg(0,"<li>" + msg + "</li>");
                    }
                    else
                    {
                        //flag = userLogBll.ReducePoint(reduceType,pointCount,ModelId,Id,title,userId,userExpirtTime);
                        flag = userLogBll.ReducePoint(reduceType, pointCount, ModelId, Id, title, userId, userExpirtTime, userName, dayViewCount);
                        if (!flag)
                        {
                            Function.ShowMsg(0,"<li>扣费失败</li>");
                        }
                    }
                }
                M_ViewLog viewLogModel = new M_ViewLog();
                viewLogModel.UserId = userModel.UserID;
                viewLogModel.UserName = userModel.LogName;
                viewLogModel.ModelType = 1;
                viewLogModel.InfoId = Id;
                viewLogModel.AddTime = DateTime.Now;
                viewLogBll.Add(viewLogModel);
            }
            #endregion
            DownLoadBll.SetDownCount(Id);
            Response.Redirect(GetUrl(adr));
        }
        else
        {
            DownLoadBll.SetDownCount(Id);
            Response.Redirect(GetUrl(adr));
        }
    }
Exemplo n.º 30
0
 public M_InfoModel GetModel(int modelId)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@modelid", modelId) };
     DataTable table = SqlHelper.ExecuteTable(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_Model_GetInfo", commandParameters);
     if ((table != null) && (table.Rows.Count > 0))
     {
         DataRow row = table.Rows[0];
         M_InfoModel model = new M_InfoModel();
         model.ModelId = (int) row["ModelId"];
         model.ModelName = row["ModelName"].ToString();
         model.ModelDesc = row["ModelDesc"].ToString();
         model.TableName = row["TableName"].ToString();
         model.UploadPath = row["UploadPath"].ToString();
         model.UploadSize = (int) row["UploadSize"];
         model.IsSystem = (bool) row["IsSystem"];
         model.AddTime = (DateTime) row["AddTime"];
         model.ModelHtml = row["ModelHtml"].ToString();
         model.IsHtml = (bool) row["IsHtml"];
         return model;
     }
     return null;
 }