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

📄 formedit.cs

📁 C#2.0宝典源码,C#经典书籍,很多例子
💻 CS
📖 第 1 页 / 共 5 页
字号:
using System;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using StudentsMIS.CommonClassLibrary;
using StudentsMIS.DataAccess;
using StudentsMIS.Business;

namespace StudentsMIS.WinForm
{
	/// <summary>
	/// FormEdit 的摘要说明。
	/// </summary>
	public class FormEdit : System.Windows.Forms.Form
	{
    private System.Windows.Forms.TabControl tabControl1;
    private System.Windows.Forms.TabPage tabPage1;
    private System.Windows.Forms.TextBox txtBoxNative;
    private System.Windows.Forms.DateTimePicker dateTimePickerBirth;
    private System.Windows.Forms.Panel panel2;
    private System.Windows.Forms.RadioButton rdoBtnFemale;
    private System.Windows.Forms.RadioButton rdoBtnMale;
    private System.Windows.Forms.TextBox txtBoxIDCardNum;
    private System.Windows.Forms.TextBox txtBoxName;
    private System.Windows.Forms.Label label6;
    private System.Windows.Forms.Label label5;
    private System.Windows.Forms.Label label4;
    private System.Windows.Forms.Label label3;
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.Panel panel1;
    private System.Windows.Forms.PictureBox pictureBox1;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.TabPage tabPage2;
    private System.Windows.Forms.TextBox txtBoxStuID;
    private System.Windows.Forms.Label label14;
    private System.Windows.Forms.ComboBox cmbBoxStuType;
    private System.Windows.Forms.Label label13;
    private System.Windows.Forms.ComboBox cmbBoxEnterYear;
    private System.Windows.Forms.ComboBox cmbBoxClass;
    private System.Windows.Forms.Label label12;
    private System.Windows.Forms.Label label11;
    private System.Windows.Forms.ComboBox cmbBoxSpeciality;
    private System.Windows.Forms.Label label10;
    private System.Windows.Forms.Label label9;
    private System.Windows.Forms.ComboBox cmbBoxCollege;
    private System.Windows.Forms.Label label7;
    private System.Windows.Forms.PictureBox pictureBox2;
    private System.Windows.Forms.Panel panel3;
    private System.Windows.Forms.TabPage tabPage3;
    private System.Windows.Forms.TextBox txtBoxEmail;
    private System.Windows.Forms.Label label20;
    private System.Windows.Forms.TextBox txtBoxMobile;
    private System.Windows.Forms.Label label19;
    private System.Windows.Forms.TextBox txtBoxFlatTel;
    private System.Windows.Forms.Label label18;
    private System.Windows.Forms.TextBox txtBoxHomeTel;
    private System.Windows.Forms.Label label17;
    private System.Windows.Forms.Label label16;
    private System.Windows.Forms.TextBox txtBoxHomeAdd;
    private System.Windows.Forms.PictureBox pictureBox3;
    private System.Windows.Forms.Label label8;
    private System.Windows.Forms.Panel panel4;

    private StudentEntity entity = new StudentEntity();
    private StudentManager manager = new StudentManager();
    private System.Windows.Forms.Button btnCancel;
    private System.Windows.Forms.Button btnOK;
    private System.Windows.Forms.TabPage tabPage4;
    private System.Windows.Forms.TabPage tabPage5;
    private System.Windows.Forms.TabPage tabPage6;
    private System.Windows.Forms.Label label15;
    private System.Windows.Forms.PictureBox pictureBox4;
    private System.Windows.Forms.Label label21;
    private System.Windows.Forms.PictureBox pictureBox5;
    private System.Windows.Forms.Label label22;
    private System.Windows.Forms.PictureBox pictureBox6;
    private System.Windows.Forms.Panel panel5;
    private System.Windows.Forms.Panel panel6;
    private System.Windows.Forms.Panel panel7;
    private System.Windows.Forms.DataGrid gridChanges;
    private System.Windows.Forms.DataGrid gridAwards;
    private System.Windows.Forms.DataGrid gridPunishments;
    private System.Windows.Forms.Label label23;
    private System.Windows.Forms.DataGridTableStyle dgTableStyleChanges;
    private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn1;
    private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn2;
    private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn3;

