Пример #1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            StudentMsg msg = (StudentMsg)value;
            DateTime   t   = msg.CreateTime;

            return("创建时间:" + t.ToHumanDateString() + "," + t.ToShortTimeString());
        }
        public bool Modify(StudentMsg student)
        {
            var query = from q in _DBMySchool.StudentMsg
                        where q.StudentNo == student.StudentNo
                        select q;

            foreach (var item in query)
            {
                item.StudentName = student.StudentName;
                item.Sex         = student.Sex;
                item.Speciality  = student.Speciality;
                item.Hobby       = student.Hobby;
                item.Department  = student.Department;
                item.Birthday    = student.Birthday;
            }
            try
            {
                _DBMySchool.SubmitChanges();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Пример #3
0
        public StudentMsg GetStudent()
        {
            string sex, birthday, hobby, dept, spec;

            sex      = rbMan.Checked ? "男" : "女";
            birthday = dtpBirthday.Value.ToString();
            dept     = cboDept.SelectedItem.ToString();
            if (lbSpec.SelectedIndex == -1)
            {
                MessageBox.Show("请选择专业!!!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(null);
            }

            spec  = lbSpec.SelectedItem.ToString();
            hobby = "";
            if (checkBox1.Checked)
            {
                hobby += checkBox1.Text;
            }
            if (checkBox2.Checked)
            {
                hobby += hobby == string.Empty ? checkBox2.Text : "、" + checkBox2.Text;
            }
            if (checkBox3.Checked)
            {
                hobby += hobby == string.Empty ? checkBox3.Text : "、" + checkBox3.Text;
            }
            if (checkBox4.Checked)
            {
                hobby += hobby == string.Empty ? checkBox4.Text : "、" + checkBox4.Text;
            }
            if (checkBox5.Checked)
            {
                hobby += hobby == string.Empty ? checkBox5.Text : "、" + checkBox5.Text;
            }
            if (checkBox6.Checked)
            {
                hobby += hobby == string.Empty ? checkBox6.Text : "、" + checkBox6.Text;
            }

            string info = "您姓名是:" + tbStuName.Text + "\n性别:" + sex + "\n出生年月为:" + birthday +
                          "\n您是" + dept + "系" + spec + "专业的学生" + "\n你的兴趣有:" + hobby;

            MessageBox.Show(info, "学生信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
            StudentMsg student = new StudentMsg()
            {
                StudentName = tbStuName.Text,
                Sex         = Convert.ToChar(sex),
                Birthday    = dtpBirthday.Value,
                Department  = dept,
                Speciality  = spec,
                Hobby       = hobby
            };

            if (_Student != null)
            {
                student.StudentNo = _Student.StudentNo;
            }
            return(student);
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return("1");
            }
            StudentMsg msg = (StudentMsg)value;

            return(msg.Rule.JCRule.ExJCRule.ValueMissionMsg(msg));
        }
Пример #5
0
 private void btnYes_Click(object sender, EventArgs e)
 {
     if (!_ViewModel.Modify(NewStudent = StuInfoControl.GetStudent()))
     {
         MessageBox.Show("修改失败!!!");
     }
     else
     {
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
 }
Пример #6
0
        private void btnYes_Click(object sender, EventArgs e)
        {
            StudentMsg student = StuInfoControl.GetStudent();

            if (student == null)
            {
                //MessageBox.Show("添加失败!!!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            else
            {
                _ViewModel.AddStudent(student);
            }
        }
Пример #7
0
        public bool AddStudentMsg(string Name, string StudentId, string RuleId)
        {
            StudentMsg msg = new StudentMsg()
            {
                StudentId = Guid.Parse(StudentId),
                RuleId    = new Guid(RuleId)
            };

            lock (DataList.Current[Name].StudentMsgs)
            {
                DataList.Current[Name].AddStudentMsg(msg);
            }
            ClientList.AddNewMsg(Name, nameof(Data.StudentMsgs));
            return(true);
        }
Пример #8
0
 public void SetStudent(StudentMsg student)
 {
     _Student = student;
 }
Пример #9
0
 public ModifyWindow(StudentMsg student) : this()
 {
     StuInfoControl.SetStudent(student);
 }
Пример #10
0
 public XXT_StudentMsg(StudentMsg StudentMsg)
 {
     this.StudentMsg = StudentMsg;
 }
Пример #11
0
 public void AddStudent(StudentMsg student)
 {
     _DBMySchool.StudentMsg.InsertOnSubmit(student);
     _DBMySchool.SubmitChanges();
 }
Пример #12
0
 public static void UserRunJCRule(this JCRule jcrule, StudentMsg msg, string cmd, Action <StudentMsg> action)
 {
 }