Exemplo n.º 1
0
 //添加歌曲
 public bool addSong(SoundSong add)
 {
     bool flag = false;
     string cmdText = "Pr_AddSong";
     SqlParameter[] paras = new SqlParameter[] {
         new SqlParameter("@Category", add.Category),
         new SqlParameter("@Name", add.Name),
         new SqlParameter("@Singer", add.Singer),
         new SqlParameter("@Content",add.Content),
         new SqlParameter("@MemId",add.MemId)
     };
     int res = (sqlhelper.ExecuteNonQuery(cmdText, paras, CommandType.StoredProcedure));
     if (res > 0)
     {
         flag = true;
     }
     return flag;
 }
Exemplo n.º 2
0
 //protected void BSearch_Click(object sender, EventArgs e)
 //{
 //    string key = TBSearch.Text.Trim();
 //    string action = DropDownList.SelectedValue;
 //    if (key == "")
 //    {
 //        showMessage.JsHistory(this, "搜索内容不能为空!", -1);
 //        return;
 //    }
 //    Response.Redirect("~/search.aspx?key=" + Server.UrlEncode(key) + "&action=" + action);
 //}
 protected void upButton_Click(object sender, EventArgs e)
 {
     string name = Session["name"].ToString();
     string[] allowExtensions = { ".mp3" };
     int maxLength = 10;
     string savePath = Server.MapPath("../music/") + name + "/";
     string saveName = TBUpName.Text.Trim().ToString() + ".mp3";
     Upload(FileUpload, allowExtensions, maxLength, savePath, saveName);
     SoundMember m = new SoundMemberManager().selectMemByName(name);
     string Name = TBUpName.Text.Trim().ToString();//5_1_a_s_p_x
     string Category = TBUpCategory.Text.Trim().ToString();
     string Singer = TBUpSonger.Text.Trim().ToString();
     string Content = savePath + saveName;
     string MemId = m.Id;
     SoundSong s = new SoundSong();
     s.Name = Name;
     s.Category = Category;
     s.Singer = Singer;
     s.Content = Content;
     s.MemId = MemId;
     new SoundSongManager().addSong(s);
 }
Exemplo n.º 3
0
 //通过歌曲id查找歌曲
 public SoundSong selectSongById(string id)
 {
     SoundSong s = new SoundSong();
     string cmdText = "select category,[name],[content],singer,createTime,clickCount,memId,id from song where id=@id";
     SqlParameter[] paras = new SqlParameter[] {
         new SqlParameter("@id",id)
     };
     DataTable dt = new DataTable();
     dt = sqlhelper.ExecuteQuery(cmdText, paras, CommandType.Text);
     s.Id = dt.Rows[0]["id"].ToString();
     s.Category = dt.Rows[0]["category"].ToString();
     s.Name = dt.Rows[0]["name"].ToString();
     s.Content = dt.Rows[0]["content"].ToString();
     s.Singer = dt.Rows[0]["singer"].ToString();
     s.CreateTime = dt.Rows[0]["createTime"].ToString();
     s.ClickCount = dt.Rows[0]["clickCount"].ToString();
     s.MemId = dt.Rows[0]["memId"].ToString();
     return s;
 }
Exemplo n.º 4
0
 public bool addSong(SoundSong add)
 {
     return sdao.addSong(add);
 }