Example #1
0
        /// <summary>
        /// 删除学员信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            ScoreExt selectStu = smDgStudentLsit.SelectedItem as ScoreExt;

            if (selectStu == null)
            {
                MessageBox.Show("请选择要删除的学员!", "提示");
                return;
            }
            ScoreExt student = sm.GetStudentById(selectStu.StudentlD);

            if (student != null)
            {
                MessageBoxResult mbr = MessageBox.Show("您确定要删除【" + student.StudentName + "】", "警告", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
                if (mbr == MessageBoxResult.OK)
                {
                    if (sm.DeleteStudentById(student.StudentlD))
                    {
                        MessageBox.Show("删除成功!", "提示");
                    }
                    else
                    {
                        MessageBox.Show("删除失败请稍后再试!", "提示");
                    }
                }
                else
                {
                    MessageBox.Show("删除失败请稍后再试!", "提示");
                }
            }
        }
Example #2
0
        //修改信息
        private void btnUpdate_Click(object sender, RoutedEventArgs e)
        {
            ScoreExt selectStu = smDgStudentLsit.SelectedItem as ScoreExt;

            if (selectStu == null)
            {
                MessageBox.Show("请选择要修改的学员!", "提示");
                return;
            }

            StudentExt          objStu         = sm1.GetStudentById(selectStu.StudentlD);
            XiugaiStudentManage updateStuInfor = new XiugaiStudentManage(objStu);

            updateStuInfor.ShowDialog();
            //刷新DG中这个学员的信息
            RefreshDG();
        }