protected void btnSave_ServerClick(object sender, EventArgs e) { Music oMusic = MusicServices.Get(nId); if (null == oMusic) { oMusic = new Music(); oMusic.UserId = SystemUtil.GetCurrentUserId(); } PageUtil.PageFillEntity(this, oMusic); MusicServices.Save(oMusic); PageUtil.PageAlert(this.Page, "保存成功!"); PageUtil.PageClosePopupWindow(this.Page, true); }
protected void btnUpload_Click(object sender, EventArgs e) { string strValue = file_MusicFullName.Value; if (string.IsNullOrEmpty(strValue)) return; int nUserId = SystemUtil.GetCurrentUserId(); string strVirtualPath = MusicServices.GetUserMusicPath(nUserId) + "\\" + strValue; string strServerFullName = Server.MapPath(strVirtualPath); file_MusicFullName.PostedFile.SaveAs(strServerFullName); Music oMusic = new Music(); oMusic.MusicName = Path.GetFileNameWithoutExtension(strValue); oMusic.MusicType = Path.GetExtension(strValue).ToLower().Substring(1); oMusic.MusicURL = strVirtualPath; oMusic.UserId = nUserId; MusicServices.Save(oMusic); PageUtil.PageAlert(this.Page, "上传完成!"); }
public static void Save(Music _oMusic) { EntityAccess<Music>.Access.Save(_oMusic); }
public static void Delete(Music _oMusic) { EntityAccess<Music>.Access.Delete(_oMusic); }
public static void Save(Music _oMusic) { MusicDataAccess.Save(_oMusic); }
public static void Delete(Music _oMusic) { MusicDataAccess.Delete(_oMusic); }