public async void insertUpdate_More(DB_More data) { SQLiteAsyncConnection db = GetConn(); if (await db.InsertAsync(data) != 0) { await db.UpdateAsync(data); } }
private async void Test_More() { StorageFolder applicationFolder = ApplicationData.Current.LocalFolder; await applicationFolder.CreateFolderAsync("more", CreationCollisionOption.ReplaceExisting); StorageFolder imageFolder = await applicationFolder.GetFolderAsync("more"); await imageFolder.CreateFileAsync("avatar.jpg", CreationCollisionOption.ReplaceExisting); StorageFile imageFile = await imageFolder.GetFileAsync("avatar.jpg"); StorageFile inFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Resource/avatar_test.jpg")); await inFile.CopyAndReplaceAsync(imageFile); DB_More_Controll moreControll = new DB_More_Controll(); DB_More more = await moreControll.get_more(); more_nickName.Text = more.nickName; more_sex.SelectedIndex = more.sex; avatar_img.Source = new BitmapImage(new Uri(applicationFolder.Path + more.avatarPath)); more_declaration.Text = more.declaration; }