Example #1
0
        /// <summary>
        /// 获取当前时间待填写的实验记录
        /// </summary>
        /// <returns>待填写的实验记录 Exprecord</returns>
        public Exprecord GetCurrentExprecord(int labID)
        {
            Exprecord expRecord = new Exprecord();
            using(JszxDataManager jszxDateManage=new JszxDataManager()){
                //当前课节
                ClassTime ct = GetCurrentClassTime();

                 if (ct == null)
                 {
                     //当前不在上课时间,返回空的待填实验记录
                     return null;
                 }
                 else
                 {
                     //在上课时间,判断当前是否有课
                     //当前学期
                     Term tm = GetCurrentTerm();
                     //当前周次
                     int wk = GetCurrentWeeks();
                     //当前工作日
                     int weekDay = GetCurrentWeekDay();

                     schedule_tb scd_tb = jszxDateManage.GetScheduleByCls(labID,tm.TermID,wk,weekDay,ct.ClsTmIndex);

                     if (scd_tb == null)
                     {
                         //没课
                         return null;
                     }
                     else
                     {
                         //有课
                         //构建实验记录信息
                         expRecord.CourseName = scd_tb.courses_tb.CrsName;
                         expRecord.ExpClasses = scd_tb.courses_tb.CrsClasses;
                         expRecord.ExpCls = (sbyte?)scd_tb.ScdClass;
                         expRecord.ExpDate = DateTime.Now;
                         expRecord.ExpLab = scd_tb.labs_tb.LabName;
                         expRecord.ExpLabID = scd_tb.ScdLab;
                         expRecord.ExpName = "";
                         expRecord.ExpTerm = scd_tb.ScdTerm;
                         expRecord.ExpWeek = scd_tb.ScdWeek;
                         expRecord.ExpWeekDay = scd_tb.ScdWeekDay;
                         expRecord.Groups = scd_tb.courses_tb.CrsNum;
                         expRecord.InstrumentStatus = "正常";
                         expRecord.PerGroup = 1;
                         expRecord.Problems = "无";
                         expRecord.Realizer = scd_tb.courses_tb.CrsNum;
                         expRecord.Shoulder = scd_tb.courses_tb.CrsNum;
                         expRecord.StudentStatus = "良好";
                         expRecord.TeacherName = scd_tb.courses_tb.CrsTeacher;
                     }

                 }
             }

            return expRecord;
        }
