// Check the connectivity private void CheckConnect() { if (MyActivityRecordsController == null) { HiHealthOptions hiHealthOptions = HiHealthOptions.HiHealthOptionsBulider().Build(); AuthHuaweiId signInHuaweiId = HuaweiIdAuthManager.GetExtendedAuthResult(hiHealthOptions); MyActivityRecordsController = HuaweiHiHealth.GetActivityRecordsController(this, signInHuaweiId); } }
private async Task DeleteAllActivityRecordsAsync() // is only called because DeleteAllEmployeesAsync will not delete the placeholder employees that are present in the ActivityRecordsModel { var c = new ActivityRecordsController(_context); var index = await c.Index(); var list = (Microsoft.AspNetCore.Mvc.ViewResult)index; var IndexActivityRecordViewModel = (IndexActivityRecordViewModel)list.Model; foreach (var activityRecord in IndexActivityRecordViewModel.ActivityRecordModels) { var result = await c.DeleteConfirmed(activityRecord.EmployeeID, activityRecord.ActivityID); } }
private void Init() { HiHealthOptions hiHealthOptions = HiHealthOptions.HiHealthOptionsBulider().Build(); AuthHuaweiId signInHuaweiId = HuaweiIdAuthManager.GetExtendedAuthResult(hiHealthOptions); MyActivityRecordsController = HuaweiHiHealth.GetActivityRecordsController(this, signInHuaweiId); MyDataController = HuaweiHiHealth.GetDataController(this, signInHuaweiId); LogInfoView = (TextView)FindViewById(Resource.Id.activity_records_controller_log_info); LogInfoView.MovementMethod = ScrollingMovementMethod.Instance; BeginActivity = (Button)FindViewById(Resource.Id.records_controller_begin_activity); EndActivity = (Button)FindViewById(Resource.Id.records_controller_end_activity); AddActivity = (Button)FindViewById(Resource.Id.records_controller_add_activity); GetActivity = (Button)FindViewById(Resource.Id.records_controller_get_activity); DeleteActivity = (Button)FindViewById(Resource.Id.records_controller_delete_activity); BeginActivity.Click += delegate { BeginActivityRecord(); }; EndActivity.Click += delegate { EndActivityRecord(); }; AddActivity.Click += delegate { AddActivityRecord(); }; GetActivity.Click += delegate { GetActivityRecord(); }; DeleteActivity.Click += delegate { DeleteActivityRecord(); }; }