Exemplo n.º 1
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.º 2
0
 public int Add(M_Channel model)
 {
     B_Log.Add(LogType.Add, "添加频道:" + model.ChName);
     int num = this.dal.Add(model);
     this.ClearCache();
     return num;
 }
Exemplo n.º 3
0
    public void BindTable(int colid)
    {
        ColumnM = ColumnBll.GetColumn(colid);
        ChannelM = ChannelBll.GetChannel(ColumnM.ChId);
        DataTable dt = new DataTable();
        switch (ChannelM.ModelType)
        {
            case 1:
                dt = SysModelField.CollArticleDt();
                break;
            case 2:
                dt = SysModelField.CollImageDt();
                break;
            case 3:
                dt = SysModelField.CollDownLoadDt();
                break;
            default:
                dt = BModelField.GetList(ChannelM.ModelType);
                DataRow dr = dt.NewRow();
                dr["Alias"] = "标题";
                dr["Name"] = "Title";
                dt.Rows.InsertAt(dr, 0);

                DataRow dr2 = dt.NewRow();
                dr2["Alias"] = "录入者";
                dr2["Name"] = "UName";
                dt.Rows.InsertAt(dr2,1);

                DataRow dr3 = dt.NewRow();
                dr3["Alias"] = "责任编辑";
                dr3["Name"] = "AdminUName";
                dt.Rows.InsertAt(dr3,2);

                DataRow dr4 = dt.NewRow();
                dr4["Alias"] = "添加日期";
                dr4["Name"] = "AddTime";
                dt.Rows.InsertAt(dr4,3);
                break;
        }
        lbFildList.DataSource = dt;
        lbFildList.DataTextField = "Alias";
        lbFildList.DataValueField = "Name";
        lbFildList.DataBind();
    }
Exemplo n.º 4
0
 public M_Channel GetChannel(int id, int isDeleted)
 {
     M_Channel channel = new M_Channel();
     DataRow[] rowArray = this.GetAll().Select(string.Concat(new object[] { "ChId=", id, "And IsDeleted=", isDeleted }));
     if (rowArray.Length > 0)
     {
         DataRow row = rowArray[0];
         channel.ChId = (int) row["ChId"];
         channel.ChName = row["ChName"].ToString();
         channel.Description = row["Description"].ToString();
         channel.TemplatePath = row["TemplatePath"].ToString();
         channel.IsChildSite = (bool) row["IsChildSite"];
         channel.ChildSiteUrl = row["ChildSiteUrl"].ToString();
         channel.IsOpenLink = (bool) row["IsOpenLink"];
         channel.ModelType = (int) row["ModelType"];
         channel.DirName = row["DirName"].ToString();
         channel.TypeName = row["TypeName"].ToString();
         channel.TypeUnit = row["TypeUnit"].ToString();
         channel.IsDisabled = (bool) row["IsDisabled"];
         channel.IsOpened = (bool) row["IsOpened"];
         channel.GroupIdStr = row["GroupIdStr"].ToString();
         channel.VerifyType = (int) row["VerifyType"];
         channel.Notice1 = row["Notice1"].ToString();
         channel.Notice2 = row["Notice2"].ToString();
         channel.Keyword = row["Keyword"].ToString();
         channel.Content = row["Content"].ToString();
         channel.MiniHitCount = (int) row["MiniHitCount"];
         channel.IsStaticType = (bool) row["IsStaticType"];
         channel.ColumnSortType = (int) row["ColumnSortType"];
         channel.InfoSortType = (int) row["InfoSortType"];
         channel.FileNameType = (int) row["FileNameType"];
         channel.ChannelPageType = (int) row["ChannelPageType"];
         channel.ColumnPageType = (int) row["ColumnPageType"];
         channel.InfoPageType = (int) row["InfoPageType"];
         channel.AddTime = (DateTime) row["AddTime"];
         channel.Sort = (int) row["Sort"];
         channel.ColumnTemplatePath = row["ColumnTemplatePath"].ToString();
         channel.InfoTemplatePath = row["InfoTemplatePath"].ToString();
         channel.CommentTemplatePath = row["CommentTemplatePath"].ToString();
         channel.ChType = (row["ChType"].ToString() == string.Empty) ? 0 : int.Parse(row["ChType"].ToString());
         return channel;
     }
     return null;
 }
