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(); } }
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); }
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>"); } }
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>"); } }
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); }
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(); } }