예제 #1
0
 public long CommitMovie(
     BaseItem baseInfo,Movie movieInfo, FSM.FileSet fset,string srcIp)
 {
     ShareManDBDataContext context = new ShareManDBDataContext();
     try
     {
         context.Connection.Open();
         context.Transaction = context.Connection.BeginTransaction();
         movieInfo.ID = CommitBase(baseInfo, ref fset,srcIp,context);
         context.Movie.InsertOnSubmit(movieInfo);
         context.SubmitChanges();
         context.Transaction.Commit();
     }
     catch (System.Exception e)
     {
         context.Transaction.Rollback();
         throw e;
     }
     return baseInfo.ID;
 }
예제 #2
0
 partial void DeleteMovie(Movie instance);
예제 #3
0
 partial void UpdateMovie(Movie instance);
예제 #4
0
 partial void InsertMovie(Movie instance);
예제 #5
0
 public void UpdateMovie(BaseItem baseInfo,Movie movieInfo)
 {
     ShareManDBDataContext context = new ShareManDBDataContext();
     try
     {
         context.Connection.Open();
         context.Transaction = context.Connection.BeginTransaction();
         UpdateBase(baseInfo, context);
         var mv = from b in context.Movie where b.ID == baseInfo.ID select b;
         foreach (Movie b in mv)
         {
             b.Player = movieInfo.Player;
             b.Director = movieInfo.Director;
         }
         context.SubmitChanges();
         context.Transaction.Commit();
     }
     catch(Exception e)
     {
         context.Transaction.Rollback();
         throw e;
     }
 }
예제 #6
0
 private SB.Movie Convert(Movie movInfo)
 {
     SB.Movie mv = new ShareMan.SB.Movie
     {
         ID = movInfo.ID,
         Director = movInfo.Director,
         Player = movInfo.Player
     };
     return mv;
 }