コード例 #1
0
        public FrmEditStudent(Student student, DataGridViewRow currentRow)
        {
            InitializeComponent();
            _student        = student;
            this.currentRow = currentRow;

            this.cboClassName.DataSource    = _studentClassService.GetAllClass();
            this.cboClassName.DisplayMember = "ClassName";
            this.cboClassName.ValueMember   = "ClassId";
            this.cboClassName.SelectedIndex = -1;

            cboClassName.Text   = _student.ClassName;
            txtStudentId.Text   = _student.StudentId.ToString();
            txtStudentIdNo.Text = _student.StudentIdNo;
            txtStudentName.Text = _student.StudentName;
            txtPhoneNumber.Text = _student.PhoneNumber;
            txtAddress.Text     = _student.StudentAddress;
            rdoFemale.Checked   = _student.Gender == "女";
            rdoMale.Checked     = _student.Gender == "男";
            dtpBirthday.Text    = _student.Birthday.ToShortDateString();
            this.pbStu.Image    = student.StuImage.Length != 0 ?
                                  (Image) new Common.SerializeObjectToString().
                                  DeserializeObject(student.StuImage)
              : Image.FromFile("default.png");
        }
コード例 #2
0
        public FrmEditStudent(StudentExt objStudent)
        {
            InitializeComponent();
            //初始化班级下拉框
            this.cboClassName.DataSource    = objClassService.GetAllClass();
            this.cboClassName.DisplayMember = "ClassName";
            this.cboClassName.ValueMember   = "ClassId";

            this.txtStudentId.Text   = objStudent.StudentId.ToString();
            this.txtStudentIdNo.Text = objStudent.StudentIdNo.ToString();
            this.txtStudentName.Text = objStudent.StudentName;
            this.txtPhoneNumber.Text = objStudent.PhoneNumber;
            this.txtAddress.Text     = objStudent.StudentAddress;
            this.dtpBirthday.Text    = objStudent.Birthday.ToShortDateString();
            this.txtCardNo.Text      = objStudent.CardNo;
            if (objStudent.Gender == "男")
            {
                this.rdoMale.Checked = true;
            }
            else
            {
                this.rdoFemale.Checked = true;
            }
            this.cboClassName.Text = objStudent.ClassName;
            this.pbStu.Image       = objStudent.StuImage.Length == 0 ? Image.FromFile("default.png") :
                                     (Image) new SerializeObjectToString().DeserializeObject(objStudent.StuImage);
        }
コード例 #3
0
 public FrmEditStudent()
 {
     InitializeComponent();
     //初始化班级下拉框
     this.cboClassName.DataSource    = studentClassService.GetAllClass();
     this.cboClassName.DisplayMember = "ClassName";
     this.cboClassName.ValueMember   = "ClassId";
 }
コード例 #4
0
 public FrmStudentManage()
 {
     InitializeComponent();
     this.cboClass.DataSource                = _studentClassService.GetAllClass();
     this.cboClass.DisplayMember             = "ClassName";
     this.cboClass.ValueMember               = "ClassId";
     this.cboClass.SelectedIndex             = -1;
     this.dgvStudentList.AutoGenerateColumns = false;
 }
コード例 #5
0
 public FrmStudentManage()
 {
     InitializeComponent();
     //动态添加班级下拉框
     this.cboClass.DataSource    = objClassService.GetAllClass();
     this.cboClass.DisplayMember = "ClassName";
     this.cboClass.ValueMember   = "ClassId";
     this.cboClass.SelectedIndex = -1;
 }
コード例 #6
0
 public FrmStudentManage()
 {
     InitializeComponent();
     //初始化班级下拉框
     this.cboClass.DataSource                = objClassService.GetAllClass();
     this.cboClass.DisplayMember             = "ClassName"; //设置下拉框显示文本
     this.cboClass.ValueMember               = "ClassId";   //设置下拉框显示文本对应的value
     this.cboClass.SelectedIndex             = -1;          //默认不选中任何班级
     this.dgvStudentList.AutoGenerateColumns = false;       //禁止自动生成列
 }
コード例 #7
0
        public FrmEditStudent()
        {
            InitializeComponent();
            List <StudentClass> classList = objClassService.GetAllClass();

            this.cboClassName.DataSource    = classList;
            this.cboClassName.DisplayMember = "ClassName";
            this.cboClassName.ValueMember   = "ClassId";
            this.cboClassName.SelectedIndex = -1;
        }
コード例 #8
0
        public FrmStudentManage()
        {
            InitializeComponent();
            List <StudentClass> classList = new List <StudentClass>();

            classList = objClassService.GetAllClass();
            this.cboClass.DataSource    = classList;
            this.cboClass.DisplayMember = "ClassName";
            this.cboClass.SelectedIndex = -1;
        }
コード例 #9
0
        public FrmAddStudent()
        {
            InitializeComponent();
            this.cboClassName.DataSource    = _studentClassService.GetAllClass();
            this.cboClassName.DisplayMember = "ClassName";
            this.cboClassName.ValueMember   = "ClassId";
            if (this.cboClassName.Items.Count == 0)
            {
                this.cboClassName.SelectedIndex = -1;
            }

            this.dgvStudentList.AutoGenerateColumns = false;
        }
コード例 #10
0
ファイル: FrmStudentManage.cs プロジェクト: gongjunqiang/SMDB
 public FrmStudentManage()
 {
     InitializeComponent();
     //初始化班级下拉框
     this.cboClass.DataSource                = studentClassService.GetAllClass();
     this.cboClass.DisplayMember             = "ClassName";
     this.cboClass.ValueMember               = "ClassId";
     this.cboClass.SelectedIndex             = -1;
     this.dgvStudentList.AutoGenerateColumns = false;
     //禁用排序按钮
     this.btnNameDESC.Enabled  = false;
     this.btnStuIdDESC.Enabled = false;
 }
コード例 #11
0
ファイル: FrmScoreQuery.cs プロジェクト: EvanChen2020/Lessons
        public FrmScoreQuery()
        {
            InitializeComponent();
            //显示班级下拉框
            DataTable dt = objStudentClassService.GetAllClass().Tables[0];

            this.cboClass.DataSource    = dt;
            this.cboClass.ValueMember   = "ClassId";
            this.cboClass.DisplayMember = "ClassName";

            //显示全部考试成绩
            dtScoreList = objScoreService.GetAllScoreList().Tables[0];
            this.dgvScoreList.DataSource = dtScoreList;
        }
コード例 #12
0
        public FrmScoreQuery()
        {
            InitializeComponent();

            //初始化:显示班级下拉框
            //DataTable dt = studentClassService.GetAllClass().Tables["classInfo"];
            DataTable dt = studentClassService.GetAllClass().Tables[0];

            this.cbbClass.DataSource    = dt;
            this.cbbClass.DisplayMember = "ClassName";
            this.cbbClass.ValueMember   = "ClassId";

            dtScore = scoreListService.GetScore().Tables[0];
            this.dgvScoreList.AutoGenerateColumns = false;
            this.dgvScoreList.DataSource          = null;
            this.dgvScoreList.DataSource          = dtScore;
        }