public int Update(T obj) { if (obj is MyEntitesBase) { MyEntitesBase o = obj as MyEntitesBase; o.ModifieOn = DateTime.Now; o.ModifieOnUserName = App1.Common.GetCurrentUsername(); } return(Save()); }
public int Insert(T obj) { db.Set <T>().Add(obj); if (obj is MyEntitesBase) { MyEntitesBase o = obj as MyEntitesBase; DateTime now = DateTime.Now; o.CreatedOn = now; o.ModifieOn = now; o.ModifieOnUserName = App1.Common.GetCurrentUsername(); } return(Save()); }