Exemple #1
0
 protected void btnSua_Click(object sender, EventArgs e)
 {
     try
     {
         Playlist pl = new Playlist();
         pl.maplaylist  = int.Parse(txtmaplaylist.Text);
         pl.tenplaylist = txtten.Text;
         pl.nguoitao    = txtnguoitao.Text;
         if (anh.FileName != oldAvt)
         {
             string path = Server.MapPath("~/images/playlist/");
             anh.PostedFile.SaveAs(path + anh.FileName);
             img.ImageUrl = "~/images/playlist/" + anh.FileName;
         }
         pl.hinhanh = anh.FileName;
         //pl.matheloai = int.Parse(ddltheloai.SelectedValue);
         pl.matheloai = int.Parse(txtmatheloai.Text);
         data.capNhatPL(pl);
         msg.Text = "Cập nhật thành công";
     }
     catch (Exception e2)
     {
         msg.Text = "Cập nhật thất bại" + e2.Message;
     }
 }