private async void dataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (dataGrid.SelectedIndex != -1) { amountText.Text = (dataGrid.SelectedItem as object[])[2].ToString(); reasonText.Text = (dataGrid.SelectedItem as object[])[3].ToString(); imageCheck.Source = await ImageConventer.ByteToImage((byte[])(dataGrid.SelectedItem as object[])[4]); } }
private async void InsertReturn_Click(object sender, RoutedEventArgs e) { if (returnComboBox.SelectedIndex != -1 && imageCheck.Source != null) { DataBase.CDUBase(connectionString, $"insert into [Return] (ID_Warehouse, Amount, [Case], [Check]) values " + $"({returnComboBox.SelectedValue}, {amountReturn.Text}, '{reasonReturn.Text}', @img)", "@img", await ImageConventer.ImageToByte(file)); var message = new MessageDialog("Возврат успешно запрошен!").ShowAsync(); } }