⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmsubjectname.cs

📁 实现课程表编排和打印功能,通过在候选列表中选择课程和教师(没有被排课且该教师教授所选择的课程)来完成排课,代码约8000行
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace 课程安排
{
    public partial class frmSubjectName : Form
    {
        private string subjectName = "";
        public string SubjectName
        {
            get { return subjectName; }
        }

        private EditLevel editLevel = EditLevel.NULL;
        public EditLevel EditLevel
        {
            get { return editLevel; }
        }

        public frmSubjectName()
        {
            InitializeComponent();
            this.comboBox1.Enabled = true;
            LoadCombo();
        }

        public frmSubjectName(string oldName)
        {
            InitializeComponent();
            this.comboBox1.Enabled = false;
            this.textBox1.Text = oldName;
        }

        private void LoadCombo()
        {
            this.comboBox1.Items.Add(Utility.GetEditLevelString(EditLevel.小学));
            this.comboBox1.Items.Add(Utility.GetEditLevelString(EditLevel.初中));
            this.comboBox1.Items.Add(Utility.GetEditLevelString(EditLevel.高中));
            this.comboBox1.SelectedIndex = 0;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.subjectName = this.textBox1.Text;
            if (comboBox1.Enabled)
            {
                if (!Utility.CheckComboText(this.comboBox1))
                {
                    MessageBox.Show("请从列表框中选择科目级别?", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                else
                {
                    this.editLevel = Utility.GetEditLevelObject(this.comboBox1.Text);
                }
            }
            this.DialogResult = DialogResult.Yes;
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.No;
            this.Close();
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -