Beispiel #1
0
 //初始化学生列表
 private void init_student()
 {
     BLL.STUDENT_INFO studentBll = new BLL.STUDENT_INFO();
     this.tl_student.DataSource                  = studentBll.GetStudentNodeList().Tables[0];
     this.tl_student.KeyFieldName                = "nodeid";
     this.tl_student.ParentFieldName             = "parentid";
     this.tl_student.Columns["nodename"].Caption = "学生列表";
 }
Beispiel #2
0
        /// <summary>
        /// 增加数据方法
        /// </summary>
        private void Add()
        {
            int termno, teacherno, workflowno;

            if (this.cbb_teacher.SelectedIndex == -1)
            {
                MessageBox.Show("请选择指导教师!", "提示信息");
                return;
            }

            BLL.STUDENT_INFO   studentBll  = new BLL.STUDENT_INFO();
            BLL.TERM_INFO      termBll     = new BLL.TERM_INFO();
            Model.TERM_INFO    termMdl     = new Model.TERM_INFO();
            BLL.WORKFLOW       workflowBll = new BLL.WORKFLOW();
            Model.WORKFLOW     workflowMdl = new Model.WORKFLOW();
            BLL.TEACHER_INFO   teacherBll  = new BLL.TEACHER_INFO();
            Model.TEACHER_INFO teacherMdl  = new Model.TEACHER_INFO();
            BLL.TEA_STU        teastuBll   = new BLL.TEA_STU();
            Model.TEA_STU      teastuMdl   = new Model.TEA_STU();

            termMdl = termBll.GetModel(this.cbb_term.Properties.Items[this.cbb_term.SelectedIndex].ToString());
            termno  = termMdl.TERMNO;

            workflowMdl = workflowBll.GetModel(this.cbb_workflow.Properties.Items[this.cbb_workflow.SelectedIndex].ToString());
            workflowno  = workflowMdl.WORKFLOWNO;

            teacherMdl = teacherBll.GetModel(this.cbb_teacher.Properties.Items[this.cbb_teacher.SelectedIndex].ToString());
            teacherno  = teacherMdl.TEACHERNO;

            teastuMdl.TEACHERNO  = teacherno;
            teastuMdl.TERMNO     = termno;
            teastuMdl.WORKFLOWNO = workflowno;

            //获取所选学生学号列表
            this.lstCheckedStudentNo.Clear();

            if (this.tl_student.Nodes.Count > 0)
            {
                foreach (TreeListNode root in tl_student.Nodes)
                {
                    GetCheckedStudentNo(root);
                }
            }

            //将所选学生插入该教师所指导学生列表中
            string idStr = string.Empty;

            foreach (string stuno in lstCheckedStudentNo)
            {
                teastuMdl.STUNO = stuno;
                teastuBll.Add(teastuMdl);
            }
            //显示更新数据
            readData(2);
        }
        /// <summary>
        /// 初始化所有学生列表
        /// 根据班级检索学生信息
        /// </summary>
        private void init_student(int classno)
        {
            Student.BLL.STUDENT_INFO studentBll = new BLL.STUDENT_INFO();
            DataSet ds = studentBll.GetList(" and C.classno = " + classno.ToString());

            this.cbb_Stuno.Properties.Items.Clear();
            cbb_Stuno.EditValue           = null;
            cbb_Stuno.Properties.NullText = "--请选择--";

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                string stuNo = ds.Tables[0].Rows[i]["stuno"].ToString();
                this.cbb_Stuno.Properties.Items.Add(stuNo);
            }
            this.cbb_Stuno.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
        }
