Esempio n. 1
0
        private void delete_toolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (XtraMessageBox.Show("确认删除选中的缴费记录吗?删除后数据不可恢复,请谨慎操作。", "消息", MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }
            VerificationForm form = new VerificationForm();

            form.ShowDialog();
            if (!form.Result)
            {
                return;
            }

            int[] selectRows = gridView1.GetSelectedRows();
            int[] rowsID     = new int[selectRows.Length];
            for (int i = 0; i < selectRows.Length; i++)
            {
                rowsID[i] = (gridView1.GetRow(selectRows[i]) as PayRecordInfo).ID;
            }
            int result = SQLiteControl.RealyDelete("PayRecordTable", "ID", rowsID);

            if (result <= 0)
            {
                XtraMessageBox.Show("删除选中的缴费记录失败", "消息", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
                return;
            }

            Query();
        }
        private void delete_toolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (XtraMessageBox.Show("确认[彻底删除]选中的学生信息吗?删除后数据不可恢复,请谨慎操作", "提示", MessageBoxButtons.YesNo) ==
                DialogResult.No)
            {
                return;
            }
            VerificationForm form = new VerificationForm();

            form.ShowDialog();
            if (!form.Result)
            {
                return;
            }
            //获取选中行
            int[] rows = gridView1.GetSelectedRows();
            int[] ids  = new int[rows.Length];

            for (int i = 0; i < rows.Length; i++)
            {
                ids[i] = (gridView1.GetRow(rows[i]) as StudentInfo).ID;
            }

            int result = StudentInfo.RealyDelete(ids);

            if (result > 0)
            {
                XtraMessageBox.Show("删除成功");
                Query();
                return;
            }

            XtraMessageBox.Show("删除失败");
            return;
        }
        private void edite_simpleButton_Click(object sender, EventArgs e)
        {
            if (XtraMessageBox.Show("确认修改当前用户的信息吗", "消息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==
                DialogResult.No)
            {
                return;
            }
            //敏感操作验证
            VerificationForm form = new VerificationForm();

            form.ShowDialog();
            if (!form.Result)
            {
                XtraMessageBox.Show("验证失败");
                return;
            }

            _account.Account  = account_textEdit.Text.Trim();
            _account.Person   = person_textEdit.Text.Trim();
            _account.Password = password_textEdit.Text.Trim();
            _account.Key      = key_textEdit.Text.Trim();

            //修改sql数据
            if (AccountInfo.Modify(_account) < 0)
            {
                XtraMessageBox.Show("修改用户失败");
            }
            else
            {
                XtraMessageBox.Show("修改用户信息成功");
            }
            this.Close();
            return;
        }
Esempio n. 4
0
        private void delete_toolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (XtraMessageBox.Show("确认删除选中行吗?", "消息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==
                DialogResult.No)
            {
                return;
            }

            VerificationForm form = new VerificationForm();

            form.ShowDialog();
            if (!form.Result)
            {
                return;
            }

            int[] selectRows = gridView1.GetSelectedRows();
            int[] ids        = new int[selectRows.Length];
            for (int i = 0; i < ids.Length; i++)
            {
                ids[i] = (gridView1.GetRow(selectRows[i]) as GroupClassInfo).ID;
            }

            if (GroupClassInfo.Delete(ids) <= 0)
            {
                XtraMessageBox.Show("部分选中行删除失败!请刷新后重试", "消息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                Query();
                return;
            }

            XtraMessageBox.Show("删除成功!", "消息", MessageBoxButtons.OK);
            Query();
            return;
        }
Esempio n. 5
0
        private void delete_toolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (XtraMessageBox.Show("确认删除选择的内容吗?删除后无法找回,请谨慎操作。", "消息", MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }

            //验证当前登录用户密码
            VerificationForm form = new VerificationForm();

            form.FormClosed += Form_FormClosed;
            form.ShowDialog();
            form.FormClosed -= Form_FormClosed;
            if (!form.Result)
            {
                XtraMessageBox.Show("验证失败");
                return;
            }

            int[] selects = gridView1.GetSelectedRows();
            int[] ids     = new int[selects.Length];
            for (int i = 0; i < selects.Length; i++)
            {
                ids[i] = (gridView1.GetRow(selects[i]) as AccountInfo).ID;
            }

            if (AccountInfo.SimpleDelete(ids))
            {
                XtraMessageBoxArgs args = ControlHelper.XtraMessageBoxArgs("消息", "删除成功", new DialogResult[] { DialogResult.OK });
                XtraMessageBox.Show(args);
                return;
            }
            else
            {
                XtraMessageBoxArgs args = ControlHelper.XtraMessageBoxArgs("消息", "删除失败", new DialogResult[] { DialogResult.OK });
                XtraMessageBox.Show(args);
            }
        }