using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Brovi11 { public partial class ProductSale : Form { public ProductSale() { InitializeComponent(); } int selectedRow; private void ReadSingleRow(DataGridView dgw, IDataRecord record) { dgw.Rows.Add(record.GetInt32(0), record.GetString(1), record.GetString(2), record.GetString(3), record.GetString(4), RoWState.ModifiedNew); } private void ProductSale_Load(object sender, EventArgs e) { // TODO: данная строка кода позволяет загрузить данные в таблицу "_1Brovi11DataSet.ProductSale". При необходимости она может быть перемещена или удалена. this.productSaleTableAdapter.Fill(this._1Brovi11DataSet.ProductSale); } private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { selectedRow = e.RowIndex; if (e.RowIndex >= 0) { DataGridViewRow row = dataGridView1.Rows[selectedRow]; titleTextBox.Text = row.Cells[0].Value.ToString(); costTextBox.Text = row.Cells[1].Value.ToString(); descriptionTextBox.Text = row.Cells[2].Value.ToString(); } } private void button2_Click(object sender, EventArgs e) { productSaleBindingSource.Sort = "SaleDate Desc"; } private void button3_Click(object sender, EventArgs e) { productSaleBindingSource.Filter = "ProductID = '" + productIDComboBox.Text + "'"; } private void button4_Click(object sender, EventArgs e) { productSaleBindingSource.Filter = null; } private void button1_Click(object sender, EventArgs e) { FormaAdmin f1 = new FormaAdmin(); f1.Show(); this.Hide(); } } }