Beispiel #4
0
        private void readData()
        {
            BLL.STUDENT_JOBSTATUS   stujobstatusBll = new BLL.STUDENT_JOBSTATUS();
            Model.STUDENT_JOBSTATUS stujobstatusMdl = new Model.STUDENT_JOBSTATUS();

            BLL.STUDENT_INFO   studentBll = new BLL.STUDENT_INFO();
            Model.STUDENT_INFO studentMdl = new Model.STUDENT_INFO();

            if (this._statusno > 0 || this._stuno.Length > 0)
            {
                stujobstatusMdl = stujobstatusBll.GetModel(_statusno);
                if (stujobstatusMdl == null)   //新增就业记录功能时
                {
                    blankData();
                    studentMdl           = studentBll.GetModel(_stuno, "1");
                    this.te_stuno.Text   = studentMdl.STUNO;
                    this.te_stuname.Text = studentMdl.NAME;
                }
                else                   //修改就业记录功能时
                {
                    stujobstatusMdl      = stujobstatusBll.GetModel(this._statusno);
                    this.te_stuno.Text   = stujobstatusMdl.STUNO;
                    studentMdl           = studentBll.GetModel(stujobstatusMdl.STUNO, "1");
                    this.te_stuname.Text = studentMdl.NAME;

                    BLL.ENTERPRISE_INFO   entBll = new BLL.ENTERPRISE_INFO();
                    Model.ENTERPRISE_INFO entMdl = new Model.ENTERPRISE_INFO();
                    entMdl = entBll.GetModel((int)stujobstatusMdl.ENTNO);
                    this.cbb_entname.Text = entMdl.ENTNAME;
                    this.te_jobtitle.Text = stujobstatusMdl.JOBTITLE;
                    this.te_salary.Text   = stujobstatusMdl.SALARY.ToString();
                    this.cbb_status.Text  = stujobstatusMdl.STATUS;
                    if (stujobstatusMdl.IF_CURRENT == 0)
                    {
                        this.cbb_ifcurrent.Text = "未就业";
                    }
                    else
                    {
                        this.cbb_ifcurrent.Text = "已就业";
                    }
                    this.dt_statustime.Text = stujobstatusMdl.STATUSTIME.ToString();
                    this.te_memo.Text       = stujobstatusMdl.MEMO;
                }
            }
        }
