示例#1
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);
            }
        }
示例#2
0
 private void FeedbackBtn_Click_1(object sender, RoutedEventArgs e)
 {
     FeedbackWindows feedbackWindow = new FeedbackWindows(false);
     feedbackWindow.ShowDialog();
 }