亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mainform.cs

?? 集學生管理系統、學生選課系統、老師管理系統與一身 不錯的
?? CS
?? 第 1 頁 / 共 2 頁
字號:
// MainForm.cs - Chapter 16 version.

// Copyright 2004 by Jacquie Barker and Grant Palmer - all rights reserved.

// A GUI class.

using System;
using System.Collections;
using System.Windows.Forms;
using System.Drawing;

public class MainForm : Form {

  private Button dropButton, saveButton;
  private Button addButton, logOffButton;
  private TextBox ssnTextBox, nameTextBox, totalTextBox; 
  private ListBox scheduleListBox, registeredListBox; 
  private Label classScheduleLabel, ssnLabel;
  private Label nameLabel, totalCourseLabel;
  private Label registeredLabel;
  private PasswordForm passwordDialog;

  // Maintain a handle on the Student who is logged in.
  // (Whenever this is set to null, nobody is officially logged on.)
  private Student currentUser;

  public MainForm() {

    currentUser = null;

    // Create left-hand side labels
    int labelVertSpace = 40;
    int labelLeft = 5;

    ssnLabel = new Label();
    ssnLabel.Text = "SSN:";
    ssnLabel.Font = new Font(ssnLabel.Font, FontStyle.Bold);
    ssnLabel.AutoSize = true;
    ssnLabel.Top = 5;
    ssnLabel.Left = labelLeft;

    nameLabel = new Label();
    nameLabel.Text = "Name:";
    nameLabel.Font = new Font(nameLabel.Font, FontStyle.Bold);
    nameLabel.AutoSize = true;
    nameLabel.Top = ssnLabel.Top + labelVertSpace;
    nameLabel.Left = labelLeft;

    totalCourseLabel = new Label();
    totalCourseLabel.Text = "Total Courses:";
    totalCourseLabel.Font = new Font(totalCourseLabel.Font, FontStyle.Bold);
    totalCourseLabel.AutoSize = true;
    totalCourseLabel.Top = nameLabel.Top + labelVertSpace;
    totalCourseLabel.Left = labelLeft;

    registeredLabel = new Label();
    registeredLabel.Text = "Registered For:";
    registeredLabel.Font = new Font(registeredLabel.Font, FontStyle.Bold);
    registeredLabel.AutoSize = true;
    registeredLabel.Top = totalCourseLabel.Top + labelVertSpace;
    registeredLabel.Left = labelLeft;

    // Create TextBox components
    ssnTextBox = new TextBox();
    ssnTextBox.Width = 140;
    ssnTextBox.AutoSize = true;
    ssnTextBox.Top = ssnLabel.Top;
    ssnTextBox.Left = totalCourseLabel.Right + 15;

    // Assign an event handler to the SSN TextBox
    ssnTextBox.KeyUp += new KeyEventHandler(SsnTextBoxKeyUp);

    nameTextBox = new TextBox();
    nameTextBox.Width = 140;
    nameTextBox.AutoSize = true;
    nameTextBox.Top = nameLabel.Top;
    nameTextBox.Left = totalCourseLabel.Right + 15;
    nameTextBox.ReadOnly = true;

    totalTextBox = new TextBox();
    totalTextBox.Width = 20;
    totalTextBox.AutoSize = true;  
    totalTextBox.Top = totalCourseLabel.Top;
    totalTextBox.Left = totalCourseLabel.Right + 15;
    totalTextBox.ReadOnly = true;

    // Create right-hand side labels
    classScheduleLabel = new Label();
    classScheduleLabel.Text = "--- Schedule of Classes ---";
    classScheduleLabel.Font = new Font(classScheduleLabel.Font, FontStyle.Bold);
    classScheduleLabel.AutoSize = true;
    classScheduleLabel.Top = 5;
    classScheduleLabel.Left = ssnTextBox.Right + 55;

    // Create "Schedule of Classes" ListBox Component
    scheduleListBox = new ListBox();
    scheduleListBox.Width = 210;
    scheduleListBox.Height = 225;
    scheduleListBox.Top = classScheduleLabel.Bottom + 5;
    scheduleListBox.Left = ssnTextBox.Right + 30;

    // Display an alphabetically sorted course catalog list
    // in the scheduleListBox component.
    ArrayList sortedSections = SRS.scheduleOfClasses.GetSortedSections();
    for(int i = 0; i < sortedSections.Count; ++i) {
      scheduleListBox.Items.Add(sortedSections[i]);
    }

    // Create "Registered For" ListBox Component
    registeredListBox = new ListBox();
    registeredListBox.Width = 210;
    registeredListBox.Top = registeredLabel.Bottom + 5;
    registeredListBox.Height = scheduleListBox.Bottom - registeredListBox.Top + 3;
    registeredListBox.Left = labelLeft;

    // Add event handlers to the ListBox components
    scheduleListBox.SelectedIndexChanged += 
                new EventHandler(ScheduleSelectionChanged);
    registeredListBox.SelectedIndexChanged += 
                new EventHandler(RegisteredSelectionChanged);

    // Create buttons
    int buttonHeight = 50;
    int buttonWidth = 80;
    int buttonTop = 260;

    dropButton = new Button(); 
    dropButton.Text = "Drop";
    dropButton.Height = buttonHeight;
    dropButton.Width = buttonWidth;
    dropButton.Top = buttonTop;
    dropButton.Left = 10;

    saveButton = new Button(); 
    saveButton.Text = "Save My Schedule";
    saveButton.Height = buttonHeight;
    saveButton.Width = buttonWidth;
    saveButton.Top = buttonTop;
    saveButton.Left = dropButton.Right + 5;

    addButton = new Button(); 
    addButton.Text = "Add";
    addButton.Height = buttonHeight;
    addButton.Width = buttonWidth;
    addButton.Top = buttonTop;
    addButton.Left = saveButton.Right + 100;

    logOffButton = new Button(); 
    logOffButton.Text = "Log Off";
    logOffButton.Height = buttonHeight;
    logOffButton.Width = buttonWidth;
    logOffButton.Top = buttonTop;
    logOffButton.Left = addButton.Right + 5;

    // Assign event handlers to the Buttons
    addButton.Click += new EventHandler(AddButtonClicked);
    dropButton.Click += new EventHandler(DropButtonClicked);
    saveButton.Click += new EventHandler(SaveButtonClicked);
    logOffButton.Click += new EventHandler(LogOffButtonClicked);

    // Initialize the buttons to their proper enabled/disabled
    // state.
    ResetButtons();

    // Add the GUI components to the form
    this.Controls.Add(dropButton);
    this.Controls.Add(saveButton);
    this.Controls.Add(addButton);
    this.Controls.Add(logOffButton);
    this.Controls.Add(classScheduleLabel);
    this.Controls.Add(ssnLabel);
    this.Controls.Add(ssnTextBox);
    this.Controls.Add(nameLabel);
    this.Controls.Add(nameTextBox);
    this.Controls.Add(totalCourseLabel);
    this.Controls.Add(totalTextBox);
    this.Controls.Add(registeredLabel);
    this.Controls.Add(scheduleListBox);
    this.Controls.Add(registeredListBox);

    // Set some appearance properties for the Form
    this.Text = "Student Registration System";
    this.Height = 350;
    this.Width = 500;
    this.MinimumSize = this.Size;
    this.StartPosition = FormStartPosition.CenterScreen;
    this.Visible = true;
  }

