1 using System;
2 using
System.Collections.Generic;
3 using
System.ComponentModel;
4 using
System.Drawing;
5 using
System.Data;
6 using
System.Text;
7 using
System.Windows.Forms;
8
9 namespace
Scheduler
10 {
11     
public partial class frmSetActiveSY : Form
12     {
13
14         
public frmSetActiveSY()
15         {
16             InitializeComponent();
17         }
18
19         
private void button1_Click(object sender, EventArgs e)
20         {
21             
if (cboSY.Text == "")
22             { MessageBox.Show(
"Please enter School Year."); }
23             
else
24             {
25                 System.IO.StreamWriter Writer =
new System.IO.StreamWriter(Application.StartupPath + "\\config.txt");
26                 Writer.Write(cboSY.Text);
27                 Writer.Close();
28                 clsSchedule.CurrentSchoolYear = cboSY.Text;
29
30                 
this.Close();
31
32                 MainForm main =
new MainForm();
33                 main.ReloadSchoolYear();
34                                 
35             }
36         }
37
38         
private void frmSetActiveSY_Load(object sender, EventArgs e)
39         {
40             
try
41             {
42                 
if (clsCon.con.State == ConnectionState.Open)
43                 {
44                     clsCon.con.Close();
45                 }
46                 clsCon.con.Open();
47             }
48             
catch (Exception exp)
49             {
50                 MessageBox.Show(exp.ToString());
51             }
52
53             clsCon.fillCombo(cboSY,
"Select SchoolYear From tblSchoolYear");
54         }
55
56     }
57 }


Gõ tìm kiếm nhanh...