Exemplo n.º 1
0
 public FrmEditStudent(Student objStudent) : this()
 {
     //初始化班级下拉框
     this.cboClassName.DataSource    = objClassService.GetAllClasses();
     this.cboClassName.DisplayMember = "ClassName"; //设置下拉框的显示文本
     this.cboClassName.ValueMember   = "ClassId";   //设置下拉框显示文本对应的value
     //显示学生信息
     this.txtStudentId.Text   = objStudent.StudentId.ToString();
     this.txtStudentIdNo.Text = objStudent.StudentIdNo;
     this.txtStudentName.Text = objStudent.StudentName;
     this.txtPhoneNumber.Text = objStudent.PhoneNumber;
     this.txtAddress.Text     = objStudent.StudentAddress;
     if (objStudent.Gender == "男")
     {
         this.rdoMale.Checked = true;
     }
     else
     {
         this.rdoFemale.Checked = true;
     }
     this.cboClassName.Text = objStudent.ClassName;
     this.dtpBirthday.Text  = objStudent.Birthday.ToShortDateString();
     this.txtCardNo.Text    = objStudent.CardNo;
     //显示照片
     this.pbStu.Image = Image.FromFile("1.jpg");;
 }
Exemplo n.º 2
0
        public FrmEditStudent(StudentExt objStudentExt)
        {
            InitializeComponent();
            this.cboClassName.DataSource    = objStudentClassService.GetAllClasses();
            this.cboClassName.DisplayMember = "ClassName";
            this.cboClassName.ValueMember   = "ClassId";



            this.txtFName.Text        = objStudentExt.FirstName;
            this.txtLName.Text        = objStudentExt.LastName;
            this.txtStudentNo.Text    = objStudentExt.StudentIdNo.ToString();
            this.txtStudentNo.Enabled = false;
            this.txtPhoneNumber.Text  = objStudentExt.PhoneNumber;
            this.txtAddress.Text      = objStudentExt.Address;
            this.dateTimePicker1.Text = objStudentExt.Birthday.ToShortDateString();
            if (objStudentExt.Gender == "Male")
            {
                rdoMale.Checked = true;
            }

            else
            {
                rdoFemale.Checked = true;
            }
            this.cboClassName.Text = objStudentExt.ClassName;
            this.pbStu.Image       = objStudentExt.StuImage.Length == 0 ? Image.FromFile("default.jpg") :
                                     (Image) new SerializeObjectToString().DeserializeObject(objStudentExt.StuImage);
        }
Exemplo n.º 3
0
 public FrmEditStudent(StudentExt objStudent)
 {
     InitializeComponent();
     //初始化班级下拉框
     this.cboClassName.DataSource    = objClassService.GetAllClasses();
     this.cboClassName.DisplayMember = "ClassName"; //设置下拉框的显示文本
     this.cboClassName.ValueMember   = "ClassId";   //设置下拉框显示文本对应的value
     //显示学生信息
     this.txtStudentId.Text   = objStudent.StudentId.ToString();
     this.txtStudentIdNo.Text = objStudent.StudentIdNo;
     this.txtStudentName.Text = objStudent.StudentName;
     this.txtPhoneNumber.Text = objStudent.PhoneNumber;
     this.txtAddress.Text     = objStudent.StudentAddress;
     if (objStudent.Gender == "男")
     {
         this.rdoMale.Checked = true;
     }
     else
     {
         this.rdoFemale.Checked = true;
     }
     this.cboClassName.Text = objStudent.ClassName;
     this.dtpBirthday.Text  = objStudent.Birthday.ToShortDateString();
     this.txtCardNo.Text    = objStudent.CardNo;
     //显示照片
     this.pbStu.Image = objStudent.StuImage.Length != 0 ?
                        (Image) new SerializeObjectToString().DeserializeObject(objStudent.StuImage) : Image.FromFile("default.png");;
 }
Exemplo n.º 4
0
 public FrmStudentManage()
 {
     InitializeComponent();
     //初始化班级下拉框
     this.cboClass.DataSource    = objClassService.GetAllClasses();
     this.cboClass.DisplayMember = "ClassName";
     this.cboClass.ValueMember   = "ClassId";
 }
Exemplo n.º 5
0
 public FrmStudentManage()
 {
     InitializeComponent();
     this.cboClass.DataSource    = objStudentClassService.GetAllClasses();
     this.cboClass.DisplayMember = "ClassName";
     this.cboClass.ValueMember   = "ClassId";
     this.cboClass.SelectedIndex = -1;
 }
Exemplo n.º 6
0
 public FrmAddStudent()
 {
     InitializeComponent();
     //初始化班级下拉框
     this.cboClassName.DataSource    = objClassService.GetAllClasses();
     this.cboClassName.DisplayMember = "ClassName";
     this.cboClassName.ValueMember   = "ClassId";
     this.cboClassName.SelectedIndex = -1;//默认不选中
 }
Exemplo n.º 7
0
 public FrmAddStudent()
 {
     InitializeComponent();
     //初始化班级下拉框
     this.cboClassName.DataSource            = objClassService.GetAllClasses();
     this.cboClassName.DisplayMember         = "ClassName"; //设置下拉框的显示文本
     this.cboClassName.ValueMember           = "ClassId";   //设置下拉框显示文本对应的value
     this.dgvStudentList.AutoGenerateColumns = false;       //静止自动生成列
 }
