Add auto-DHCP option to teacher setting window

This commit is contained in:
Tim Young 2017-08-14 10:28:03 -05:00
parent e086782532
commit 4779bf2425
2 changed files with 25 additions and 1 deletions

View File

@ -69,6 +69,7 @@
this.tbStudentUsername = new System.Windows.Forms.TextBox(); this.tbStudentUsername = new System.Windows.Forms.TextBox();
this.tvClasswork = new System.Windows.Forms.TreeView(); this.tvClasswork = new System.Windows.Forms.TreeView();
this.btnExit = new System.Windows.Forms.Button(); this.btnExit = new System.Windows.Forms.Button();
this.cbTeacherAutoDHCP = new System.Windows.Forms.CheckBox();
this.tcTabControl.SuspendLayout(); this.tcTabControl.SuspendLayout();
this.TabProfile.SuspendLayout(); this.TabProfile.SuspendLayout();
this.TabClasswork.SuspendLayout(); this.TabClasswork.SuspendLayout();
@ -94,6 +95,7 @@
// //
// TabProfile // TabProfile
// //
this.TabProfile.Controls.Add(this.cbTeacherAutoDHCP);
this.TabProfile.Controls.Add(this.btnChangePassword); this.TabProfile.Controls.Add(this.btnChangePassword);
this.TabProfile.Controls.Add(this.lblFullName); this.TabProfile.Controls.Add(this.lblFullName);
this.TabProfile.Controls.Add(this.tbFullName); this.TabProfile.Controls.Add(this.tbFullName);
@ -496,6 +498,17 @@
this.btnExit.UseVisualStyleBackColor = true; this.btnExit.UseVisualStyleBackColor = true;
this.btnExit.Click += new System.EventHandler(this.btnExit_Click); this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
// //
// cbTeacherAutoDHCP
//
this.cbTeacherAutoDHCP.AutoSize = true;
this.cbTeacherAutoDHCP.Location = new System.Drawing.Point(20, 107);
this.cbTeacherAutoDHCP.Name = "cbTeacherAutoDHCP";
this.cbTeacherAutoDHCP.Size = new System.Drawing.Size(210, 21);
this.cbTeacherAutoDHCP.TabIndex = 5;
this.cbTeacherAutoDHCP.Text = "Auto DHCP on network Load";
this.cbTeacherAutoDHCP.UseVisualStyleBackColor = true;
this.cbTeacherAutoDHCP.CheckedChanged += new System.EventHandler(this.cbTeacherAutoDHCP_CheckedChanged);
//
// PersonProfileForm // PersonProfileForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
@ -564,5 +577,6 @@
private System.Windows.Forms.Button btnAllHomeworkToStudents; private System.Windows.Forms.Button btnAllHomeworkToStudents;
private System.Windows.Forms.Button btnReadAllStudentHomework; private System.Windows.Forms.Button btnReadAllStudentHomework;
private System.Windows.Forms.Button btnExportStudentPasswords; private System.Windows.Forms.Button btnExportStudentPasswords;
private System.Windows.Forms.CheckBox cbTeacherAutoDHCP;
} }
} }

View File

@ -269,14 +269,19 @@ namespace EduNetworkBuilder
if (CurrentUser.isAdmin) this.Text = "Admin: " + CurrentUser.UserName; if (CurrentUser.isAdmin) this.Text = "Admin: " + CurrentUser.UserName;
else this.Text = "Student: " + CurrentUser.UserName; else this.Text = "Student: " + CurrentUser.UserName;
cbTeacherAutoDHCP.Checked = CurrentUser.UserSettings.AutoDHCPAllMachinesAtNetworkLoad;
tvClasswork.Nodes.Clear(); tvClasswork.Nodes.Clear();
if (CurrentUser.isAdmin) if (CurrentUser.isAdmin)
{ {
cbTeacherAutoDHCP.Visible = true;
UpdateAdminFormFromUser(); UpdateAdminFormFromUser();
} }
else else
{
cbTeacherAutoDHCP.Visible = false;
UpdateStudentFormFromUser(); UpdateStudentFormFromUser();
}
} }
private void UpdateAdminFormFromUser() private void UpdateAdminFormFromUser()
@ -978,5 +983,10 @@ namespace EduNetworkBuilder
WriteStudentCSVFile(mydialog.FileName); WriteStudentCSVFile(mydialog.FileName);
} }
private void cbTeacherAutoDHCP_CheckedChanged(object sender, EventArgs e)
{
CurrentUser.UserSettings.AutoDHCPAllMachinesAtNetworkLoad = cbTeacherAutoDHCP.Checked;
}
} }
} }