Example #1
0
 static void Main()
 {
     DBConnection dbconn = new DBConnection();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new ApplicationForm(ref dbconn));
 }
 public void AddStudentControlSettings(ref DBConnection dbconn)
 {
     /*
      * Since UserControls cannot take arguments to the constructor
      * this function is called after the constructor to perform this.
      *
      * You DONT need to edit this function.
      *
      */
     this.dbconn = dbconn;
 }
Example #3
0
 public ApplicationForm(ref DBConnection dbconn)
 {
     InitializeComponent();
     this.dbconn = dbconn;
     DBLabsDLL.DBConnectionBase dbconn2 = this.dbconn;
     DBLabsDLL.LoginForm login =new DBLabsDLL.LoginForm(ref dbconn2);
     login.ShowDialog();
     addStudentControl1.AddStudentControlSettings(ref dbconn);
     addStudentControl1.Visible = false;
     viewStudentControl1.ViewStudentControlSettings(ref dbconn2);
     viewStudentControl1.Visible = false;
     addCourseControl1.AddCourseControlSettings(ref dbconn2);
     addCourseControl1.Visible = false;
     viewCourseControl1.ViewCourseControlSettings(ref dbconn2);
     viewCourseControl1.Visible = false;
     staffGridControl1.StaffGridControlSettings(ref dbconn2);
     staffGridControl1.Visible = false;
 }