Exemplo n.º 5
0
 public int Add(M_Channel model)
 {
     SqlParameter[] commandParameters = new SqlParameter[] {
         new SqlParameter("@ChName", SqlDbType.NVarChar), new SqlParameter("@Description", SqlDbType.NVarChar), new SqlParameter("@TemplatePath", SqlDbType.NVarChar), new SqlParameter("@IsChildSite", SqlDbType.Bit, 1), new SqlParameter("@ChildSiteUrl", SqlDbType.NVarChar), new SqlParameter("@IsOpenLink", SqlDbType.Bit, 1), new SqlParameter("@ModelType", SqlDbType.Int, 4), new SqlParameter("@DirName", SqlDbType.NVarChar), new SqlParameter("@TypeName", SqlDbType.NVarChar), new SqlParameter("@TypeUnit", SqlDbType.NVarChar), new SqlParameter("@IsDisabled", SqlDbType.Bit, 1), new SqlParameter("@IsOpened", SqlDbType.Bit, 1), new SqlParameter("@GroupIdStr", SqlDbType.VarChar, 500), new SqlParameter("@VerifyType", SqlDbType.Int, 4), new SqlParameter("@Notice1", SqlDbType.NVarChar), new SqlParameter("@Notice2", SqlDbType.NVarChar),
         new SqlParameter("@Keyword", SqlDbType.NVarChar), new SqlParameter("@Content", SqlDbType.NVarChar), new SqlParameter("@MiniHitCount", SqlDbType.Int, 4), new SqlParameter("@IsStaticType", SqlDbType.Bit, 1), new SqlParameter("@ColumnSortType", SqlDbType.Int, 4), new SqlParameter("@InfoSortType", SqlDbType.Int, 4), new SqlParameter("@FileNameType", SqlDbType.Int, 4), new SqlParameter("@ChannelPageType", SqlDbType.Int, 4), new SqlParameter("@ColumnPageType", SqlDbType.Int, 4), new SqlParameter("@InfoPageType", SqlDbType.Int, 4), new SqlParameter("@AddTime", SqlDbType.DateTime), new SqlParameter("@Sort", SqlDbType.Int, 4), new SqlParameter("@ColumnTemplatePath", SqlDbType.NVarChar), new SqlParameter("@InfoTemplatePath", SqlDbType.NVarChar), new SqlParameter("@CommentTemplatePath", SqlDbType.NVarChar), new SqlParameter("@IsDeleted", SqlDbType.Bit, 1),
         new SqlParameter("@ChType", SqlDbType.Int, 4)
      };
     commandParameters[0].Value = model.ChName;
     commandParameters[1].Value = model.Description;
     commandParameters[2].Value = model.TemplatePath;
     commandParameters[3].Value = model.IsChildSite;
     commandParameters[4].Value = model.ChildSiteUrl;
     commandParameters[5].Value = model.IsOpenLink;
     commandParameters[6].Value = model.ModelType;
     commandParameters[7].Value = model.DirName;
     commandParameters[8].Value = model.TypeName;
     commandParameters[9].Value = model.TypeUnit;
     commandParameters[10].Value = model.IsDisabled;
     commandParameters[11].Value = model.IsOpened;
     commandParameters[12].Value = model.GroupIdStr;
     commandParameters[13].Value = model.VerifyType;
     commandParameters[14].Value = model.Notice1;
     commandParameters[15].Value = model.Notice2;
     commandParameters[16].Value = model.Keyword;
     commandParameters[17].Value = model.Content;
     commandParameters[18].Value = model.MiniHitCount;
     commandParameters[19].Value = model.IsStaticType;
     commandParameters[20].Value = model.ColumnSortType;
     commandParameters[21].Value = model.InfoSortType;
     commandParameters[22].Value = model.FileNameType;
     commandParameters[23].Value = model.ChannelPageType;
     commandParameters[24].Value = model.ColumnPageType;
     commandParameters[25].Value = model.InfoPageType;
     commandParameters[26].Value = model.AddTime;
     commandParameters[27].Value = model.Sort;
     commandParameters[28].Value = model.ColumnTemplatePath;
     commandParameters[29].Value = model.InfoTemplatePath;
     commandParameters[30].Value = model.CommentTemplatePath;
     commandParameters[31].Value = model.IsDeleted;
     commandParameters[32].Value = model.ChType;
     return Convert.ToInt32(SqlHelper.ExecuteScalar(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_Channel_Add", commandParameters));
 }
Exemplo n.º 6
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.º 7
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.º 8
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.º 9
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.º 10
0
 public string GetPageIdContent(string nextAddress, M_Collection collectionM, string contentRegex, string address, string contentStr, string imagePath)
 {
     string str;
     int num2;
     this.ColumnM = this.ColumnBll.GetColumn(collectionM.ColId);
     this.ChannelM = this.ChannelBll.GetChannel(this.ColumnM.ChId);
     if (collectionM.CharSet == "0")
     {
         str = "gb2312";
     }
     else
     {
         str = "utf-8";
     }
     string input = string.Empty;
     input = this.GetHtmlCode(address, str);
     int startIndex = address.LastIndexOf('.');
     string pattern = address.Insert(startIndex, "((?:.|\n)*?)");
     MatchCollection matchs = Regex.Matches(input, pattern, RegexOptions.IgnoreCase);
     string str5 = string.Empty;
     foreach (Match match in matchs)
     {
         str5 = str5 + match.Value + ",";
     }
     string[] strArray = null;
     if (str5 != "")
     {
         strArray = str5.Substring(0, str5.Length - 1).Split(new char[] { ',' });
     }
     string str6 = string.Empty;
     if ((strArray == null) && (strArray.Length == 0))
     {
         return string.Empty;
     }
     string[] strArray2 = new string[strArray.Length];
     if (strArray.Length > 0)
     {
         for (num2 = 0; num2 < strArray.Length; num2++)
         {
             int num3 = 0;
             for (int i = 0; i < strArray.Length; i++)
             {
                 if (strArray[num2] == strArray2[i])
                 {
                     num3++;
                 }
             }
             if (num3 == 0)
             {
                 strArray2[num2] = strArray[num2];
             }
         }
     }
     num2 = 0;
     while (num2 < strArray2.Length)
     {
         if (strArray2[num2] != "")
         {
             str6 = str6 + strArray2[num2] + ",";
         }
         num2++;
     }
     if (str6 != "")
     {
         strArray = str6.Substring(0, str6.Length - 1).Split(new char[] { ',' });
         for (num2 = 1; num2 < (strArray.Length - 1); num2++)
         {
             if (strArray[num2] != "")
             {
                 input = this.GetHtmlCode(strArray[num2], str);
                 contentStr = contentStr + "{Ky:PAGE}" + this.GetContent(collectionM, this.GetRegValue(contentRegex, input));
             }
         }
     }
     return contentStr;
 }
Exemplo n.º 11
0
    public DataTable GetOption(string str)
    {
        ColumnM = ColumnBll.GetColumn(int.Parse(str));
        ChannelM = ChannelBll.GetChannel(ColumnM.ChId);
        DataTable dt = new DataTable();
        switch (ChannelM.ModelType)
        {
            case 1:
                dt = SysModelField.CollArticleDt();
                break;
            case 2:
                dt = SysModelField.CollImageDt();
                break;
            case 3:
                dt = SysModelField.CollDownLoadDt();
                break;
            default:
                dt = BModelField.GetList(ChannelM.ModelType);
                DataRow dr = dt.NewRow();
                dr["Alias"] = "标题";
                dr["Name"] = "Title";
                dt.Rows.InsertAt(dr, 0);

                DataRow dr2 = dt.NewRow();
                dr2["Alias"] = "录入者";
                dr2["Name"] = "UName";
                dt.Rows.InsertAt(dr2,1);

                DataRow dr3 = dt.NewRow();
                dr3["Alias"] = "责任编辑";
                dr3["Name"] = "AdminUName";
                dt.Rows.InsertAt(dr3,2);

                DataRow dr4 = dt.NewRow();
                dr4["Alias"] = "添加日期";
                dr4["Name"] = "AddTime";
                dt.Rows.InsertAt(dr4,3);
                break;
        }
        return dt;
    }
Exemplo n.º 12
0
 public bool CreateInfo(DataRow dr)
 {
     M_Channel channel = new M_Channel();
     channel = this.ChannelBll.GetChannel(int.Parse(dr["ChId"].ToString()));
     int num = (int)dr["modelid"];
     bool isStaticType = this.SiteModel.IsStaticType;
     bool flag2 = (bool)dr["isstatictype"];
     int num2 = (int)dr["isopened"];
     bool flag3 = (bool)dr["colisopened"];
     int num3 = (int)dr["pointcount"];
     int num4 = (int)dr["pagetype"];
     int num5 = (int)dr["status"];
     string str = string.Empty;
     if (num == 1)
     {
         str = dr["viewuname"].ToString();
     }
     if ((((!isStaticType || !flag2) || ((num4 == 4) || (num5 != 3))) || (str.Length != 0)) || ((num != 3) && ((num2 == 0) || ((num2 == 2) && !flag3))))
     {
         return false;
     }
     try
     {
         if (dr["outerurl"].ToString() != string.Empty)
         {
             return false;
         }
     }
     catch
     {
     }
     string[] strArray = this.NewsFileName(dr).Split(new char[] { '|' });
     if (strArray[1] == ".aspx")
     {
         return false;
     }
     string str3 = dr["DirName"].ToString();
     string str4 = dr["coldirName"].ToString();
     int pageSize = 0;
     string templatePath = "";
     string content = "";
     string str7 = "";
     string str8 = "";
     string path = "";
     string str10 = "";
     if (channel.InfoSortType == 1)
     {
         path = Param.SiteRootPath + @"\" + str3;
         str10 = Param.SiteRootPath + @"\" + str3 + @"\" + str4;
         str7 = str3;
         str8 = str4;
     }
     else if (channel.InfoSortType == 2)
     {
         path = Param.SiteRootPath + @"\" + str3;
         str10 = Param.SiteRootPath + @"\" + str3 + @"\Html";
         str7 = str3;
         str8 = "Html";
     }
     else if (channel.InfoSortType == 3)
     {
         path = Param.SiteRootPath + @"\" + str3;
         str7 = str3;
         str8 = "";
     }
     else
     {
         string[] strArray2;
         DateTime time;
         if (channel.InfoSortType == 4)
         {
             path = Param.SiteRootPath + @"\" + str3;
             strArray2 = new string[5];
             strArray2[0] = Param.SiteRootPath;
             strArray2[1] = @"\";
             strArray2[2] = str3;
             strArray2[3] = @"\";
             time = (DateTime)dr["AddTime"];
             strArray2[4] = time.ToString("yyyy'/'MM'/'dd");
             str10 = string.Concat(strArray2);
             str7 = str3;
             time = (DateTime)dr["AddTime"];
             str8 = time.ToString("yyyy'/'MM'/'dd");
         }
         else if (channel.InfoSortType == 5)
         {
             path = Param.SiteRootPath + @"\" + str3;
             strArray2 = new string[5];
             strArray2[0] = Param.SiteRootPath;
             strArray2[1] = @"\";
             strArray2[2] = str3;
             strArray2[3] = @"\";
             time = (DateTime)dr["AddTime"];
             strArray2[4] = time.ToString("yyyy'/'MM-dd");
             str10 = string.Concat(strArray2);
             str7 = str3;
             time = (DateTime)dr["AddTime"];
             str8 = time.ToString("yyyy'/'MM-dd");
         }
         else if (channel.InfoSortType == 6)
         {
             path = Param.SiteRootPath + @"\" + str3;
             strArray2 = new string[5];
             strArray2[0] = Param.SiteRootPath;
             strArray2[1] = @"\";
             strArray2[2] = str3;
             strArray2[3] = @"\";
             time = (DateTime)dr["AddTime"];
             strArray2[4] = time.ToString("yyyy-MM-dd");
             str10 = string.Concat(strArray2);
             str7 = str3;
             time = (DateTime)dr["AddTime"];
             str8 = time.ToString("yyyy-MM-dd");
         }
         else if (channel.InfoSortType == 7)
         {
             path = Param.SiteRootPath + @"\" + str3;
             strArray2 = new string[5];
             strArray2[0] = Param.SiteRootPath;
             strArray2[1] = @"\";
             strArray2[2] = str3;
             strArray2[3] = @"\";
             time = (DateTime)dr["AddTime"];
             strArray2[4] = time.ToString("yyyyMM");
             str10 = string.Concat(strArray2);
             str7 = str3;
             str8 = ((DateTime)dr["AddTime"]).ToString("yyyyMM");
         }
     }
     if (Directory.Exists(path))
     {
         if (!Directory.Exists(str10))
         {
             this.CreateDir(str10);
         }
     }
     else
     {
         this.CreateDir(path);
         this.CreateDir(str10);
     }
     templatePath = string.Concat(new object[] { Param.SiteRootPath, @"\", str7, @"\", str8, @"\", strArray[0], dr["Id"], strArray[1] });
     pageSize = this.TotalContentPageNumber(dr);
     content = this.GetInfo(dr, 1, pageSize);
     if (pageSize != 1)
     {
         this.WriterTemplate(templatePath, content);
         for (int i = 2; i <= pageSize; i++)
         {
             content = this.GetInfo(dr, i, pageSize);
             templatePath = string.Concat(new object[] { Param.SiteRootPath, @"\", str7, @"\", str8, @"\", strArray[0], dr["Id"], "_", i - 1, strArray[1] });
             this.WriterTemplate(templatePath, content);
         }
     }
     else
     {
         this.WriterTemplate(templatePath, content);
     }
     B_Article article = new B_Article();
     string tableName = (string)dr["tablename"];
     int id = (int)dr["id"];
     this.InfoOperBll.UpdateIsCreated(tableName, id);
     return true;
 }
Exemplo n.º 13
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.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminBll.CheckMulitLogin();
        adminModel = admin.GetLoginModel();
        M_InfoModel infoModel = InfoModelBll.GetModel(2);
        FilePicPath.Text = infoModel.UploadPath + "|" + infoModel.UploadSize;
        AdminUserModel = AdminBll.GetModel(adminModel.UserId);
        if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
        {
            ChannelId = Function.CheckNumberNotZero(Request.QueryString["ChId"]) == true ? int.Parse(Request.QueryString["ChId"]) : 0;
        }
        if (!string.IsNullOrEmpty(Request.QueryString["ColId"]))
        {
            ColId = Function.CheckNumber(Request.QueryString["ColId"]) ? int.Parse(Request.QueryString["ColId"]) : 0;
        }
        ChannelModel = ChannelId <= 0 ? null : ChannelBll.GetChannel(ChannelId);
        if (ChannelModel == null || ChannelModel.ModelType != 2)
        {
            Function.ShowSysMsg(0,"<li>频道参数错误</li><li><a href='javascript:window.history.back();'>返回上一步</a></li>");
            return;
        }
        litNav.Text = ChannelModel.TypeName + "管理 &gt;&gt; <a href='InfoList.aspx?ChId=" + ChannelId + "'>站点" + ChannelModel.TypeName + "列表</a>&gt;&gt;设置" + ChannelModel.TypeName;
        txtTemplatePath.Attributes.Add("readonly", "readonly");

        if (!IsPostBack)
        {
            BindData();
        }

        if (Request.QueryString["ChId"] != null && Request.QueryString["ColId"] != null && Request.QueryString["Id"] != null)
        {
            ColId = Function.CheckNumber(Request.QueryString["ColId"]) == true ? int.Parse(Request.QueryString["ColId"]) : 0;
            ImgId = Function.CheckNumber(Request.QueryString["Id"]) == true ? int.Parse(Request.QueryString["Id"]) : 0;
            if (ImgId > 0 && !AdminGroupBll.Power_Channel(ChannelId, ColId, AdminUserModel.GroupId, 3))
            {
                Function.ShowSysMsg(0, "<li>你没有该栏目下的修改权限</li>");
            }
            model = imageBll.GetItem(ImgId);
            if (ChannelId > 0 && ColId > 0 && ImgId > 0 && model != null)
            {
                flag = "Update";
                if (!IsPostBack)
                {
                    BindDataOnUpdate();
                }
            }
            else
            {
                Function.ShowSysMsg(0,"<li>参数错误</li><li><a href='javascript:window.history.back();'>返回上一步</a></li>");
            }

        }
    }
Exemplo n.º 15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AdminBll.CheckMulitLogin();
     AdminModel = AdminBll.GetLoginModel();
     litMsg.Text = "";
     SiteModel = SiteBll.GetSiteModel();
     if(SiteModel==null)
     {
         Function.ShowSysMsg(0, "<li>全站参数获取错误</li>");
     }
     txtSoftTemplatePath.Attributes.Add("readonly", "");
     txtTitleImgPath.Attributes.Add("readonly","");
     if(!string.IsNullOrEmpty(Request.QueryString["ChId"]))
     {
         ChannelId = int.Parse(Request.QueryString["ChId"]);
     }
     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 = ChannelBll.GetChannel(ChannelId);
     if(ChannelId<=0 || ChannelModel==null || ChannelModel.ModelType!=3)
     {
         Function.ShowSysMsg(0, "<li>频道参数错误</li>");
     }
     if (!string.IsNullOrEmpty(Request.QueryString["ColId"]))
     {
             ColumnId = int.Parse(Request.QueryString["ColId"]);
     }
     if (ColumnId != 0 && ColumnBll.GetColumn(ColumnId) == null)
     {
         Function.ShowSysMsg(0, "<li>所选栏目不存在或已经被删除</li>");
     }
     if (!string.IsNullOrEmpty(Request.QueryString["Id"]))
     {
         try
         {
             Id = int.Parse(Request.QueryString["Id"]);
         }
         catch{}
     }
     B_InfoModel infoModelBll=new B_InfoModel();
     M_InfoModel infoModel = infoModelBll.GetModel(ChannelModel.ModelType);
     FilePicPath.Text = infoModel.UploadPath+"|"+infoModel.UploadSize.ToString();
     if(Id>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;
      if (!IsPostBack)
     {
         BindGroup();
         BindDownServerType();
         BindSpeacil();
         if (Id > 0)
             ShowDownLoadInfo(Id);
         ddlBind();
     }
 }
Exemplo n.º 16
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.º 17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AdminGroupBll.Power_Judge(45);
     if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
     {
         try
         {
             ChId = int.Parse(Request.QueryString["ChId"]);
         }
         catch { }
     }
     ChannelModel = ChId == 0 ? null : ChannelBll.GetChannel(ChId);
     if (ChannelModel == null)
     {
         Response.Write("<script type='text/javascript'>alert('频道不存在或已经被删除');history.back();</script>");
         Response.End();
         return;
     }
     if (!IsPostBack)
     {
         BindLeft();
         BindRight();
     }
 }
Exemplo n.º 18
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.º 19
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.º 20
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.º 21
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     M_LabelContent model = new M_LabelContent();
     B_LabelContent bll = new B_LabelContent();
     B_KyCommon bllCom = new B_KyCommon();
     bool flag = false;
     if (!(txtName.Text.ToString().Substring(0, 2).ToLower() == "s_"))
     {
         model.Name = lblPrefix.Text.ToString() + txtName.Text.Trim() + lblPostfix.Text.ToString();
         model.LbCategoryId = 1;
         model.Content = GetContent(txtContent.Value);
         model.AnomalyStyle = txtContent.Value;
         ChannelM = ChannelBll.GetChannel(Chid);
         int modelId = ChannelM.ModelType;
         model.ModeType = modelId;
         flag = bllCom.CheckHas(model.Name, "Name", "KyLabelContent");
         if (btnSave.Text == "修改标签")
         {
             model.LabelCategoryID = int.Parse(Request.QueryString["labelCategoryId"]);
             bll.Update(model);
             Response.Redirect(SkipPageUrl);
         }
         else
         {
             if (!flag)
             {
                 bll.Add(model);
                 Response.Redirect(SkipPageUrl);
             }
             else
                 Response.Write("<script>alert('此标签己存在');</script>");
         }
     }
     else
     {
         Response.Write("<script>alert('此标签与超级标签冲突');</script>");
     }
 }
Exemplo n.º 22
0
        public string GetContent(string contentAddress, M_Collection collectionM)
        {
            string contentStr = string.Empty;
            string htmlCode = string.Empty;
            string input = string.Empty;
            string str5 = string.Empty;
            string regStr = string.Empty;
            string charSet = collectionM.CharSet;
            string imagePath = string.Empty;
            if (charSet == "0")
            {
                charSet = "gb2312";
            }
            else
            {
                charSet = "utf-8";
            }
            string webSite = collectionM.WebSite;
            string fieldListSet = collectionM.FieldListSet;
            string contentPageSet = collectionM.ContentPageSet;
            string[] strArray = fieldListSet.Split(new char[] { '|' });
            string[] strArray2 = new string[strArray.Length - 1];
            this.ColumnM = this.ColumnBll.GetColumn(collectionM.ColId);
            this.ChannelM = this.ChannelBll.GetChannel(this.ColumnM.ChId);
            int num = 0;
            if (contentPageSet != "")
            {
                num = int.Parse(contentPageSet.Split(new char[] { '|' })[0].ToString().Split(new char[] { '┃' })[1].ToString());
            }
            string str13 = string.Empty;
            string nextAddress = string.Empty;
            htmlCode = this.GetHtmlCode(contentAddress, charSet);
            for (int i = 0; i < strArray2.Length; i++)
            {
                regStr = this.TransferStr(strArray[i].Split(new char[] { ',' })[1].ToString()) + "((?:.|\n)*?)" + this.TransferStr(strArray[i].Split(new char[] { ',' })[2].ToString());
                if (strArray[i].Split(new char[] { ',' })[0].ToString().ToLower() == "content")
                {
                    contentStr = this.GetRegValue(regStr, htmlCode);
                    contentStr = this.GetContent(collectionM, contentStr);
                    switch (num)
                    {
                        case 1:
                            str13 = this.TransferStr(contentPageSet.Split(new char[] { '|' })[1].Split(new char[] { '┃' })[1].ToString()) + "((?:.|\n)*?)" + this.TransferStr(contentPageSet.Split(new char[] { '|' })[2].Split(new char[] { '┃' })[1].ToString());
                            nextAddress = this.IsFullAddress(collectionM.WebSite, collectionM.ListPageUrl, this.GetHref(this.GetRegValue(str13, htmlCode)));
                            if ((nextAddress != "") && (collectionM.WebSite != nextAddress))
                            {
                                string[] strArray3 = nextAddress.Substring(0, nextAddress.Length - 1).Split(new char[] { ',' });
                                nextAddress = strArray3[strArray3.Length - 1];
                                contentStr = contentStr + this.GetPageCodeContent(nextAddress, str13, collectionM, regStr, contentStr);
                            }
                            break;

                        case 2:
                            nextAddress = contentPageSet.Split(new char[] { '|' })[1].Split(new char[] { '┃' })[1].ToString();
                            contentStr = contentStr + this.GetPageIdContent(nextAddress, collectionM, regStr, contentAddress, contentStr, imagePath);
                            break;

                        case 3:
                            nextAddress = contentPageSet.Split(new char[] { '|' })[1].Split(new char[] { '┃' })[1].ToString();
                            contentStr = contentStr + this.GetListAddressContent(nextAddress, collectionM, regStr, contentStr);
                            break;
                    }
                    if (contentStr == "")
                    {
                        contentStr = strArray[i].Split(new char[] { ',' })[3].ToString();
                    }
                    contentStr = Regex.Replace(Regex.Replace(contentStr, this.TransferStr(strArray[i].Split(new char[] { ',' })[2].ToString()), "", RegexOptions.IgnoreCase), this.TransferStr(strArray[i].Split(new char[] { ',' })[1].ToString()), "", RegexOptions.IgnoreCase);
                }
                else if (strArray[i].Split(new char[] { ',' })[0].ToString().ToLower() == "addtime")
                {
                    if ((((this.TransferStr(strArray[i].Split(new char[] { ',' })[1].ToString()) != "") && (this.TransferStr(strArray[i].Split(new char[] { ',' })[1].ToString()).Length != 0)) && (this.TransferStr(strArray[i].Split(new char[] { ',' })[2].ToString()) != "")) && (this.TransferStr(strArray[i].Split(new char[] { ',' })[2].ToString()).Length != 0))
                    {
                        contentStr = this.RemoveHtml(this.GetRegValue(regStr, htmlCode).Replace(this.TransferStr(strArray[i].Split(new char[] { ',' })[1].ToString()), "").Replace(this.TransferStr(strArray[i].Split(new char[] { ',' })[2].ToString()), "").Replace("\r\n", "").Replace("&nbsp;", "")).Trim();
                    }
                    else
                    {
                        contentStr = strArray[i].Split(new char[] { ',' })[3].ToString().Trim();
                    }
                }
                else
                {
                    if ((((this.TransferStr(strArray[i].Split(new char[] { ',' })[1].ToString()) != "") && (this.TransferStr(strArray[i].Split(new char[] { ',' })[1].ToString()).Length != 0)) && (this.TransferStr(strArray[i].Split(new char[] { ',' })[2].ToString()) != "")) && (this.TransferStr(strArray[i].Split(new char[] { ',' })[2].ToString()).Length != 0))
                    {
                        contentStr = this.RemoveHtml(this.GetRegValue(regStr, htmlCode).Replace(this.TransferStr(strArray[i].Split(new char[] { ',' })[1].ToString()), "").Replace(this.TransferStr(strArray[i].Split(new char[] { ',' })[2].ToString()), "").Trim());
                    }
                    else
                    {
                        contentStr = this.RemoveHtml(this.GetRegValue(regStr, htmlCode)).Trim();
                    }
                    if (contentStr == "")
                    {
                        contentStr = strArray[i].Split(new char[] { ',' })[3].ToString();
                    }
                }
                input = input + strArray[i].Split(new char[] { ',' })[0].ToString().ToLower() + ",";
                str5 = str5 + contentStr + "$";
            }
            if (!Regex.Match(input, "uname", RegexOptions.IgnoreCase).Success)
            {
                input = input + "uname,";
                str5 = str5 + "admin$";
            }
            if (!Regex.Match(input, "addtime", RegexOptions.IgnoreCase).Success)
            {
                input = input + "addtime,";
                str5 = str5 + DateTime.Now.ToString() + "$";
            }
            if ((imagePath != string.Empty) && (imagePath.Length != 0))
            {
                input = input + "ImgPath,";
                str5 = str5 + "|" + imagePath + "$";
            }
            return (input + "┃" + str5);
        }
Exemplo n.º 23
0
 private void RepChannelBind(int chid)
 {
     int recrodCount = 0;
     ChannelM = ChannelBll.GetChannel(chid);
     if (ChannelM != null)
     {
         repAnomaly.DataSource = AnomalyBll.GetList(chid,pageAnomaly.CurrentPageIndex,pageAnomaly.PageSize,ref recrodCount);
         repAnomaly.DataBind();
         pageAnomaly.RecordCount = recrodCount;
         pageAnomaly.CustomInfoHTML = string.Format("共{0}条记录 每页{1}条", pageAnomaly.RecordCount, pageAnomaly.PageSize);
     }
 }
Exemplo n.º 24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminGroupBll.Power_Judge(36);
        litMsg.Text = string.Empty;
        if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
        {
            try
            {
                ChId = int.Parse(Request.QueryString["ChId"]);
            }catch{}
        }
        ChannelModel = ChId != 0 ? ChannelBll.GetChannel(ChId) : null;
        if (ChannelModel == null)
        {
            Function.ShowSysMsg(0, "<li>频道参数错误</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>");
        }
        hyperColumnNav.NavigateUrl = "ColumnList.aspx?ChId=" + ChannelModel.ChId;
        hyperColumnNav.Text = "[" + ChannelModel.ChName + "] 栏目管理";

        if(!string.IsNullOrEmpty(Request.QueryString["ColId"]))
        {
            try
            {
                ColumnId = int.Parse(Request.QueryString["ColId"]);
            }catch{}
        }
        if (!string.IsNullOrEmpty(Request.QueryString["ChildColId"]))
        {
            try
            {
                ChildColId = int.Parse(Request.QueryString["ChildColId"]);
            }
            catch { }
        }
        txtColumnTemplatePath.Attributes.Add("readonly", "readonly");
        txtInfoTemplatePath.Attributes.Add("readonly", "readonly");
        txtCommentTemplatePath.Attributes.Add("readonly", "readonly");
        AjaxPro.Utility.RegisterTypeForAjax(typeof(System_ColumnManage));
        if (!IsPostBack)
        {
            BindColumn();
            BindGroup();
            txtColumnTemplatePath.Text = ChannelModel.ColumnTemplatePath;
            txtInfoTemplatePath.Text = ChannelModel.InfoTemplatePath;
            txtCommentTemplatePath.Text = ChannelModel.CommentTemplatePath;
            rblColumnPageType.SelectedValue = ChannelModel.ColumnPageType.ToString();
            rblInfoPageType.SelectedValue = ChannelModel.InfoPageType.ToString();
            try
            {
                ddlColumn.SelectedValue = ChildColId.ToString();
            }
            catch { }
            if (ColumnId != 0)
            {
                ShowInfo();
                litNav.Text = "修改栏目";
            }
            else
            {
                litNav.Text = "添加栏目";

            }
        }
    }
Exemplo n.º 25
0
 private string NewsFileName(DataRow dr)
 {
     M_Channel channel = new M_Channel();
     channel = this.ChannelBll.GetChannel(int.Parse(dr["ChId"].ToString()));
     string str = "";
     if (channel.FileNameType == 1)
     {
         str = "";
     }
     else
     {
         DateTime time;
         if (channel.FileNameType == 2)
         {
             time = (DateTime)dr["AddTime"];
             str = time.ToString("yyyyMM");
         }
         else if (channel.FileNameType == 3)
         {
             time = (DateTime)dr["AddTime"];
             str = time.ToString("yyyyMMdd");
         }
         else if (channel.FileNameType == 4)
         {
             str = dr["DirName"].ToString() + "_";
         }
         else if (channel.FileNameType == 5)
         {
             str = dr["DirName"].ToString() + "_" + ((DateTime)dr["AddTime"]).ToString("yyyyMMdd");
         }
     }
     string str2 = dr["PageType"].ToString();
     string str4 = str2;
     if (str4 != null)
     {
         if (!(str4 == "1"))
         {
             if (str4 == "2")
             {
                 str2 = ".htm";
             }
             else if (str4 == "3")
             {
                 str2 = ".shtml";
             }
             else if (str4 == "4")
             {
                 str2 = ".aspx";
             }
         }
         else
         {
             str2 = ".html";
         }
     }
     return (str + "|" + str2);
 }
Exemplo n.º 26
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.º 27
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.º 28
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.º 29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     litMsg.Text = "";
     UserBll.CheckIsLogin();
     UserModel = UserBll.GetUser(UserBll.GetCookie().LogName);
     UserGroupModel = UserGroupBll.GetModel(UserModel.GroupID);
     SiteModel = SiteBll.GetSiteModel();
     if (SiteModel == null)
         Function.ShowMsg(0, "<li>全站参数获取错误</li><li><a href='javascript:history.back()'>返回上一级</a></li>");
     if (!string.IsNullOrEmpty(Request.QueryString["Id"]))
     {
         try
         {
             Id = Convert.ToInt32(Request.QueryString["Id"]);
         }
         catch { }
     }
     if (!string.IsNullOrEmpty(Request.QueryString["ChId"]))
     {
         ChId = int.Parse(Request.QueryString["ChId"]);
     }
     ChannelModel = ChId <= 0 ? null : ChannelBll.GetChannel(ChId);
     if (ChannelModel == null || ChId < 0)
         Function.ShowMsg(0, "<li>频道参数错误</li><li><a href='javascript:history.back()'>返回上一级</a></li>");
     if (!UserGroupBll.Power_ColumnPower(ChId, 0, UserGroupModel.ColumnPower, 3))
         Function.ShowMsg(0, "<li>本频道没有添加" + ChannelModel.TypeName + "的权限</li><li><a href='javascript:history.back()'>返回上一级</a></li>");
     if (!ColumnBll.ChkHasColumnByChId(ChId))
         Function.ShowMsg(0, "<li>本频道下没有栏目,不能添加" + ChannelModel.TypeName + "</li><li><a href='javascript:history.back()'>返回上一级</a></li>");
     if (!string.IsNullOrEmpty(Request.QueryString["ColId"]))
         ColId = Convert.ToInt32(Request.QueryString["ColId"]);
     ColumnModel = ColId <= 0 ? null : ColumnBll.GetColumn(ColId);
     if (ColId > 0 && ColumnModel == null)
         Function.ShowMsg(0, "<li>所选栏目不存在或已经被删除</li><li><a href='javascript:history.back()'>返回上一级</a></li>");
     B_InfoModel infoModelBll = new B_InfoModel();
     M_InfoModel infoModel = infoModelBll.GetModel(ChannelModel.ModelType);
     FilePicPath.Text = infoModel.UploadPath + "|" + infoModel.UploadSize.ToString();
     if (!IsPostBack)
     {
         UserCateBound();
         ddlBind();
         if (Id > 0)
             ShowInfo(Id);
     }
 }
Exemplo n.º 30
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 + "标题";
        }
    }