partial void DeleteMusic(Music instance);
partial void UpdateMusic(Music instance);
partial void InsertMusic(Music instance);
private SB.Music Convert(Music mInfo) { SB.Music m = new ShareMan.SB.Music { ID = mInfo.ID, Author = mInfo.Author, Singer = mInfo.Singer }; return m; }
public void UpdateMusic(BaseItem baseInfo,Music musicInfo) { ShareManDBDataContext context = new ShareManDBDataContext(); try { context.Connection.Open(); context.Transaction = context.Connection.BeginTransaction(); UpdateBase(baseInfo,context); var mu = from b in context.Music where b.ID == baseInfo.ID select b; foreach (Music b in mu) { b.Author= musicInfo.Author; b.Singer = musicInfo.Singer; } context.SubmitChanges(); context.Transaction.Commit(); } catch { context.Transaction.Rollback(); } }
public long CommitMusic( BaseItem baseInfo,Music musicInfo, FSM.FileSet fset,string srcIp) { ShareManDBDataContext context = new ShareManDBDataContext(); try { context.Connection.Open(); context.Transaction = context.Connection.BeginTransaction(); musicInfo.ID = CommitBase(baseInfo,ref fset,srcIp,context); context.Music.InsertOnSubmit(musicInfo); context.SubmitChanges(); context.Transaction.Commit(); } catch (System.Exception e) { context.Transaction.Rollback(); throw e; } return baseInfo.ID; }