using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

using Model;

namespace LoginFrame
{
    public partial class FrmAddCollegeInfo : Form
    {
        public FrmAddCollegeInfo()
        {
            InitializeComponent();
        }

        private CollegeInfo collegeInfo = new CollegeInfo();
        private void Btn_Add_Click(object sender, EventArgs e)
        {
            if (this.txt_collegeNumber.Text == "")
            {
                MessageBox.Show("学院编号输入不能为空!");
                this.txt_collegeNumber.Focus();
                return;
            }
            collegeInfo.collegeNumber = this.txt_collegeNumber.Text;  //学院编号
            if (this.txt_collegeName.Text == "")
            {
                MessageBox.Show("学院名称输入不能为空!");
                this.txt_collegeName.Focus();
                return;
            }
            collegeInfo.collegeName = this.txt_collegeName.Text; //学院名称
            collegeInfo.collegeBirthDate = this.dtp_collegeBirthDate.Value;
            collegeInfo.collegeMan = this.txt_collegeMan.Text;  //院长姓名
            collegeInfo.collegeTelephone = this.txt_collegeTelephone.Text;  //联系电话
            collegeInfo.collegeMemo = this.txt_collegeMemo.Text;  //附加信息
            if (BLL.bllCollegeInfo.AddCollegeInfo(collegeInfo))
                MessageBox.Show("学院信息添加成功!");
            else
                MessageBox.Show("学院信息添加失败!");
            this.Close(); 
        }

        private void FrmAddCollegeInfo_Load(object sender, EventArgs e)
        {
        }
    }
}
