Ejemplo n.º 1
0
    protected void _load()
    {
        Model.downlist md = new Model.downlist();
        md.id = Convert.ToInt32(Request.QueryString["uid"]);
        BLL.downlist  bd  = new BLL.downlist();
        SqlDataReader sdr = bd.datareader(md);

        if (sdr.Read())
        {
            name.Text    = sdr["_title"].ToString();
            size.Text    = sdr["_file_size"].ToString();
            fileurl.Text = sdr["_download_url"].ToString();
            Label1.Text  = sdr["_download_url"].ToString();
        }
    }
Ejemplo n.º 2
0
 protected void Button3_Click(object sender, EventArgs e)
 {
     Model.downlist md = new Model.downlist();
     BLL.downlist   bd = new BLL.downlist();
     md.id        = Convert.ToInt32(Request.QueryString["uid"]);
     md.title     = name.Text;
     md.size      = size.Text;
     md.click     = 0;
     md.uploadurl = fileurl.Text;
     if (bd.update(md) > 0)
     {
         Response.Write("<script>alert('更新成功'),location.href='downloadlist.aspx'</script>");
     }
     else
     {
         Response.Write("<script>alert('更新失败'),location.href='downloadlist.aspx'</script>");
     }
     name.Text = "";
 }
Ejemplo n.º 3
0
 protected void Button3_Click(object sender, EventArgs e)
 {
     Model.downlist md = new Model.downlist();
     BLL.downlist bd = new BLL.downlist();
     md.id = Convert.ToInt32(Request.QueryString["uid"]);
     md.title = name.Text;
     md.size = size.Text;
     md.click = 0;
     md.uploadurl = fileurl.Text;
     if (bd.update(md) > 0)
     {
         Response.Write("<script>alert('更新成功'),location.href='downloadlist.aspx'</script>");
     }
     else
     {
         Response.Write("<script>alert('更新失败'),location.href='downloadlist.aspx'</script>");
     }
     name.Text = "";
 }
Ejemplo n.º 4
0
 protected void Button3_Click(object sender, EventArgs e)
 {
     Model.downlist md = new Model.downlist();
     BLL.downlist   bd = new BLL.downlist();
     md.title     = name.Text;
     md.size      = size.Text;
     md.click     = 0;
     md.uploadurl = Label1.Text;
     if (bd.downloadadd(md) > 0)
     {
         msg("添加成功");
     }
     else
     {
         msg("添加失败");
     }
     name.Text   = "";
     size.Text   = "";
     Label3.Text = "";
 }
Ejemplo n.º 5
0
    protected void LinkButton1_Command(object sender, CommandEventArgs e)
    {
        Label1.Text = e.CommandArgument.ToString();

        Model.downlist md = new Model.downlist();
        md.id = Convert.ToInt32(Label1.Text);
        BLL.downlist bd = new BLL.downlist();
        MySqlDataReader sdr = bd.datareader(md);
        string str="";
        int count = 0;
        if (sdr.Read())
        {
            count = Convert.ToInt32(sdr["_click"]);
            str = sdr["_uploadurl"].ToString();
        }
        sdr.Close();

        md.click = count + 1;
        int result = bd.click(md);
        Response.Redirect(str);
    }
Ejemplo n.º 6
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        Model.downlist md = new Model.downlist();
        BLL.downlist bd = new BLL.downlist();
        int result = 0;
        string str="";
        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1");

            if (cb.Checked)
            {
                md.id = Convert.ToInt32(GridView1.DataKeys[i].Value);

                MySqlDataReader sdr = bd.datareader(md);
                if (sdr.Read())
                {
                     str = sdr["_uploadurl"].ToString();

                }
                sdr.Close();
                if (File.Exists(Server.MapPath("~/") + str))
                {
                    File.Delete(Server.MapPath("~/") + str);
                }

                result = bd._delete(md);
            }

        }

        if (result > 0)
        {
            Response.Write("<script>alert('删除成功'),location.href='downloadlist.aspx'</script>");
        }
        else
        {
            Response.Write("<script>alert('删除失败'),location.href='downloadlist.aspx'</script>");
        }
    }
Ejemplo n.º 7
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        Model.downlist md     = new Model.downlist();
        BLL.downlist   bd     = new BLL.downlist();
        int            result = 0;
        string         str    = "";

        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1");

            if (cb.Checked)
            {
                md.id = Convert.ToInt32(GridView1.DataKeys[i].Value);

                SqlDataReader sdr = bd.datareader(md);
                if (sdr.Read())
                {
                    str = sdr["_download_url"].ToString();
                }
                sdr.Close();
                if (File.Exists(Server.MapPath("~/") + str))
                {
                    File.Delete(Server.MapPath("~/") + str);
                }

                result = bd._delete(md);
            }
        }

        if (result > 0)
        {
            Response.Write("<script>alert('删除成功'),location.href='downloadlist.aspx'</script>");
        }
        else
        {
            Response.Write("<script>alert('删除失败'),location.href='downloadlist.aspx'</script>");
        }
    }
Ejemplo n.º 8
0
    protected void LinkButton1_Command(object sender, CommandEventArgs e)
    {
        Label1.Text = e.CommandArgument.ToString();

        Model.downlist md = new Model.downlist();
        md.id = Convert.ToInt32(Label1.Text);
        BLL.downlist  bd    = new BLL.downlist();
        SqlDataReader sdr   = bd.datareader(md);
        string        str   = "";
        int           count = 0;

        if (sdr.Read())
        {
            count = Convert.ToInt32(sdr["_click"]);
            str   = sdr["_uploadurl"].ToString();
        }
        sdr.Close();

        md.click = count + 1;
        int result = bd.click(md);

        Response.Redirect(str);
    }
Ejemplo n.º 9
0
 protected void Button3_Click(object sender, EventArgs e)
 {
     Model.downlist md = new Model.downlist();
     BLL.downlist bd = new BLL.downlist();
     md.title = name.Text;
     md.size = size.Text;
     md.click = 0;
     md.uploadurl = Label1.Text;
     if (bd.downloadadd(md) > 0)
     {
         msg("添加成功");
     }
     else
     {
         msg("添加失败");
     }
     name.Text = "";
     size.Text = "";
     Label3.Text = "";
 }
Ejemplo n.º 10
0
 protected void _load()
 {
     Model.downlist md  = new Model.downlist();
     md.id = Convert.ToInt32(Request.QueryString["uid"]);
     BLL.downlist bd = new BLL.downlist();
     MySqlDataReader sdr = bd.datareader(md);
     if (sdr.Read())
     {
         name.Text= sdr["_title"].ToString();
         size.Text = sdr["_size"].ToString();
         fileurl.Text = sdr["_uploadurl"].ToString();
         Label1.Text = sdr["_uploadurl"].ToString();
     }
 }