Example #2
0
        /// <summary>
        /// 提交事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SubmitSign_Click_1(object sender, RoutedEventArgs e)
        {
            //获取数据
            Exprecord expSubmit = new Exprecord();

            expSubmit.CourseName = this.CourseName.Text.Trim();
            if (expSubmit.CourseName == "")
            {
               System.Windows.MessageBox.Show("请填写课程名!");
               return;
            }
            expSubmit.ExpClasses = this.ExpClass.Text.Trim();
            if (expSubmit.ExpClasses == "")
            {
                System.Windows.MessageBox.Show("请填写实验班级!");
                return;
            }
            expSubmit.ExpDate = DateTime.Now.Date;

            expSubmit.ExpLab = Properties.Settings.Default.LabName;

            expSubmit.ExpLabID = Properties.Settings.Default.LabID;
            expSubmit.ExpName = this.ExpName.Text.Trim();
            if (expSubmit.ExpName == "")
            {
                System.Windows.MessageBox.Show("请填写实验名称!");
                return;
            }
            //实验学期在服务器端完成
            //expSubmit.ExpTerm=

            expSubmit.ExpWeek =Convert.ToSByte(this.ExpWeek.Text.Trim());

            expSubmit.ExpWeekDay = Convert.ToSByte(this.ExpWeekday.Text.Trim());
            if (this.Shoulder.Text.Trim() == "")
            {
                System.Windows.MessageBox.Show("请填写学生应到人数!");
                return;
            }

            expSubmit.Shoulder = Convert.ToInt32(this.Shoulder.Text.Trim());
            if (this.Realize.Text.Trim() == "")
            {
                System.Windows.MessageBox.Show("请填写学生实到人数!");
                return;
            }
            expSubmit.Realizer = Convert.ToInt32(this.Realize.Text.Trim());

            if (this.ExpGroups.Text.Trim() == "")
            {
                System.Windows.MessageBox.Show("请填写实验组数!");
                return;
            }
            expSubmit.Groups =Convert.ToInt32( this.ExpGroups.Text.Trim());
            if (this.PerGroups.Text.Trim() == "")
            {
                System.Windows.MessageBox.Show("请填写实验每组人数!");
                return;
            }
            expSubmit.PerGroup = Convert.ToInt32(this.PerGroups.Text.Trim());

            expSubmit.PostTime = DateTime.Now;
            if (this.StudentsStatus.Text.Trim() == "")
            {
                System.Windows.MessageBox.Show("请填写学生出勤情况!");
                return;
            }
            expSubmit.StudentStatus = this.StudentsStatus.Text.Trim();
            if (this.InstrumentStatus.Text.Trim() == "")
            {
                System.Windows.MessageBox.Show("请填写仪器使用情况!");
                return;
            }
            expSubmit.InstrumentStatus = this.InstrumentStatus.Text.Trim();
            if (this.Problems.Text.Trim() == "")
            {
                System.Windows.MessageBox.Show("请填写实验出现问题!");
                return;
            }
            expSubmit.Problems = this.Problems.Text.Trim();
            if (this.TeacherName.Text.Trim() == "")
            {
                System.Windows.MessageBox.Show("请填写教师姓名!");
                return;
            }
            expSubmit.TeacherName = this.TeacherName.Text.Trim();
            if (this.TeacherNum.Text.Trim() == "")
            {
                System.Windows.MessageBox.Show("请填写教工号!");
                return;
            }
            expSubmit.TeacherNumber = this.TeacherNum.Text.Trim();
            if (this.StudentName.Text.Trim() == "")
            {
                System.Windows.MessageBox.Show("请填写学生组长姓名!");
                return;
            }
            expSubmit.StudentName = this.StudentName.Text.Trim();
            if (SelectedClass.Count <= 0)
            {
                System.Windows.MessageBox.Show("请选择实验课节!");
            }
            try
            {
                Proxy = ChannelFactory.CreateChannel();
                Proxy.SaveExpRecord(expSubmit, SelectedClass);
                //提示保存成功和反馈意见窗口
                FeedbackWindows feedbackWindow = new FeedbackWindows(true);
                feedbackWindow.ShowDialog();
                isSign = true;
                TimeCounts = Proxy.GetPopTimeTallies();
               this.Hide();

            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show("出现错误:"+ex.Message);
            }
        }
Example #3
0
        /// <summary>
        /// 初始化窗口表单
        /// </summary>
        /// <param name="exp">待初始化的实验记录</param>
        private void SetForm(Exprecord exp)
        {
            //初始化文本框
            this.CourseName.Text = exp.CourseName;
            this.ExpName.Text = exp.ExpName;
            this.ExpClass.Text = exp.ExpClasses;
            this.Shoulder.Text = exp.Shoulder.ToString();
            this.Realize.Text = exp.Realizer.ToString();
            this.ExpGroups.Text = exp.Groups.ToString();
            this.PerGroups.Text = exp.PerGroup.ToString();
            this.StudentsStatus.Text = exp.StudentStatus;
            this.InstrumentStatus.Text = exp.InstrumentStatus;
            this.Problems.Text = exp.Problems;
            this.TeacherName.Text = exp.TeacherName;
            this.TeacherNum.Text = exp.TeacherNumber;
            this.StudentName.Text = exp.StudentName;

            SetCls();
        }
Example #4
0
 public ExpRecordWithFlag()
 {
     ExpRecord = new Exprecord();
 }
Example #5
0
        /// <summary>
        /// 保存实验记录
        /// </summary>
        /// <param name="exp">实验记录信息,不包含实验学期,和实验节次</param>
        /// <param name="selectedClass">实验记录节次的列表</param>
        public void SaveExpRecord(Exprecord exp, List<int> selectedClass)
        {
            using(JszxDataManager jszxDataManager=new JszxDataManager()){
                int tm = jszxDataManager.GetCurrentTerm().TermID;
                exp.ExpTerm = tm;
                foreach(int cls in selectedClass){
                    exp.ExpCls =(sbyte)cls;
                    exprecords_tb exptb = null;
                    //判断当前课是否填写过
                    exptb = jszxDataManager.GetExpRecords(tm, (int)exp.ExpLabID, (int)exp.ExpWeek, (int)exp.ExpWeekDay, (int)exp.ExpCls).FirstOrDefault();
                    if (exptb == null)
                    {
                        exptb = new exprecords_tb();
                    }
                    exptb.CourseName = exp.CourseName;
                    exptb.ExpClasses = exp.ExpClasses;
                    exptb.ExpCls = exp.ExpCls;
                    exptb.ExpDate = exp.ExpDate;
                    exptb.ExpLab = exp.ExpLab;
                    exptb.ExpLabID = exp.ExpLabID;
                    exptb.ExpName = exp.ExpName;
                    exptb.ExpTerm = exp.ExpTerm;
                    exptb.ExpWeek = exp.ExpWeek;
                    exptb.ExpWeekDay = exp.ExpWeekDay;
                    exptb.Groups = exp.Groups;
                    exptb.InstrumentStatus = exp.InstrumentStatus;
                    exptb.PerGroup = exp.PerGroup;
                    exptb.PostTime = exp.PostTime;
                    exptb.Problems = exp.Problems;
                    exptb.Realizer = exp.Realizer;
                    exptb.Shoulder = exp.Shoulder;
                    exptb.StudentName = exp.StudentName;
                    exptb.StudentStatus = exp.StudentStatus;
                    exptb.TeacherName = exp.TeacherName;
                    exptb.TeacherNumber = exp.TeacherNumber;

                    jszxDataManager.SaveExpRecord(exptb);

                }
            }
        }
Example #6
0
        public PageRecord GetPageRecords(SearchRecordParam pm)
        {
            PageRecord pageRecord = new PageRecord();
            using (JszxDataManager jszxDataManager = new JszxDataManager())
            {
                PageExpRecord _pageRecord = jszxDataManager.GetPageExpRecords(pm.term,pm.lab,pm.week,pm.weekday,pm.cls,pm.teacherNum,pm.page,pm.pageSize);
                foreach(var red in _pageRecord.ExpRecordList){

                    Exprecord exprd = new Exprecord();
                    exprd.CourseName = red.CourseName;
                    exprd.ExpClasses = red.ExpClasses;
                    exprd.ExpCls = red.ExpCls;
                    exprd.ExpDate = red.ExpDate;
                    exprd.ExpLab = red.ExpLab;
                    exprd.ExpLabID = red.ExpLabID;
                    exprd.ExpName = red.ExpName;
                    exprd.ExpTerm = red.ExpTerm;
                    exprd.ExpWeek = red.ExpWeek;
                    exprd.ExpWeekDay = red.ExpWeekDay;
                    exprd.Groups = red.Groups;
                    exprd.InstrumentStatus = red.InstrumentStatus;
                    exprd.PerGroup = red.PerGroup;
                    exprd.PostTime = red.PostTime;
                    exprd.Problems = red.Problems;
                    exprd.Realizer = red.Realizer;
                    exprd.RecordID = red.RecordID;
                    exprd.Shoulder = red.Shoulder;
                    exprd.StudentName = red.StudentName;
                    exprd.StudentStatus = red.StudentStatus;
                    exprd.TeacherName = red.TeacherName;
                    exprd.TeacherNumber = red.TeacherNumber;

                    pageRecord.ExpRecordList.Add(exprd);
                }

                pageRecord.Page = _pageRecord.Page;
                pageRecord.Pages = _pageRecord.Pages;
                pageRecord.PageSize = _pageRecord.PageSize;
            }
            return pageRecord;
        }
