public static void UpdateDevice(DDeviceList pItem) { try { //Kiểm tra xem nếu tồn tại thì Update if (DDeviceList.FetchByID(pItem.DeviceId) != null) { pItem.IsNew = false; pItem.Save(); } } catch (Exception ex) { throw ex; } }
public static void DeleteDevice(int pId) { try { if (DDeviceList.FetchByID(pId) != null) { new Delete().From(DDeviceList.Schema) .Where(DDeviceList.Columns.DeviceId).IsEqualTo(pId) .Execute(); DDataControl.Delete(DDataControl.Columns.DeviceId, pId); } } catch (Exception ex) { throw ex; } }