Example #1
0
 partial void DeleteMusic(Music instance);
Example #2
0
 partial void UpdateMusic(Music instance);
Example #3
0
 partial void InsertMusic(Music instance);
Example #4
0
 private SB.Music Convert(Music mInfo)
 {
     SB.Music m = new ShareMan.SB.Music
     {
         ID = mInfo.ID,
         Author = mInfo.Author,
         Singer = mInfo.Singer
     };
     return m;
 }
Example #5
0
 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();
     }
 }
Example #6
0
 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;
 }