Exemplo n.º 1
0
 public override int AddNew(Config obj)
 {
     using (EvenselPOSEntities context = new EvenselPOSEntities())
     {
         context.AddToConfigs(obj);
         context.SaveChanges();
     }
     return(1);
 }
Exemplo n.º 2
0
        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);
            }
        }