public override int AddNew(Config obj) { using (EvenselPOSEntities context = new EvenselPOSEntities()) { context.AddToConfigs(obj); context.SaveChanges(); } return(1); }
public override bool?Update(Config obj) { using (EvenselPOSEntities context = new EvenselPOSEntities()) { var query = from n in context.Configs where n.ID == obj.ID select n; if (query != null) { context.AddToConfigs(obj); context.ObjectStateManager.ChangeObjectState(obj, System.Data.EntityState.Modified); return(IsChanged(context.SaveChanges())); } return(null); } }