Пример #1
0
        private void updata_simpleButton_Click(object sender, EventArgs e)
        {
            if (!FullChecked())
            {
                return;
            }
            if (_studentInfo.ID == 0)
            {
                if (StudentInfo.CreateStudentInfo(GetWindowsText(_studentInfo)) <= 0)
                {
                    XtraMessageBox.Show("新建学生失败", "消息");
                    return;
                }
                else
                {
                    XtraMessageBox.Show("新建学生成功", "消息");
                    this.Close();
                }
            }
            else
            {
                _studentInfo = GetWindowsText(_studentInfo);
                if (StudentInfo.Updata(_studentInfo) <= 0)
                {
                    XtraMessageBox.Show("更新学生信息失败", "消息");
                    return;
                }

                XtraMessageBox.Show("更新学生信息成功", "消息");
                this.Close();
            }
        }