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; }
partial void DeleteMovie(Movie instance);
partial void UpdateMovie(Movie instance);
partial void InsertMovie(Movie instance);
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; } }
private SB.Movie Convert(Movie movInfo) { SB.Movie mv = new ShareMan.SB.Movie { ID = movInfo.ID, Director = movInfo.Director, Player = movInfo.Player }; return mv; }