Beispiel #5
0
        /// <summary>
        /// 读取数据
        /// </summary>
        private void readData(int flag)
        {
            int termno, teacherno, workflowno;

            BLL.STUDENT_INFO   studentBll  = new BLL.STUDENT_INFO();
            BLL.TERM_INFO      termBll     = new BLL.TERM_INFO();
            Model.TERM_INFO    termMdl     = new Model.TERM_INFO();
            BLL.WORKFLOW       workflowBll = new BLL.WORKFLOW();
            Model.WORKFLOW     workflowMdl = new Model.WORKFLOW();
            BLL.TEACHER_INFO   teacherBll  = new BLL.TEACHER_INFO();
            Model.TEACHER_INFO teacherMdl  = new Model.TEACHER_INFO();

            termMdl = termBll.GetModel(this.cbb_term.Properties.Items[this.cbb_term.SelectedIndex].ToString());
            termno  = termMdl.TERMNO;

            workflowMdl = workflowBll.GetModel(this.cbb_workflow.Properties.Items[this.cbb_workflow.SelectedIndex].ToString());
            workflowno  = workflowMdl.WORKFLOWNO;

            //初始化学生列表
            this.tl_student.DataSource                  = studentBll.GetStudentNodeList(termno, workflowno).Tables[0];
            this.tl_student.KeyFieldName                = "nodeid";
            this.tl_student.ParentFieldName             = "parentid";
            this.tl_student.Columns["nodename"].Caption = "学生列表";

            //初始化教师指导学生列表
            string condition = "";

            condition += " and D.TERMNO = '" + termno.ToString() + "' ";
            condition += " and E.WORKFLOWNO = '" + workflowno.ToString() + "' ";
            if (flag == 2)
            {
                teacherMdl = teacherBll.GetModel(this.cbb_teacher.Properties.Items[this.cbb_teacher.SelectedIndex].ToString());
                teacherno  = teacherMdl.TEACHERNO;
                condition += " and C.TEACHERNO = '" + teacherno.ToString() + "' ";
            }

            BLL.TEA_STU teastuBll = new BLL.TEA_STU();
            this.gridControl1.DataSource = teastuBll.GetList(condition).Tables[0];
            this.gridView1.BestFitColumns();
            DBUtility.ToolHelper.DrawRowIndicator(gridView1, 50);
            DBUtility.ToolHelper.SetLineColorofGridView(this.gridView1);
        }
        private void readData()
        {
            if (this._stuno.Length > 0)
            {
                BLL.STUDENT_INFO   studentBll = new BLL.STUDENT_INFO();
                Model.STUDENT_INFO studentMdl = new Model.STUDENT_INFO();

                studentMdl = studentBll.GetModel(_stuno, "");
                if (studentMdl == null)   //新增专业功能时
                {
                    init_class();
                    init_dormitory();
                    blankData();
                }
                else                   //修改专业功能时
                {
                    BLL.CLASS_INFO       classBll     = new BLL.CLASS_INFO();
                    Model.CLASS_INFO     classMdl     = new Model.CLASS_INFO();
                    BLL.DORMITORY_INFO   dormitoryBll = new BLL.DORMITORY_INFO();
                    Model.DORMITORY_INFO dormitoryMdl = new Model.DORMITORY_INFO();

                    init_class();
                    init_dormitory();

                    classMdl = classBll.GetModel((int)studentMdl.CLASSNO);
                    this.cbb_classno.Text       = classMdl.CLASSNAME;
                    dormitoryMdl                = dormitoryBll.GetModel((decimal)studentMdl.DORMITORY_ID);
                    this.cbb_plate.Text         = dormitoryMdl.DORMITORY_PLATE;
                    this.te_stuno.Text          = studentMdl.STUNO;
                    this.te_name.Text           = studentMdl.NAME;
                    this.cbb_sex.Text           = studentMdl.SEX;
                    this.cbb_nation.Text        = studentMdl.NATION;
                    this.te_idcard.Text         = studentMdl.IDCARD;
                    this.cbb_political.Text     = studentMdl.POLITICAL;
                    this.cbb_source.Text        = studentMdl.SOURCE;
                    this.te_email.Text          = studentMdl.EMAIL;
                    this.te_zipcode.Text        = studentMdl.ZIPCODE;
                    this.te_familyaddress.Text  = studentMdl.FAMILYADDRESS;
                    this.te_phone.Text          = studentMdl.PHONE;
                    this.te_familyphone.Text    = studentMdl.FAMILYPHONE;
                    this.te_fatherphone.Text    = studentMdl.FATHERPHONE;
                    this.te_motherphone.Text    = studentMdl.MOTHERPHONE;
                    this.te_qqno.Text           = studentMdl.QQNO;
                    this.te_micromessageno.Text = studentMdl.MICROMESSAGENO;
                    if (studentMdl.PICTURE != null)
                    {
                        byte[] b = (byte[])studentMdl.PICTURE;
                        if (b.Length > 0)
                        {
                            MemoryStream stream = new MemoryStream(b, true);
                            stream.Write(b, 0, b.Length);
                            this.pb_picture.Image = new Bitmap(stream);
                            stream.Close();
                        }
                    }
                    else
                    {
                        this.pb_picture.Image = null;
                    }

                    switch (studentMdl.STATUS)
                    {
                    case 1:
                        this.cbb_status.Text = "正常"; break;

                    case 2:
                        this.cbb_status.Text = "休学"; break;

                    case 3:
                        this.cbb_status.Text = "退学"; break;

                    case 4:
                        this.cbb_status.Text = "毕业"; break;
                    }
                }
            }
        }
        /// <summary>
        /// 保存方法
        /// </summary>
        /// <returns></returns>
        private bool saveData()
        {
            try
            {
                BLL.CLASS_INFO       classBll     = new BLL.CLASS_INFO();
                Model.CLASS_INFO     classMdl     = new Model.CLASS_INFO();
                BLL.DORMITORY_INFO   dormitoryBll = new BLL.DORMITORY_INFO();
                Model.DORMITORY_INFO dormitoryMdl = new Model.DORMITORY_INFO();
                BLL.STUDENT_INFO     studentBll   = new BLL.STUDENT_INFO();
                Model.STUDENT_INFO   studentMdl   = new Model.STUDENT_INFO();

                if (this.te_stuno.Text == "")
                {
                    MessageBox.Show("学生学号不能为空!", "提示信息");
                    return(false);
                }

                if (!ToolHelper.IsNumeric(this.te_stuno.Text))
                {
                    MessageBox.Show("学生学号必须为数字!", "提示信息");
                    return(false);
                }

                if (this.te_name.Text == "")
                {
                    MessageBox.Show("学生姓名不能为空!", "提示信息");
                    return(false);
                }

                if (this.cbb_classno.SelectedIndex == -1)
                {
                    MessageBox.Show("学生所属班级不能为空!", "提示信息");
                    return(false);
                }

                if (this.cbb_status.SelectedIndex == -1)
                {
                    MessageBox.Show("学生状态不能为空!", "提示信息");
                    return(false);
                }

                if (this.cbb_plate.SelectedIndex == -1)
                {
                    MessageBox.Show("学生宿舍不能为空!", "提示信息");
                    return(false);
                }

                classMdl                  = classBll.GetModel(this.cbb_classno.Properties.Items[this.cbb_classno.SelectedIndex].ToString());
                studentMdl.CLASSNO        = classMdl.CLASSNO;
                dormitoryMdl              = dormitoryBll.GetModel(this.cbb_plate.Properties.Items[this.cbb_plate.SelectedIndex].ToString());
                studentMdl.DORMITORY_ID   = dormitoryMdl.DORMITORY_ID;
                studentMdl.NAME           = te_name.Text;
                studentMdl.STUNO          = this.te_stuno.Text;
                studentMdl.SEX            = this.cbb_sex.Text;
                studentMdl.NATION         = this.cbb_nation.Text;
                studentMdl.POLITICAL      = this.cbb_political.Text;
                studentMdl.SOURCE         = this.cbb_source.Text;
                studentMdl.PHONE          = te_phone.Text;
                studentMdl.FATHERPHONE    = te_fatherphone.Text;
                studentMdl.MOTHERPHONE    = te_motherphone.Text;
                studentMdl.FAMILYPHONE    = te_familyphone.Text;
                studentMdl.FAMILYADDRESS  = te_familyaddress.Text;
                studentMdl.ZIPCODE        = te_zipcode.Text;
                studentMdl.QQNO           = te_qqno.Text;
                studentMdl.MICROMESSAGENO = te_micromessageno.Text;
                if (pb_picture.Image != null)
                {
                    byte[] imageBytes = GetImageBytes(pb_picture.Image);
                    studentMdl.PICTURE = imageBytes;
                }
                switch (this.cbb_status.Properties.Items[this.cbb_status.SelectedIndex].ToString())
                {
                case "正常":
                    studentMdl.STATUS = 1; break;

                case "休学":
                    studentMdl.STATUS = 2; break;

                case "退学":
                    studentMdl.STATUS = 3; break;

                case "毕业":
                    studentMdl.STATUS = 4; break;
                }

                if (this._enumStatus == StatusClass.AddNew)  //新增学生信息
                {
                    if (studentBll.Exists(te_stuno.Text))
                    {
                        MessageBox.Show("当前学生学号已经存在,请核查!", "提示信息");
                        return(false);
                    }

                    studentBll.Add(studentMdl);
                    return(true);
                }
                else if (this._enumStatus == StatusClass.Edit)  //修改姓名
                {
                    studentMdl.STUNO = _stuno;
                    studentBll.Update(studentMdl);
                    return(true);
                }
                return(true);
            }
            catch (Exception exception)
            {
                MessageBox.Show("保存失败!" + exception.Message, exception.Message);
                return(false);
            }
        }