static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (ConnectionString != string.Empty) { using (worker cworker = new worker()) { if (cworker.ID > 0) { using (KursForm kf = new KursForm(cworker)) { if (kf.ShowDialog() == DialogResult.OK) { using (MainForm mf = new MainForm(cworker)) { mf.ShowDialog(); } } } } else { MessageBox.Show("Неверно определен пользователь!", string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
private void chngKursB_Click(object sender, EventArgs e) { using (KursForm kf = new KursForm(cworker)) { kf.ShowDialog(); } }