private void InvokeDelegate() { DeviceInfoReceived?.Invoke(RemSpray); DeviceInfoReceived?.Invoke(NextSprayCounter); DeviceInfoReceived?.Invoke(DaysLeft); DeviceInfoReceived?.Invoke(InitializeSpray); }
public async Task <string> SetScheduleActiveInactiveStatusinVM(DeviceInfoRequest deviceInfoRequest) { var daysleft = await deviceService.GetDeviceInfo(deviceInfoRequest); var _DaysLeft = DeserializDeviceInfo(daysleft); DaysLeft = _DaysLeft; DeviceInfoReceived?.Invoke(DaysLeft); return(daysleft); }
//////////////////////////////////////////////// //////////////////////////////////////////////// /////////////////Set device values////////////// //////////////////////////////////////////////// //////////////////////////////////////////////// public async Task <string> SetSchedulerinVM(string schedules) { var daysleft = await deviceService.SetScheduler(schedules); var _DaysLeft = DeserializDeviceInfo(daysleft); DaysLeft = _DaysLeft; DeviceInfoReceived?.Invoke(DaysLeft); return(daysleft); }
/// <summary> /// GetInitilizeSprayCount(Input) Will return count from service /// </summary> public async Task <bool> GetInitilizeSprayCount() { DeviceInfoRequest deviceInfoRequest = new DeviceInfoRequest(); deviceInfoRequest.request = "init"; deviceInfoRequest.info = "spray"; var deviceRes = await deviceService.GetDeviceInfo(deviceInfoRequest); NetworkServiceUtil.Log("DeviceDetailsViewModel GetInitilizeSprayCount init spray: " + deviceRes); InitializeSpray = DeserializDeviceInfo(deviceRes); DeviceInfoReceived?.Invoke(InitializeSpray); return(true); }
/// <summary> /// GetNextSprayCounterCount Will return count from service /// </summary> public async Task <bool> GetNextSprayCounterCount() { DeviceInfoRequest deviceInfoRequest = new DeviceInfoRequest(); deviceInfoRequest.request = "get"; deviceInfoRequest.info = "spray_counter"; var deviceRes = await deviceService.GetDeviceInfo(deviceInfoRequest); NetworkServiceUtil.Log("DeviceDetailsViewModel GetNextSprayCounterCount: " + deviceRes); NextSprayCounter = DeserializDeviceInfo(deviceRes); DeviceInfoReceived?.Invoke(NextSprayCounter); // CalculateRemainingDays(); return(false); }
public async Task <string> DeleteScheduleItem(string index) { NetworkServiceUtil.Log("DeleteScheduleItem ==> called"); ScheduleIndex scheduleIndex = new ScheduleIndex(); scheduleIndex.deleteindex = (Convert.ToInt32(index)).ToString(); scheduleIndex.request = "delete"; scheduleIndex.info = "scheduler"; var deviceRes = await deviceService.DeleteScheduleIndex(scheduleIndex); var _DaysLeft = DeserializDeviceInfo(deviceRes); DaysLeft = _DaysLeft; DeviceInfoReceived?.Invoke(DaysLeft); return(deviceRes); }
/// <summary> /// GetDaysLeftCount Will return count from service /// </summary> public async Task <bool> GetDaysLeftCount() { return(false); DeviceInfoRequest deviceInfoRequest = new DeviceInfoRequest(); deviceInfoRequest.request = "get"; deviceInfoRequest.info = "days_left"; var deviceRes = await deviceService.GetDeviceInfo(deviceInfoRequest); NetworkServiceUtil.Log("DeviceDetailsViewModel GetDaysLeftCount get spray: " + deviceRes); var _DaysLeft = DeserializDeviceInfo(deviceRes); DaysLeft = _DaysLeft; DeviceInfoReceived?.Invoke(DaysLeft); // CalculateRemainingDays(); return(true); }