private void OrganizationsToolStripMenuItem_Click(object sender, EventArgs e) { OrganizationsForm organizationsForm = new OrganizationsForm(sqlConnectionString); organizationsForm.ShowDialog(); LoadTabs(); }
// Открытие окна оргранизаций для выбора организации private void organizationButton_Click(object sender, EventArgs e) { string value = OrganizationsForm.ShowDialog(sqlConnectionString, residentId); if (value != null) { Int32.TryParse(value, out int organizationId); Organization organization = db.GetTable <Organization>().SingleOrDefault(o => o.OrganizationId == organizationId); if (organization != null) { organizationIdLabel.Text = organizationId.ToString(); organizationTextBox.Text = organization.Name; } } }
/// <summary> /// Открытие окна организаций для выбора /// </summary> /// <param name="sqlConnection">Подключение пользователя</param> /// <param name="residentId">Идентификатор пользователя</param> /// <returns></returns> public static string ShowDialog(SqlConnectionStringBuilder sqlConnectionString, int residentId) { OrganizationsForm residentForm = new OrganizationsForm(sqlConnectionString, residentId); return(residentForm.ShowDialog() == DialogResult.OK ? residentForm.organizationIdLabel.Text : null); }
private void OrganizationsToolStripMenuItem_Click(object sender, EventArgs e) { OrganizationsForm organizationsForm = new OrganizationsForm(); organizationsForm.Show(); }