private void добавитьПаспортToolStripMenuItem1_Click(object sender, EventArgs e) { DocumentAdd documentAdd = new DocumentAdd(loginUser); documentAdd.ShowDialog(); cbChoosePassrport.Items.Clear(); ActionWithDB api = new ActionWithDB(); SqlDataReader reader = api.enterDocument(loginUser); while (reader.Read()) { cbChoosePassrport.Items.Add(reader[0].ToString()); } }
private void UserForm_Load(object sender, EventArgs e) { dGVFreePlace.RowHeadersVisible = false; this.Text = "Вы зашли под логином - " + loginUser; ActionWithDB api = new ActionWithDB(); if (!api.isChekingUserDocument(loginUser)) { MessageBox.Show("Отсутстует паспорт у пользователя - " + loginUser, "Добавьте паспорт", MessageBoxButtons.OK, MessageBoxIcon.Information); } SqlDataReader reader = api.enterDocument(loginUser); while (reader.Read()) { cbChoosePassrport.Items.Add(reader[0].ToString() + " "); } }