    private string studentID = "";
    private StudentsMIS.WinForm.StuAddedInfo dsStuAddedInfo;
    private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn4;
    private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn5;
    private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn6;
    private System.Windows.Forms.DataGridTableStyle dgTableStyleAwards;
    private System.Windows.Forms.DataGridTableStyle gridTableStylePunishments;
    private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn7;
    private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn8;
    private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn9;
    private System.Windows.Forms.Button btnDeleteChange;
    private System.Windows.Forms.Button btnAddChange;
    private ChangeEntity changeEntity = new ChangeEntity();
    private ChangeManager changeManager = new ChangeManager();
    private AwardEntity awardEntity = new AwardEntity();
    private AwardManager awardManager = new AwardManager();
    private PunishmentEntity punishmentEntity = new PunishmentEntity();
    private PunishmentManager punishmentManager = new PunishmentManager();
    private System.Windows.Forms.ComboBox cmbChangeType;
    private System.Windows.Forms.TextBox txtChangeReason;
    private System.Windows.Forms.DateTimePicker dateTimeChange;
    private System.Windows.Forms.Label label24;
    private System.Windows.Forms.Label label25;
    private System.Windows.Forms.Label label26;
    private System.Windows.Forms.Button btnDeleteAward;
    private System.Windows.Forms.Button btnAddAward;
    private System.Windows.Forms.TextBox txtAwardReason;
    private System.Windows.Forms.DateTimePicker dateTimeAward;
    private System.Windows.Forms.TextBox txtAwardContent;
    private System.Windows.Forms.Label label27;
    private System.Windows.Forms.Label label28;
    private System.Windows.Forms.ComboBox cmbPunishmentType;
    private System.Windows.Forms.Button btnAddPunishment;
    private System.Windows.Forms.TextBox txtPunishmentReason;
    private System.Windows.Forms.DateTimePicker dateTimePunishment;
    private System.Windows.Forms.Button btnDeletePunishment;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public FormEdit(string id)
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			this.studentID = id;
      entity = (StudentEntity)manager.Select(id);
      txtBoxName.Text = entity.StudentName;
      rdoBtnFemale.Checked = entity.StudentSex=="女" ? true:false;
      txtBoxIDCardNum.Text = entity.StudentIDCardNum;
      dateTimePickerBirth.Value = entity.StudentBirthday;
      txtBoxNative.Text = entity.StudentNative;
      cmbBoxCollege.Text = entity.StudentCollegeID + "-" + entity.StudentCollegeName;
      cmbBoxSpeciality.Text = entity.StudentSpecialityID + "-" + entity.StudentSpecialityName;
      cmbBoxClass.Text = entity.StudentClass;
      txtBoxStuID.Text = entity.StudentID;
      cmbBoxEnterYear.Text = entity.StudentEnterYear + "年";
      cmbBoxStuType.Text = entity.StudentStuType + "年";
      txtBoxHomeAdd.Text = entity.StudentHomeAdd;
      txtBoxHomeTel.Text = entity.StudentHomeTel;
      txtBoxFlatTel.Text = entity.StudentFlatTel;
      txtBoxMobile.Text = entity.StudentMobile;
      txtBoxEmail.Text = entity.StudentEmail;

