Esempio n. 1
0
        private void WorkloadStatistics_Load(object sender, EventArgs e)
        {
            linkSql = new LinkSQL();
            string sql = "select teacher.tno as '工号',tname as '姓名',t_workload as '工作量(课时)' from t_workload_view, teacher where t_workload_view.tno = teacher.tno";

            this.dataGridView1.DataSource          = linkSql.QuerySQL(sql);
            this.dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
        }
Esempio n. 2
0
        private void QueryGrade_Load(object sender, EventArgs e)
        {
            linkSql = new LinkSQL();
            this.dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            string sql = string.Format("select sno as '学号',cno as '课程',grade as '成绩' from dbo.sc where sno = '{0}'", Program.loginId);

            this.dataGridView1.DataSource = linkSql.QuerySQL(sql);

            //学分统计
            string sql2 = string.Format("select SUM(credit) from class where cno in (select cno from sc where sno = '{0}' and grade >= 60)", Program.loginId);

            dt = linkSql.QuerySQL(sql2);
            int loginCredit = 0;

            try
            {
                loginCredit = Convert.ToInt32(dt.Rows[0][0].ToString());
            }
            catch
            {
            }
            label1.Text = string.Format("您已选修学分为{0}学分,最高可选修120学分", loginCredit);
        }
Esempio n. 3
0
 private void QueryStudent_Load(object sender, EventArgs e)
 {
     ChooseStudent();
     linkSql = new LinkSQL();
     this.dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
 }