Ejemplo n.º 1
0
    //保存
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.Session["uid"] == null)
            this.Response.Redirect("../login.aspx");

        string ls_tip = "保存成功!";

        HyCategory HyCategory = new HyCategory();
        HyCommon HyCommon = new HyCommon();

        HyCategory.CID = this.txtcid.Text;
        HyCategory.hy_cname = this.txtcname.Text;
        HyCategory.hy_csort = System.Int32.Parse(this.txtcsort.Text);
        HyCategory.hy_ctype = "0";
        HyCategory.hy_byzd1 = "";
        HyCategory.hy_byzd2 = "";
        HyCategory.hy_byzd3 = "";
        HyCategory.hy_byzd4 = "";
        if (this.txtop.Value == "add")
        {
            //写系统日志
            HyCommon.WriteLog("新增", "新增类别记录[id:" + this.txtcid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString());

            HyCategory.Insert();
        }
        else
        {
            //写系统日志
            HyCommon.WriteLog("修改", "修改类别记录[id:" + this.txtcid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString());

            HyCategory.Update();
        }
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
    }
Ejemplo n.º 2
0
    //显示文章发布栏目
    public string ls_nrgl()
    {
        string ls_return = "";
        if (Session["uid"].ToString() == "")
        {
        }
        else
        {
            DataTable dt = new DataTable();
            DataTable dt2 = new DataTable();
            //文章发布左侧动态产生
            HyCategory HyCategory = new HyCategory();
            dt = HyCategory.Getdocs();
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (HyCategory.isHaveSubCategory(dt.Rows[i]["CID"].ToString(), "0") == true)
                    {
                        //有下一级栏目
                        ls_return += "<li isexpand=\"false\">";
                        ls_return += "<span>" + dt.Rows[i]["hy_cname"].ToString() + "</span>";
                        ls_return += "<ul>";
                        //ls_return += GetNextColumn(dt.Rows[i]["cid"].ToString());
                        dt2 = HyCategory.GetSecondlevCategory("0001", "0", 12);
                        if (dt2.Rows.Count > 0)
                        {
                            for (int k = 0; k < dt2.Rows.Count; k++)
                            {
                                ls_return += "<li url=\"ContentManage/list_content.aspx?cid=" + dt2.Rows[k]["CID"].ToString() + "\"><span>";
                                ls_return += dt2.Rows[k]["hy_cname"].ToString() + "</span></li>";
                            }

                        }
                        ls_return += "</ul>";
                        ls_return += "</li>";
                    }
                    else
                    {
                        //无下一级栏目
                        ls_return += "<li url=\"ContentManage/list_content.aspx?cid=" + dt.Rows[i]["CID"].ToString() + "\"><span>";
                        ls_return += dt.Rows[i]["hy_cname"].ToString() + "</span></li>";
                    }
                }
            }
        }
        return ls_return;
    }
Ejemplo n.º 3
0
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改
        }
        if (this.Request.QueryString["id"] != null)
        {
            this.txtcid.Text = this.Request.QueryString["id"].ToString();     //部门ID
        }
        if (this.Request.QueryString["lastid"] != null)
        {
            this.txtlastcid.Value = this.Request.QueryString["lastid"].ToString();     //上级部门ID
        }
        HyCategory HyCategory = new HyCategory();

        //新文档
        if (this.txtop.Value == "add")
        {
            this.txtcid.Text = HyCategory.GetMaxCid(txtlastcid.Value,"0");
            this.txtcid.Enabled = false;

            //自动获得排序号
            this.txtcsort.Text = HyCategory.GetMaxSort(txtlastcid.Value, "0");

        }
        //旧文档
        if (this.txtop.Value == "modify")
        {
            DataTable dt = HyCategory.Getdocbyid(this.txtcid.Text);
            if (dt.Rows.Count > 0)
            {
                this.txtcname.Text = dt.Rows[0]["hy_cname"].ToString();
                this.txtcsort.Text = dt.Rows[0]["hy_csort"].ToString();
            }
        }
    }