xk/frmSelectCourse.cs

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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.Data.SqlClient;
using System.Drawing.Drawing2D;

namespace xk
{
    public partial class frmSelectCourse : Form
    {
        private static frmSelectCourse _Instance = null;
        public static frmSelectCourse Instance()
        {
            if (_Instance == null)
            {
                _Instance = new frmSelectCourse();
            }
            return _Instance;
        }
        private frmSelectCourse()
        {
            InitializeComponent();
        }
        
        DataSet ds = new DataSet();
        private int indexofitemundermousetodrag = -1;
        private int indexofitemundermousetodrop = -1;
        private int indexofitemundermousetover = -1;
        private Rectangle dragboxfrommousedown = Rectangle.Empty;
        private void femSelectCourse_Load(object sender, EventArgs e)
        {
            dgvCourse.AutoGenerateColumns = false;
            dgvSelectCourse.AutoGenerateColumns = false;
            getStuCou();
            getCourse();


        }
        private void getStuCou()
        {
            SqlConnection cn = new SqlConnection(Properties.Settings.Default.XKDBConnectionString);
            string sql = "select Stucou.*,couname from Stucou,Course where Stucou.Couno = Course.Couno and Stuno=@stuno  order by Willorder";
            SqlDataAdapter da = new SqlDataAdapter(sql, cn);
            da.SelectCommand.Parameters.Add("@stuno", SqlDbType.NVarChar, 8).Value = CPublic.LoginInfo["Stuno"].ToString();
            cn.Open();
            da.Fill(ds, "Stucou");
            cn.Close();
            dgvSelectCourse.DataSource = ds.Tables["Stucou"];
        }
        private void getCourse()
        {
            SqlConnection cn = new SqlConnection(Properties.Settings.Default.XKDBConnectionString);
            string sql = "select *from Course order by couno";
            SqlDataAdapter da = new SqlDataAdapter(sql, cn);
            cn.Open();
后面还有 175 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。