  // event handling method for the "Drop" Button
  public void DropButtonClicked(object source, EventArgs e) {
    // Determine which section is selected (note that we must
    // cast it, as it is returned as an Object reference).
    Section selected = (Section)registeredListBox.SelectedItem;

    // Drop the course.
    selected.Drop(currentUser);

    // Display a confirmation message.
    string message = "Course " + 
       selected.RepresentedCourse.CourseNo + " dropped.";
    MessageBox.Show(message, "Request Successful",
            MessageBoxButtons.OK, MessageBoxIcon.Information);

    // Update the list of sections that 
    // this student is registered for.
    registeredListBox.Items.Clear();
    IEnumerator ie = currentUser.GetEnrolledSections();
    while ( ie.MoveNext() ) {
      registeredListBox.Items.Add((Section)ie.Current);
    }

    // Update the field representing student's course total.
    totalTextBox.Text = "" + currentUser.GetCourseTotal();

    // Check states of the various buttons.
    ResetButtons();
  }

  // event handling method for the "Save" Button
  public void SaveButtonClicked(object source, EventArgs e) {
    bool success = currentUser.Persist();
    if (success) {
      // Let the user know that his/her
      // schedule was successfully saved.
      MessageBox.Show("Schedule saved", "Schedule Saved",
            MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
    else {
      // Let the user know that there was a problem.
      string message = "Problem saving your " +
                       "schedule; please contact " +
                       "SRS Support Staff for assistance.";
      MessageBox.Show(message, "Problem Saving Schedule",
               MessageBoxButtons.OK, MessageBoxIcon.Warning);
    }
  }

  // event handling method for the "Add" Button
  public void AddButtonClicked(object source, EventArgs e) {
    // Determine which section is selected (note that we must
    // cast it, as it is returned as an Object reference).
    Section selected = (Section)scheduleListBox.SelectedItem;

    // Attempt to enroll the student in the section, noting
    // the status code that is returned.
    int status = selected.Enroll(currentUser);

    // Report the status to the user.
    if (status == Section.SECTION_FULL) {
      MessageBox.Show("Sorry - that section is full.", "Request Denied",
               MessageBoxButtons.OK, MessageBoxIcon.Warning);
    }
    else {
      if (status == Section.PREREQ_NOT_SATISFIED) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
粉嫩在线一区二区三区视频| 国产98色在线|日韩| 国产日韩视频一区二区三区| 欧美在线色视频| 国产在线精品一区二区夜色 | 欧美bbbbb| 亚洲久本草在线中文字幕| 精品国产污网站| 欧美日韩免费一区二区三区视频 | 欧美日韩aaa| av中文字幕在线不卡| 国内精品伊人久久久久av影院| 一区二区三区在线视频免费观看| 国产日韩欧美综合一区| 日韩美女一区二区三区四区| 欧美日韩一区高清| 91理论电影在线观看| 国内精品久久久久影院一蜜桃| 同产精品九九九| 一区二区三区在线免费| 亚洲欧洲av色图| |精品福利一区二区三区| 亚洲国产精品99久久久久久久久| 精品捆绑美女sm三区| 制服.丝袜.亚洲.中文.综合| 在线观看一区二区视频| 91网站最新网址| voyeur盗摄精品| 成人av影院在线| 国产91清纯白嫩初高中在线观看| 国产一区二区调教| 激情综合色丁香一区二区| 欧美bbbbb| 精品一区二区三区在线播放视频| 麻豆91精品91久久久的内涵| 日本中文在线一区| 丝袜国产日韩另类美女| 午夜精品福利一区二区蜜股av | 亚洲国产精品自拍| 亚洲猫色日本管| 亚洲欧洲日韩综合一区二区| 一区精品在线播放| 黄色资源网久久资源365| 伦理电影国产精品| 国产一区在线观看视频| 国产精品香蕉一区二区三区| 国产成人精品影院| 狠狠色伊人亚洲综合成人| 国产一区在线看| 成人av资源在线| 99re热视频精品| 在线日韩av片| 欧美日韩视频第一区| 制服丝袜av成人在线看| 精品国精品国产| 中文欧美字幕免费| 亚洲男人的天堂在线观看| 亚洲成人综合视频| 美女看a上一区| 国产91丝袜在线播放九色| 色综合天天在线| 欧美一区二区三级| 中文字幕第一区第二区| 一区二区视频免费在线观看| 午夜精品久久久久久久99樱桃| 老司机午夜精品| 成人精品gif动图一区| 色综合中文综合网| 国产成人精品免费看| 国产精品77777| 91网址在线看| 欧美视频第二页| 日韩美女在线视频| 亚洲三级免费电影| 日本欧美一区二区| 成人av网站在线| 日韩欧美亚洲国产另类| 国产精品免费视频观看| 天堂影院一区二区| 不卡的av网站| 精品欧美久久久| 中文字幕中文乱码欧美一区二区| 天天色天天操综合| 成人毛片老司机大片| 欧美高清激情brazzers| 国产日韩精品久久久| 亚洲.国产.中文慕字在线| 国产精品乡下勾搭老头1| 欧美人动与zoxxxx乱| 国产精品初高中害羞小美女文| 免费高清在线一区| 色婷婷综合久色| 国产午夜精品理论片a级大结局| 夜夜揉揉日日人人青青一国产精品| 激情综合色播激情啊| 欧美日韩国产一区| 中文字幕在线观看不卡| 久久精品久久久精品美女| 91麻豆国产福利精品| 久久久综合视频| 日韩av不卡一区二区| 在线精品亚洲一区二区不卡| 国产亚洲欧美色| 久久精品国产99| 欧美日韩一区二区三区不卡| 日韩成人av影视| 91国产免费看| 国产精品入口麻豆九色| 国内精品视频一区二区三区八戒| 欧美疯狂做受xxxx富婆| 亚洲欧美福利一区二区| 成人a免费在线看| 国产偷国产偷亚洲高清人白洁| 欧美aa在线视频| 欧美日高清视频| 亚洲精品视频在线| 成人黄色777网| 国产精品色噜噜| 成人网页在线观看| 中文字幕乱码日本亚洲一区二区 | 一区二区三区精品| 色综合久久久网| ●精品国产综合乱码久久久久| 国产91丝袜在线观看| 国产午夜精品福利| 国产精品456| 久久精品亚洲国产奇米99| 国产一本一道久久香蕉| wwwwxxxxx欧美| 国产乱国产乱300精品| 久久精品人人做人人爽97| 国产原创一区二区三区| 国产情人综合久久777777| 成人在线综合网站| 中文子幕无线码一区tr| 99久久婷婷国产综合精品电影| 亚洲天堂成人网| 色吧成人激情小说| 午夜精品视频一区| 欧美一二三区在线| 激情五月激情综合网| 久久久精品黄色| 成人av集中营| 一区二区三区中文免费| 欧美精品久久久久久久多人混战 | 日韩午夜精品视频| 亚洲成人综合视频| 91精品福利在线一区二区三区 | 26uuu国产电影一区二区| 精品中文字幕一区二区| 欧美成人三级在线| 顶级嫩模精品视频在线看| 欧美国产日韩在线观看| 一本色道亚洲精品aⅴ| 性久久久久久久| 2014亚洲片线观看视频免费| 成人97人人超碰人人99| 亚洲免费观看高清完整版在线观看熊 | 日韩中文字幕1| 欧美成人a在线| 夫妻av一区二区| 亚洲欧美另类小说视频| 7777精品伊人久久久大香线蕉完整版| 麻豆91精品91久久久的内涵| 欧美高清在线一区| 日本精品视频一区二区| 美国十次了思思久久精品导航| 国产欧美一区二区精品仙草咪 | 中文字幕一区二区三区乱码在线| 97久久超碰精品国产| 亚洲午夜激情网站| 精品三级在线看| 不卡视频免费播放| 午夜精品一区二区三区电影天堂| 精品久久久三级丝袜| 91免费观看视频在线| 精品在线观看视频| 亚洲男人天堂av网| 2023国产精品| 欧美色涩在线第一页| 国产成人欧美日韩在线电影| 亚洲女厕所小便bbb| 欧美xxxx老人做受| 欧美在线短视频| 国产麻豆日韩欧美久久| 亚洲成人av中文| 欧美国产日韩亚洲一区| 91精品国产综合久久福利| gogogo免费视频观看亚洲一| 蜜桃91丨九色丨蝌蚪91桃色| 亚洲六月丁香色婷婷综合久久| 日韩一区二区三区在线| 色国产综合视频| 国产电影精品久久禁18| 日本午夜一区二区| 亚洲在线视频一区| 成人欧美一区二区三区小说| 久久伊人蜜桃av一区二区| 777奇米四色成人影色区| 在线看一区二区|