      Bind_dsChangeTypes();
      Bind_dsPunishmentTypes();
      Bind_gridChanges();
      Bind_gridAwards();
      Bind_gridPunishments();
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
      System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FormEdit));
      this.btnCancel = new System.Windows.Forms.Button();
      this.btnOK = new System.Windows.Forms.Button();
      this.tabControl1 = new System.Windows.Forms.TabControl();
      this.tabPage1 = new System.Windows.Forms.TabPage();
      this.txtBoxNative = new System.Windows.Forms.TextBox();
      this.dateTimePickerBirth = new System.Windows.Forms.DateTimePicker();
      this.panel2 = new System.Windows.Forms.Panel();
      this.rdoBtnFemale = new System.Windows.Forms.RadioButton();
      this.rdoBtnMale = new System.Windows.Forms.RadioButton();
      this.txtBoxIDCardNum = new System.Windows.Forms.TextBox();
      this.txtBoxName = new System.Windows.Forms.TextBox();
      this.label6 = new System.Windows.Forms.Label();
      this.label5 = new System.Windows.Forms.Label();
      this.label4 = new System.Windows.Forms.Label();
      this.label3 = new System.Windows.Forms.Label();
      this.label1 = new System.Windows.Forms.Label();
      this.panel1 = new System.Windows.Forms.Panel();
      this.pictureBox1 = new System.Windows.Forms.PictureBox();
      this.label2 = new System.Windows.Forms.Label();
      this.tabPage3 = new System.Windows.Forms.TabPage();
      this.txtBoxEmail = new System.Windows.Forms.TextBox();
      this.label20 = new System.Windows.Forms.Label();
      this.txtBoxMobile = new System.Windows.Forms.TextBox();
      this.label19 = new System.Windows.Forms.Label();
      this.txtBoxFlatTel = new System.Windows.Forms.TextBox();
      this.label18 = new System.Windows.Forms.Label();
      this.txtBoxHomeTel = new System.Windows.Forms.TextBox();
      this.label17 = new System.Windows.Forms.Label();
      this.label16 = new System.Windows.Forms.Label();
      this.txtBoxHomeAdd = new System.Windows.Forms.TextBox();
      this.pictureBox3 = new System.Windows.Forms.PictureBox();
      this.label8 = new System.Windows.Forms.Label();
      this.panel4 = new System.Windows.Forms.Panel();
      this.tabPage2 = new System.Windows.Forms.TabPage();
      this.txtBoxStuID = new System.Windows.Forms.TextBox();
      this.label14 = new System.Windows.Forms.Label();
      this.cmbBoxStuType = new System.Windows.Forms.ComboBox();
      this.label13 = new System.Windows.Forms.Label();
      this.cmbBoxEnterYear = new System.Windows.Forms.ComboBox();
      this.cmbBoxClass = new System.Windows.Forms.ComboBox();
      this.label12 = new System.Windows.Forms.Label();
      this.label11 = new System.Windows.Forms.Label();
      this.cmbBoxSpeciality = new System.Windows.Forms.ComboBox();
      this.label10 = new System.Windows.Forms.Label();
      this.label9 = new System.Windows.Forms.Label();
      this.cmbBoxCollege = new System.Windows.Forms.ComboBox();
      this.label7 = new System.Windows.Forms.Label();
      this.pictureBox2 = new System.Windows.Forms.PictureBox();
      this.panel3 = new System.Windows.Forms.Panel();
      this.tabPage4 = new System.Windows.Forms.TabPage();
      this.btnDeleteChange = new System.Windows.Forms.Button();
      this.btnAddChange = new System.Windows.Forms.Button();
      this.txtChangeReason = new System.Windows.Forms.TextBox();
      this.label23 = new System.Windows.Forms.Label();
      this.dateTimeChange = new System.Windows.Forms.DateTimePicker();
      this.cmbChangeType = new System.Windows.Forms.ComboBox();
      this.dsStuAddedInfo = new StudentsMIS.WinForm.StuAddedInfo();
      this.gridChanges = new System.Windows.Forms.DataGrid();
      this.dgTableStyleChanges = new System.Windows.Forms.DataGridTableStyle();
      this.dataGridTextBoxColumn1 = new System.Windows.Forms.DataGridTextBoxColumn();
      this.dataGridTextBoxColumn2 = new System.Windows.Forms.DataGridTextBoxColumn();
      this.dataGridTextBoxColumn3 = new System.Windows.Forms.DataGridTextBoxColumn();
      this.panel5 = new System.Windows.Forms.Panel();
      this.label15 = new System.Windows.Forms.Label();
      this.pictureBox4 = new System.Windows.Forms.PictureBox();
      this.tabPage5 = new System.Windows.Forms.TabPage();
      this.label25 = new System.Windows.Forms.Label();
      this.btnDeleteAward = new System.Windows.Forms.Button();
      this.btnAddAward = new System.Windows.Forms.Button();
      this.txtAwardReason = new System.Windows.Forms.TextBox();
      this.label24 = new System.Windows.Forms.Label();
      this.dateTimeAward = new System.Windows.Forms.DateTimePicker();
      this.gridAwards = new System.Windows.Forms.DataGrid();
      this.dgTableStyleAwards = new System.Windows.Forms.DataGridTableStyle();
      this.dataGridTextBoxColumn4 = new System.Windows.Forms.DataGridTextBoxColumn();
      this.dataGridTextBoxColumn5 = new System.Windows.Forms.DataGridTextBoxColumn();
      this.dataGridTextBoxColumn6 = new System.Windows.Forms.DataGridTextBoxColumn();
      this.panel6 = new System.Windows.Forms.Panel();
      this.label21 = new System.Windows.Forms.Label();
      this.pictureBox5 = new System.Windows.Forms.PictureBox();
      this.tabPage6 = new System.Windows.Forms.TabPage();
      this.gridPunishments = new System.Windows.Forms.DataGrid();
      this.gridTableStylePunishments = new System.Windows.Forms.DataGridTableStyle();
      this.dataGridTextBoxColumn7 = new System.Windows.Forms.DataGridTextBoxColumn();
      this.dataGridTextBoxColumn8 = new System.Windows.Forms.DataGridTextBoxColumn();
      this.dataGridTextBoxColumn9 = new System.Windows.Forms.DataGridTextBoxColumn();
      this.panel7 = new System.Windows.Forms.Panel();
      this.label22 = new System.Windows.Forms.Label();
      this.pictureBox6 = new System.Windows.Forms.PictureBox();
      this.txtAwardContent = new System.Windows.Forms.TextBox();
      this.label26 = new System.Windows.Forms.Label();
      this.label27 = new System.Windows.Forms.Label();
      this.btnDeletePunishment = new System.Windows.Forms.Button();
      this.btnAddPunishment = new System.Windows.Forms.Button();
      this.txtPunishmentReason = new System.Windows.Forms.TextBox();
      this.label28 = new System.Windows.Forms.Label();
      this.dateTimePunishment = new System.Windows.Forms.DateTimePicker();
      this.cmbPunishmentType = new System.Windows.Forms.ComboBox();
      this.tabControl1.SuspendLayout();
      this.tabPage1.SuspendLayout();
      this.panel2.SuspendLayout();

⌨️ 快捷键说明

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