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

            //按数据库里边存储的学校类型绑定下拉列表

            string str_Sql, errorstring;

            errorstring = conn.BindComboBox("Select * from School_Type", comboBox1_School_Type, "School_Type_ID", "School_Type_Name");
            if (errorstring != "OK")
            {
                MessageBox.Show("请检查数据库!" + errorstring, "提醒!",
                                MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                button1.Enabled = false;
                return;
            }

            //按学校类型代码内联显示学校类型的名称,绑定DataGrid显示
            str_Sql = "SELECT Class_Type.Class_Type_ID AS 班级类别代码,Class_Type.Class_Type_Name AS 班级类别名,School_Type.School_Type_Name AS 学校类别名 FROM Class_Type inner join School_Type on Class_Type.School_Type_ID_Class_Belong=School_Type.School_Type_ID";
            if (conn.GetRowCount(str_Sql) == 0)
            {
                MessageBox.Show("请检查数据库!", "警告!",
                                MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                this.Dispose();
            }
            conn.Fill(str_Sql);
            DataGrid1.SetDataBinding(conn.ds, "TableIn");
            textBox_Class_Type_ID.Text = conn.GetMaxId("Class_Type_ID", "Class_Type");
            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
        }
Ejemplo n.º 2
0
        public AddQuXian()
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();

            //绑定DataGrid显示
            string str_Sql, errorstring;

            str_Sql     = "SELECT QuXian.QuXian_ID AS 区县代码,QuXian.QuXian_Name AS 区县名称 FROM QuXian";
            errorstring = conn.Fill(str_Sql);
            if (errorstring != "OK")
            {
                MessageBox.Show("请检查数据库!" + errorstring, "提醒!",
                                MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                button1.Enabled = false;
                return;
            }

            DataGrid1.SetDataBinding(conn.ds, "TableIn");

            textBox_QuXian_ID.Text = conn.GetMaxId("QuXian_ID", "QuXian");
            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
        }
Ejemplo n.º 3
0
        public Add_Office()
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();

            //按数据库里边存储的区县绑定下拉列表
            string str_Sql, errorstring;

            errorstring = conn.BindComboBox("Select * from QuXian WHERE QuXian_ID<>9", comboBox1_QuXian_ID, "QuXian_ID", "QuXian_Name");
            if (errorstring != "OK")
            {
                MessageBox.Show("请检查数据库!" + errorstring, "提醒!",
                                MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                button1.Enabled = false;
                return;
            }

            //按区县代码内联显示区县名称,绑定DataGrid显示
            str_Sql = "SELECT Office.Office_ID AS 办事处代码,Office.Office_Name AS 办事处名称,QuXian.QuXian_Name AS 区县名称 FROM QuXian inner join Office on QuXian.QuXian_ID=Office.QuXian_ID_OfficeIn";

            conn.Fill(str_Sql);
            DataGrid1.SetDataBinding(conn.ds, "TableIn");

            textBox_Office_ID.Text = conn.GetMaxId("Office_ID", "Office");
            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
        }
        public AddSchool_Type()
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();

            string str_Sql, errorstring;

            str_Sql     = "SELECT School_Type_ID As 学校类别代码,School_Type_Name As 学校类别名,School_Type_Year As 学校类别学制 FROM School_Type";
            errorstring = conn.Fill(str_Sql);
            if (errorstring != "OK")
            {
                MessageBox.Show("请检查数据库!" + errorstring, "提醒!",
                                MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                button1.Enabled = false;
                return;
            }
            DataGrid1.SetDataBinding(conn.ds, "TableIn");

            textBox_School_Type_ID.Text = conn.GetMaxId("School_Type_ID", "School_Type");

            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
        }
        public maintenanceCommittee()
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();
            //绑定下拉列表显示现有的所有区县
            string str_Sql, errorstring;

            errorstring = conn.BindComboBox("Select * from QuXian WHERE QuXian_ID<>9", comboBox_QuXian, "QuXian_ID", "QuXian_Name");
            if (errorstring != "OK")
            {
                MessageBox.Show("请检查数据库!" + errorstring, "提醒!",
                                MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                button1.Enabled = false;
                return;
            }
            //绑定DataGrid显示,未选中任何有效的项button1.Enabled=false;
            str_Sql = "SELECT Committee_ID AS 居委会代码,Committee_Name AS 居委会名称,Office_Name AS 办事处名称,QuXian_Name AS 区县名称 FROM View_Committee";

            conn.Fill(str_Sql);
            DataGrid1.SetDataBinding(conn.ds, "TableIn");

            textBox_Committee_ID.Text = conn.GetMaxId("Committee_ID", "Committee");

            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
        }
Ejemplo n.º 6
0
        public Add_Committee()
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();

            //按数据库里边存储的区县绑定下拉列表
            string str_Sql, errorstring;

            errorstring = conn.BindComboBox("Select * from QuXian WHERE QuXian_ID<>9", comboBox_QuXian, "QuXian_ID", "QuXian_Name");
            if (errorstring != "OK")
            {
                MessageBox.Show("请检查数据库!" + errorstring, "提醒!",
                                MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                button1.Enabled = false;
                return;
            }

            //按数据库里边存储的办事处绑定下拉列表
            errorstring = conn.BindComboBox("Select * from Office Where QuXian_ID_OfficeIn=" + comboBox_QuXian.SelectedValue.ToString(), comboBox_Office, "Office_ID", "Office_Name");
            if (errorstring != "OK")
            {
                MessageBox.Show("请检查数据库!" + errorstring, "提醒!",
                                MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                button1.Enabled = false;
                return;
            }
            //按区县办事处内联显示名称,绑定DataGrid显示
            str_Sql = "SELECT Committee_ID AS 居委会代码,Committee_Name AS 居委会名称,Office_Name AS 办事处名称,QuXian_Name AS 区县名称 FROM View_Committee";

            conn.Fill(str_Sql);
            DataGrid1.SetDataBinding(conn.ds, "TableIn");

            textBox_Committee_ID.Text = conn.GetMaxId("Committee_ID", "Committee");
            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
        }