コード例 #1
0
ファイル: pubhtml.aspx.cs プロジェクト: wjszxli/xdjb
    //静态发布栏目和内容页
    protected void btnpub3_Click(object sender, EventArgs e)
    {
        try
        {
            TPortalClass.JpSite site = new TPortalClass.JpSite();
            TPortalClass.JpShtml jpshtml = new TPortalClass.JpShtml();
            TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns();
            DataTable dt_col = JpColumns.GetColumnsOnline();
            if (dt_col.Rows.Count > 0)
            {
                for (int i = 0; i < dt_col.Rows.Count; i++)
                {
                    if (dt_col.Rows[i]["shtml"].ToString() == "1")  //静态发布的栏目
                    {
                        TPortalClass.JpColumns pubcol = new TPortalClass.JpColumns(dt_col.Rows[i]["cid"].ToString());
                        pubcol.shtmlpublish(2, int.Parse(txtdays.Value));
                    }
                }
            }
            Response.Write("<script language=javascript>alert('发布成功!');window.location='pubhtml.aspx';</script>");
        }
        catch
        {
            Response.Write("<script language=javascript>alert('发布失败!');window.location='pubhtml.aspx';</script>");
        }
        finally
        {

        }
    }
コード例 #2
0
ファイル: pubhtml.aspx.cs プロジェクト: wjszxli/xdjb
    //#region 检查权限=================================
    //private void ChkRole(string Roleid)
    //{
    //    TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser();
    //    if (JpRoleuser.isHaveRole(Roleid, this.Session["uid"].ToString()) == true || JpRoleuser.isHaveRole("Role9999", this.Session["uid"].ToString()) == true)
    //    {
    //        btnpub1.Visible = true;
    //        btnpub2.Visible = true;
    //        btnpub3.Visible = true;
    //        btnpub4.Visible = true;
    //    }
    //    else
    //    {
    //        btnpub1.Visible = false;
    //        btnpub2.Visible = false;
    //        btnpub3.Visible = false;
    //        btnpub4.Visible = false;
    //    }
    //}
    //#endregion
    private void DataPlay()
    {
        TPortalClass.JpPubHtml JpPubHtml = new TPortalClass.JpPubHtml();
        txtid.Text = JpPubHtml.id;
        txtpages.Text = JpPubHtml.pages;
        txtdays.Value = JpPubHtml.days;
        //staticstatus.SelectedValue = JpPubHtml.status;
        TextBox1.Text = JpPubHtml.status;
        //if (staticstatus.SelectedValue == "关闭")
        //{
        //    tr1.Visible = false;
        //    tr2.Visible = false;
        //    tr3.Visible = false;
        //    tr4.Visible = false;
        //}

        if (txtid.Text == "")
        {
            txtop.Text = "add";
            txtid.Text = System.Guid.NewGuid().ToString();
        }
        else
        {
            txtop.Text = "modify";
        }
        //加载一级栏目
        TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns();
        DataTable dt_col = JpColumns.GetColumnsOnline();
        int j = 1;
        this.ddlcol.Items.Insert(0, new ListItem("--请选择--", ""));
        if (dt_col.Rows.Count > 0)
        {
            for (int i = 0; i < dt_col.Rows.Count; i++)
            {
                if (dt_col.Rows[i]["shtml"].ToString() == "1" && dt_col.Rows[i]["cid"].ToString().Length == 3)  //静态发布的栏目
                {
                    this.ddlcol.Items.Insert(j, new ListItem(dt_col.Rows[i]["cname"].ToString(), dt_col.Rows[i]["cid"].ToString()));
                    j = j + 1;
                }
            }
        }
    }