private bool AddIncident(PatrolsListViewModel ViewModel) { var serviceClient = new TFMIntegrationServiceClient(); var result = serviceClient.AddIncidentAsync(ViewModel.SelectedPatrol.PatrolOriginalId, DateTime.Now, ViewModel.Latitude, ViewModel.Longitude, txtBlkComments.Text); return(result.Result); }
private bool AddIncident(PatrolDetailsViewModel ViewModel) { var serviceClient = new TFMIntegrationServiceClient(); var result = serviceClient.AddIncidentAsync(ViewModel.Patrol.PatrolOriginalId, DateTime.Now, ViewModel.EventLatitude, ViewModel.EventLongitude, CommentText.Text); return(result.Result); }
public AssignedPatrolsViewModel() { AssignedPatrols = new ObservableCollection <PatrolDTO>(); client = new ServiceLayerClient(); tfmClient = new TFMIntegrationServiceClient(); ShowVideoCommand = new Command(ShowVideo); ShowImageCommand = new Command(ShowImage); }
private bool AddDuty(PatrolDetailsViewModel ViewModel) { var serviceClient = new TFMIntegrationServiceClient(); if (!serviceClient.ValidateBeforeAssignPatrol(ViewModel.NotificationId, ViewModel.Patrol.PatrolId)) { //TODO: Show Message to tell the user that the patrol is already assigned. var msgBox = new MessageBoxUserControl(Properties.Resources.strPatrolAssignment, false); msgBox.Owner = Window.GetWindow(this); msgBox.ShowDialog(); return(false);//Or true (Based on the scenario). } var result = serviceClient.AddDutyAsync(ViewModel.Patrol.PatrolOriginalId, CommentText.Text, DateTime.Now, ViewModel.EventLatitude, ViewModel.EventLongitude, ViewModel.NotificationId, (int)ViewModel.Patrol.PatrolId); if (result.Result > 0) { serviceClient.UpdatePatrolCurrentTask(ViewModel.Patrol.PatrolOriginalId, result.Result); return(true); } return(false); }