Пример #1
0
    //底部版权信息
    public void hy_GetCopyrightinfo()
    {
        HyoaClass.Hyoa_site Hyoa_site = new HyoaClass.Hyoa_site();
        DataTable dt = Hyoa_site.Getfirstsite();
        if (dt.Rows.Count > 0)
            lblcopyright.Text = dt.Rows[0]["hy_copyrightinfo"].ToString();
        else
            lblcopyright.Text = "未得到信息";

        string ls_links = "";
        //得到友情链接
        dt.Clear();
        HyoaClass.Hyoa_link Hyoa_link = new HyoaClass.Hyoa_link();
        dt = Hyoa_link.Getlinks();
        if (dt.Rows.Count > 0)
        {
            for (var i = 0; i < dt.Rows.Count; i++)
            {
                if (ls_links == "")
                    ls_links = "<a href=\"" + dt.Rows[i]["hy_linkurl"].ToString() + "\" target=_blank>" + dt.Rows[i]["hy_linkname"].ToString() + "</a>";
                else
                    ls_links += " | " + "<a href=\"" + dt.Rows[i]["hy_linkurl"].ToString() + "\" target=_blank>" + dt.Rows[i]["hy_linkname"].ToString() + "</a>";
            }
        }
        this.lbllink.Text = ls_links;
    }
Пример #2
0
 //底部版权信息
 public void hy_GetCopyrightinfo()
 {
     HyoaClass.Hyoa_site Hyoa_site = new HyoaClass.Hyoa_site();
     DataTable dt = Hyoa_site.Getfirstsite();
     if (dt.Rows.Count > 0)
         lblcopyright.Text = dt.Rows[0]["hy_copyrightinfo"].ToString();
     else
         lblcopyright.Text = "未得到信息";
 }
Пример #3
0
    public string hy_title()
    {
        string hy_title = "";

        //得到模块中文名
        HyoaClass.Hyoa_site Hyoa_site = new HyoaClass.Hyoa_site();
        DataTable dt = Hyoa_site.Getfirstsite();
        hy_title = dt.Rows[0]["hy_copyright"].ToString();
        dt.Clear();

        return hy_title;
    }
Пример #4
0
    //底部版权信息
    public string hy_GetCopyrightinfo()
    {
        string ls_return = "";
        HyoaClass.Hyoa_site Hyoa_site = new HyoaClass.Hyoa_site();
        DataTable dt = Hyoa_site.Getfirstsite();
        if (dt.Rows.Count > 0)
            ls_return = dt.Rows[0]["hy_copyrightinfo"].ToString();
        else
            ls_return = "未得到信息";

        return ls_return;
    }
Пример #5
0
 protected void btndelinfo_Click(object sender, EventArgs e)
 {
     HyoaClass.Hyoa_site Hyoa_site = new HyoaClass.Hyoa_site();
     String[] v_uids = this.txtuids.Value.Split(',');
     for (var i = 0; i < v_uids.Length; i++)
     {
         if (v_uids[i] != "")
         {
             Hyoa_site.id = System.Int32.Parse(v_uids[i]);
             Hyoa_site.Delete();
         }
     }
     this.txtuids.Value = "";
     DataPlay(System.Int32.Parse(this.curpage.Text));
 }
Пример #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() =="")
            this.Response.Redirect("login.aspx?url="+this.Request.RawUrl);

        //if (!IsPostBack)
        //{
        //}
        HyoaClass.Hyoa_site Hyoa_site = new HyoaClass.Hyoa_site();
        DataTable dt = Hyoa_site.Getfirstsite();
        if (dt.Rows.Count > 0)
        {
            Response.Redirect(dt.Rows[0]["hy_indexpath"].ToString());
        }
        else
        {
            Response.Write("系统设置中没有设置标准首页风格,请联系管理员!");
        }
    }