Exemplo n.º 8
0
 public FrmAddNewStudent()
 {
     InitializeComponent();
     //cboBOX
     this.cboClassName.DataSource    = objStudentClassService.GetAllClasses();
     this.cboClassName.DisplayMember = "ClassName";
     this.cboClassName.ValueMember   = "ClassId";
     this.cboClassName.SelectedIndex = -1;
 }
Exemplo n.º 9
0
 public FrmEditStudent()
 {
     InitializeComponent();
     //初始化班级下拉框
     this.cboClassName.DataSource    = objClassService.GetAllClasses();
     this.cboClassName.DisplayMember = "ClassName";
     this.cboClassName.ValueMember   = "ClassId";
     this.cboClassName.SelectedIndex = -1; // default we didn't select a class
 }
Exemplo n.º 10
0
        private DataSet ds = null;//用来保存查询结果的数据集
        public FrmScoreQuery()
        {
            InitializeComponent();
            //基于datatable绑定班级下拉框
            DataTable dt = objClassService.GetAllClasses().Tables[0];

            this.cboClass.DataSource    = dt;
            this.cboClass.ValueMember   = "ClassId";
            this.cboClass.DisplayMember = "ClassName";
            //显示全部考试成绩
            this.ds = objScoreservice.GetAllScoreList();//将所有成绩保存在成员变量中
            this.dgvScoreList.DataSource = ds.Tables[0];
        }
Exemplo n.º 11
0
        public FrmScoreManage()
        {
            InitializeComponent();
            //显示班级
            this.cboClass.SelectedIndexChanged -= new EventHandler(cboClass_SelectedIndexChanged);

            this.cboClass.DataSource    = objClassService.GetAllClasses();
            this.cboClass.DisplayMember = "ClassName";
            this.cboClass.ValueMember   = "ClassId";
            this.cboClass.SelectedIndex = -1;

            this.cboClass.SelectedIndexChanged += new EventHandler(cboClass_SelectedIndexChanged);
        }
Exemplo n.º 12
0
        public FrmScoreManage()
        {
            InitializeComponent();
            this.cboClass.SelectedIndexChanged -= new EventHandler(this.cboClass_SelectedIndexChanged);
            //初始化班级下拉框
            this.cboClass.DataSource    = objClassService.GetAllClasses();
            this.cboClass.DisplayMember = "ClassName";
            this.cboClass.ValueMember   = "ClassId";
            this.cboClass.SelectedIndex = -1; // default we didn't select a class

            this.cboClass.SelectedIndexChanged +=
                new EventHandler(this.cboClass_SelectedIndexChanged);
        }
Exemplo n.º 13
0
        public FrmScoreManage()
        {
            InitializeComponent();
            //班级下拉列表绑定
            this.cboClass.DataSource    = studentClassService.GetAllClasses().Tables[0];
            this.cboClass.DisplayMember = "ClassName";
            this.cboClass.ValueMember   = "ClassId";
            this.cboClass.SelectedIndex = -1;

            //将下拉框的事件关联
            this.cboClass.SelectedIndexChanged   += new System.EventHandler(this.CboClass_SelectedIndexChanged);
            this.dgvScoreList.AutoGenerateColumns = false;
            DataGridViewStyle.DgvStyle1(this.dgvScoreList);
        }
Exemplo n.º 14
0
        private DataSet da = null;//用来保存查询结果的数据集

        public FrmScoreQuery()
        {
            InitializeComponent();
            //基于DataTable绑定下拉框
            this.cboClass.DataSource    = studentClassService.GetAllClasses().Tables[0];
            this.cboClass.DisplayMember = "ClassName";
            this.cboClass.ValueMember   = "ClassId";
            this.cboClass.SelectedIndex = -1;
            //成绩列表数据绑定
            da = scoreListService.GetScoreList();
            this.dgvScoreList.AutoGenerateColumns = false;
            this.dgvScoreList.DataSource          = null;
            this.dgvScoreList.DataSource          = da.Tables[0];
            DataGridViewStyle.DgvStyle3(dgvScoreList);
        }
Exemplo n.º 15
0
 private DataSet ds = null;//保存全部查询结果的数据集
 public FrmScoreQuery()
 {
     InitializeComponent();
     //初始班级列表
     this.cboClass.DataSource    = objClassService.GetAllClasses();
     this.cboClass.DisplayMember = "ClassName";
     this.cboClass.ValueMember   = "ClassId";
     this.cboClass.SelectedIndex = -1;
     //显示全部考试成绩
     ds = objScoreListService.GetAllScoreList();
     //禁用
     this.dgvScoreList.AutoGenerateColumns = false;
     this.dgvScoreList.DataSource          = ds.Tables[0];
     //new Common.DataGridViewStyle().DgvStyle3(this.dgvScoreList);
 }
Exemplo n.º 16
0
        public FrmScoreQuery()
        {
            InitializeComponent();

            //基于DataTable绑定班级下拉框
            DataTable dt = objClassService.GetAllClasses().Tables[0];

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

            //显示全部成绩
            this.ds = objScoreService.GetAllScoreList();
            this.dgvScoreList.DataSource = ds.Tables[0];
            new Common.DataGridViewStyle().DgvStyle3(this.dgvScoreList);
        }