예제 #1
0
        protected void btnCreate_Click(object sender, EventArgs e)
        {
            lblMsg.Text = "Adding";
            BLLAlbum bllAlbum = new BLLAlbum();
            string albumName = tbAlbumName.Text;
            int albumYear = Convert.ToInt32(tbYear.Text);
            int lid = bllAlbum.GetLastId()+1;
            string fileName;
            using (MD5 md5Hash = MD5.Create())
            {
                fileName = Hashing.GetMd5Hash(md5Hash, fuAlbumArt.PostedFile.FileName.ToString() + lid.ToString());
            }
            fuAlbumArt.SaveAs(Server.MapPath("~/AlbumArt/" + fileName));
            bllAlbum.InsertData(albumName,albumYear,fileName);

            lblMsg.Text = "AlbumAdded";
               DropDownListAlbums.DataBind();
        }
예제 #2
0
 public static string AllAlbums()
 {
     BLLAlbum bllAlbum = new BLLAlbum();
     string json = bllAlbum.GetAllAlbums();
     return json;
 }