コード例 #1
0
        public DisplayIncidentDetailViewModel(INetworkService networkService, IUserDialogs userDialogs, IncidentDetail model, string fullName, DisplayIncidentViewModel parent)
            : base(networkService, userDialogs)
        {
            DetailText = model.DetailText;
            ImageLink = model.ImageLink;
            AudioRecordingLink = model.AudioLink;
            DateOpened = model.DateEntered;
            FullName = fullName;

            _parent = new WeakReference(parent);
        }
コード例 #2
0
        private async Task SaveIncidentDetailDataAsync()
        {
            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 newIncidentDetail = new IncidentDetail
                {
                    IncidentId = _incidentId,
                    DetailText = DetailText,
                    AudioLink = audioPath,
                    DateEntered = DateTime.UtcNow,
                    DetailEnteredById = UserContext.UserProfile.UserId,
                    ImageLink = imagePath
                };

                await _azureService.MobileService.GetTable<IncidentDetail>().InsertAsync(newIncidentDetail);
            }
        }