private void dataGridViewDoc_Click(object sender, EventArgs e) { int id_doc = (int)dataGridViewDoc.SelectedRows[0].Cells["id_doc"].Value; dataGridViewTovar.DataSource = Doc_Tovar.GetTovar(id_doc); BD.DocNum = id_doc; button2.Enabled = true; }
private void dataGridViewTov_Click(object sender, EventArgs e) { BD.IdMat = (int)dataGridViewTov.SelectedRows[0].Cells["id_mat"].Value; BD.NameMat = dataGridViewTov.SelectedRows[0].Cells["name_mat"].Value.ToString(); AddingTovar at = new AddingTovar(dataGridViewTov); at.Owner = this; at.ShowDialog(); dataGridView1.DataSource = Doc_Tovar.GetTovar(BD.DocNum); dataGridViewTov.DataSource = BD.GetTablePolya("Sp_Mat", "id_mat", "name_mat", "kl_opt"); }
private void EditDocForm_Load(object sender, EventArgs e) { comboBox1.DataSource = BD.GetTable("Sp_Post"); comboBox1.DisplayMember = "name_post"; comboBox1.ValueMember = "id_post"; labelDocNum.Text += BD.DocNum.ToString(); dataGridViewTov.DataSource = BD.GetTablePolya("Sp_Mat", "id_mat", "name_mat", "kl_opt"); dataGridView1.DataSource = Doc_Tovar.GetTovar(BD.DocNum); button2.Enabled = false; }
private void button1_Click(object sender, EventArgs e) { BD.IdTov = (int)dataGridView1.SelectedRows[0].Cells["id_id"].Value; BD.DelTov(); dataGridView1.DataSource = Doc_Tovar.GetTovar(BD.DocNum); }