.Text! = "")
{. Text = "";
} dgv = new DataGridView (); _db.ReadDataBase (dgv, "Select Tovar.name_tovara From Tovar Where" +
"id_tovara in (Select id_tovara From Sklad Where id_tovara_na_sklade =" + cmbIdTovNaSkl.Text + ")"); (int i = 0; i
{(i
} _db.ReadDataBase (dgv, "Select Postavshik.name_postavshika From Postavshik Where" +
"id_postavshika in (Select id_postavshika From Sklad Where id_tovara_na_sklade =" + cmbIdTovNaSkl.Text + ")"); (int i = 0; i
{(i
}
}
} void btnAddNew_Click (object sender, EventArgs e)
{(txtKol_vo.Text! = "" && cmbZak.Text! = "" && cmbIdTovNaSkl.Text! = "")
{dgv = new DataGridView (); _db.ReadDataBase (dgv, "Select id_zakazchika From Zakazchik Where name_zakazchika = '" + cmbZak.Text + "'"); _id_zak = dgv. Rows [0]. Cells [0]. Value.ToString (); _db.ReadDataBase (dgv, "Select kolichestvo From Sklad Where id_tovara_na_sklade =" + Convert.ToInt32 (cmbIdTovNaSkl.Text)); _vo_na_skl = (int) dgv . Rows [0]. Cells [0]. Value; tick = new Naklad (); m_txtKol_vo = Convert.ToInt32 (txtKol_vo.Text);
// якщо на складі не вистачає (kol_vo_na_skl
{_vo_razn = m_txtKol_vo - kol_vo_na_skl; (MessageBox.Show ("На складі мало цього товару. Бракує" + kol_vo_razn, "Увага!", MessageBoxButtons.OKCancel) == DialogResult . OK)
{_Load (0, null);
}
}
// else if (kol_vo_na_skl == m_txtKol_vo)
// {
// tick.DELETE = "Delete From Sklad Where id_tovara_na_sklade =" + cmbIdTovNaSkl.Text;
//}
{_vo_razn1 = kol_vo_na_skl - m_txtKol_vo;. update = "UPDATE Sklad SET kolichestvo =" + kol_vo_razn1 + "Where id_tovara_na_sklade =" + Convert.ToInt32 (cmbIdTovNaSkl.Text);. insert = "Insert Into nakladnaya (id_zakazchika, id_tovara_na_sklade, date_nakladnoy, kolichestvo_tovarov) Values ​​(" + m_id_zak + "," + cmbIdTovNaSkl.Text + ", DateValue ('" + _Nakl.Value.Date.ToString () + "')," + txtKol_vo.Text + ")";. select = "Select id_nakladnoy, id_zakazchika, id_tovara_na_sklade, date_nakladnoy, kolichestvo_tovarov" +
"From nakladnaya Where id_zakazchika =" + m_id_zak + "And id_tovara_na_sklade =" + cmbIdTovNaSkl.Text +
"And DateValue (date_nakladnoy) = DateValue ('" + dtpicDate_Nakl.Value.Date.ToString () + "')"; _nklList.Add (tick);