Пример #7
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "保存成功!";

        //新文档时
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        HyoaClass.Hyoa_site Hyoa_site = new HyoaClass.Hyoa_site();
        if (this.txtop.Value == "add")
        {
            Hyoa_site.id = Hyoa_global.GetRandom();
            Hyoa_site.hy_version = this.txtversion.Value;
            Hyoa_site.hy_copyright = this.txtcopyright.Value;
            Hyoa_site.hy_copyrightinfo = this.Content.Value;
            Hyoa_site.hy_indexpath = this.ddlhy_indexpath.SelectedValue;
            Hyoa_site.hy_imagepath = "";
            Hyoa_site.Insert();
        }
        else
        {
            Hyoa_site.id = this.txtdocid.Value;
            Hyoa_site.hy_version = this.txtversion.Value;
            Hyoa_site.hy_copyright = this.txtcopyright.Value;
            Hyoa_site.hy_copyrightinfo = this.Content.Value;
            Hyoa_site.hy_indexpath = this.ddlhy_indexpath.SelectedValue;
            Hyoa_site.hy_imagepath = "";
            Hyoa_site.Update();
        }

        //处理完成后的提示及跳转
        if (this.txtifpop.Value == "")
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
        }
        else
        {
            Response.Write("<script>alert('" + ls_tip + "');self.close();</script>");
        }
    }
Пример #8
0
    private void DataPlay(int PageNo)
    {
        //判断当前用户是否有新建删除权限
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()))
        {
            this.isrole.Value = "1";
            this.tdnewdoc.Visible = true; //新建
            this.tddeldoc.Visible = true; //删除

        }
        else
        {
            this.isrole.Value = "0";
            this.tdnewdoc.Visible = false; //新建
            this.tddeldoc.Visible = false; //删除
        }

        //得到当前页号
        this.curpage.Text = PageNo.ToString();
        HyoaClass.Hyoa_site Hyoa_site = new HyoaClass.Hyoa_site();

        DataTable dt;
        dt = Hyoa_site.Getsites();

        DataTable tempTable = dt.Clone();
        for (int i = (PageNo - 1) * System.Int32.Parse(PageSize.Text); i < PageNo * System.Int32.Parse(PageSize.Text); i++)
        {
            if (i > dt.Rows.Count - 1)
                break;

            DataRow dr = tempTable.NewRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
            }
            tempTable.Rows.Add(dr);
        }

        int TotalRecord = dt.Rows.Count;
        this.sumts.Text = TotalRecord.ToString();
        this.sumts2.Text = TotalRecord.ToString();
        this.ShowTotalRecord.Text = TotalRecord.ToString();
        //计算及显示总页数
        int TotalPage;
        if (TotalRecord < System.Int32.Parse(PageSize.Text))
        {
            TotalPage = 1;
        }
        else
        {
            if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0)
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1;

            }
            else
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text);

            }
        }
        this.ShowTotalPage.Text = TotalPage.ToString();
        this.rptlist.DataSource = tempTable;
        this.rptlist.DataBind();
        dt.Clear();
    }
Пример #9
0
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改

            //判断当前用户是否有保存的权限
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()))
            {
                this.btn_submit.Visible = true; //保存
            }
            else
            {
                this.btn_submit.Visible = false; //保存
            }

            //旧文档
            if (this.Request.QueryString["op"] == "modify")
            {
                if (this.Request.QueryString["id"] != null)
                {
                    //根据id得到信息
                    this.txtdocid.Value = this.Request.QueryString["id"].ToString();
                    HyoaClass.Hyoa_site Hyoa_site = new HyoaClass.Hyoa_site();
                    DataTable dt = Hyoa_site.Getsitebyid(this.txtdocid.Value);
                    if (dt.Rows.Count > 0)
                    {
                        this.txtversion.Value = dt.Rows[0]["hy_version"].ToString();
                        this.txtcopyright.Value = dt.Rows[0]["hy_copyright"].ToString();
                        this.Content.Value = dt.Rows[0]["hy_copyrightinfo"].ToString();
                    }
                    dt.Clear();
                }
            }
        }
    }