コード例 #1
0
        private async void SubmitButton_Click(object sender, RoutedEventArgs e)
        {
            DisableErrors();
            if (!CheckInput()) return;

            var missing = new Missing
            {
                DisasterId = _disasterId,
                Description = txtDescription.Text,
                Image = _image,
                Name = txtName.Text,
                Feedback = "",
                Found = false,
                UserPostingId = App.User.Id
            };
            var error = false;
            try
            {
                await Service.InsertItemAsync(missing);
            }
            catch (Exception ex)
            {
                error = true;
            }

            if (error)
            {
                MessageBox.Show("Something went wrong!");
                return;
            }

            NavigationService.GoBack();
        }
コード例 #2
0
 async void camera_Completed(object sender, PhotoResult e)
 {
     var table = Service.GetTable<Missing>();
     var image = ImageHelper.GetFileBytes(e.ChosenPhoto);
     var missing = new Missing
     {
         Description = "",
         Feedback = "",
         Found = true,
         Name = "",
         UserPostingId = "asdsa",
         Image = image
     };
     await table.InsertAsync(missing);
 }