Example #7
0
        /// <summary>
        /// 获取当前时间实验是否需要填写
        /// </summary>
        /// <param name="labID">实验室ID</param>
        /// <returns>带填写标识的记录</returns>
        public ExpRecordWithFlag GetExpRecordWithFlag(int labID)
        {
            ExpRecordWithFlag expFlag = new ExpRecordWithFlag();
            int signFlag = 0;
            Exprecord expRecord = new Exprecord();
            using (JszxDataManager jszxDateManage = new JszxDataManager())
            {
                //当前课节
                ClassTime ct = GetCurrentClassTime();

                if (ct == null)
                {
                    //当前不在上课时间,返回空的待填实验记录
                    signFlag = 0;
                }
                else
                {
                    //在上课时间,判断当前是否有课
                    //当前学期
                    Term tm = GetCurrentTerm();
                    //当前周次
                    int wk = GetCurrentWeeks();
                    //当前工作日
                    int weekDay = GetCurrentWeekDay();

                    schedule_tb scd_tb = jszxDateManage.GetScheduleByCls(labID, tm.TermID, wk, weekDay, ct.ClsTmIndex);

                    if (scd_tb == null)
                    {
                        //没课,不需要填写
                        signFlag = 0;
                        expRecord = null;
                    }
                    else
                    {
                        //有课
                        //查询是否填写

                        exprecords_tb exp_tb = jszxDateManage.GetExprecordByCls(labID, tm.TermID, wk, weekDay, ct.ClsTmIndex);
                        if (exp_tb == null)
                        {
                            //未填写
                            signFlag = 3;
                            //未填写,构建实验记录,返回填写
                            expRecord.CourseName = scd_tb.courses_tb.CrsName;
                            expRecord.ExpClasses = scd_tb.courses_tb.CrsClasses;
                            expRecord.ExpCls = (sbyte?)scd_tb.ScdClass;
                            expRecord.ExpDate = DateTime.Now;
                            expRecord.ExpLab = scd_tb.labs_tb.LabName;
                            expRecord.ExpLabID = scd_tb.ScdLab;
                            expRecord.ExpName = "";
                            expRecord.ExpTerm = scd_tb.ScdTerm;
                            expRecord.ExpWeek = scd_tb.ScdWeek;
                            expRecord.ExpWeekDay = scd_tb.ScdWeekDay;
                            expRecord.Groups = scd_tb.courses_tb.CrsNum;
                            expRecord.InstrumentStatus = "正常";
                            expRecord.PerGroup = 1;
                            expRecord.Problems = "无";
                            expRecord.Realizer = scd_tb.courses_tb.CrsNum;
                            expRecord.Shoulder = scd_tb.courses_tb.CrsNum;
                            expRecord.StudentStatus = "良好";
                            expRecord.TeacherName = scd_tb.courses_tb.CrsTeacher;
                            expRecord.StudentName = "";
                            expRecord.TeacherNumber = "";
                            //expRecord.PostTime =

                        }
                        else
                        {
                            //已经填写
                            if (exp_tb.CourseName == scd_tb.courses_tb.CrsName)
                            {
                                //课程名称相同,判断为正确的记录
                                expRecord = null;
                                signFlag = 1;
                            }
                            else
                            {
                                //课程名称不相同,错误的填写记录
                                signFlag = 2;

                                //返回待确认记录
                                //未填写,构建实验记录,返回填写
                                expRecord.CourseName = exp_tb.CourseName;
                                expRecord.ExpClasses = exp_tb.ExpClasses;
                                expRecord.ExpCls = exp_tb.ExpCls;
                                expRecord.ExpDate = exp_tb.ExpDate;
                                expRecord.ExpLab = exp_tb.ExpLab;
                                expRecord.ExpLabID = exp_tb.ExpLabID;
                                expRecord.ExpName = exp_tb.ExpName;
                                expRecord.ExpTerm = exp_tb.ExpTerm;
                                expRecord.ExpWeek = exp_tb.ExpWeek;
                                expRecord.ExpWeekDay = exp_tb.ExpWeekDay;
                                expRecord.Groups = exp_tb.Groups;
                                expRecord.InstrumentStatus = exp_tb.InstrumentStatus;
                                expRecord.PerGroup = exp_tb.PerGroup;
                                expRecord.Problems = exp_tb.Problems;
                                expRecord.Realizer = exp_tb.Realizer;
                                expRecord.Shoulder = exp_tb.Shoulder;
                                expRecord.StudentStatus = exp_tb.StudentStatus;
                                expRecord.TeacherName = exp_tb.TeacherName;
                                expRecord.StudentName = exp_tb.StudentName;
                                expRecord.TeacherNumber = exp_tb.TeacherNumber;
                                expRecord.PostTime = exp_tb.PostTime;
                            }
                        }
                    }
                }
            }
            expFlag.SignFlag = signFlag;
            expFlag.ExpRecord = expRecord;
            return expFlag;
        }