public static int addUserVOD(Com.UserVOD userVOD) { try { using (var ent = DB.Entity) { ent.UserVODs.Add(userVOD); ent.SaveChanges(); return(userVOD.UVID); } } catch (Exception e) { new System.Threading.Thread(delegate() { Log.DoLog(Com.Common.Action.addUserVOD, userVOD.UID.ToString(), -100, e.Message); }); return(-100); } }
public static bool UpdateUserVOD(Com.UserVOD mUserVOD) { try { using (var ent = DB.Entity) { ent.UserVODs.Attach(mUserVOD); var Entry = ent.Entry(mUserVOD); Entry.Property(ex => ex.Duration).IsModified = true; Entry.Property(ex => ex.ItemVOD).IsModified = true; Entry.Property(ex => ex.TypeVODStr).IsModified = true; ent.SaveChanges(); return(true); } } catch (Exception e) { new System.Threading.Thread(delegate() { Log.DoLog(Com.Common.Action.UpdateUserVOD, mUserVOD.UVID.ToString(), -100, e.Message); }); return(false); } }