public static int UpdateRoomDeviceTimeOn(DeviceOnTime reg)
 {
     using (HomeAutomationEntities context = new HomeAutomationEntities())
     {
         context.DeviceOnTime.Attach(reg);
         context.Entry(reg).State = EntityState.Modified;
         int result = context.SaveChanges();
         return(result);
     }
 }
예제 #2
0
 public static int Update(User reg)
 {
     using (HomeAutomationEntities context = new HomeAutomationEntities())
     {
         context.User.Attach(reg);
         context.Entry(reg).State = EntityState.Modified;
         int result = context.SaveChanges();
         return(result);
     }
 }