public WorkerQueueItemViewModel(INetworkService networkService, IUserDialogs userDialogs, Incident incident, string fullName) : base(networkService, userDialogs) { DateOpened = incident.DateOpened; Id = incident.Id; ImageLink = incident.ImageLink; Subject = incident.Subject; UserId = incident.AssignedToId; FullName = fullName; }
private async Task SaveIncidentDataAsync() { if (CheckNetworkConnection()) { // First save the image/audio string imagePath = string.Empty; if (Image != null && Image.Length > 0) { imagePath = await _azureService.SaveBlobAsync(Image, ".png"); } string audioPath = string.Empty; if (AudioRecording != null && AudioRecording.Length > 0) { audioPath = await _azureService.SaveBlobAsync(AudioRecording, AudioRecordingFileExtension); } var newIncident = new Incident { Subject = Subject, AssignedToId = AssignedToId, Description = Description, ImageLink = imagePath, AudioLink = audioPath, Closed = false, DateOpened = DateTime.MinValue, DateClosed = DateTime.MinValue }; await _azureService.MobileService.GetTable<Incident>().InsertAsync(newIncident); } }