Exemplo n.º 1
0
 private void Query()
 {
     gridControl1.DataSource    = PayRecordInfo.SimpleQuery(_pageIndex, _pageSize, _key, out _pageTotal);
     gridView1.FocusedRowHandle = _selectionRow;
     DevExpress.XtraGrid.Views.Base.ColumnView columnView =
         gridControl1.FocusedView as DevExpress.XtraGrid.Views.Base.ColumnView;
     columnView.MoveBy(0);
     gridControl1.RefreshDataSource();
     _page.SetPage(_pageIndex, _pageSize, _pageTotal);
 }
Exemplo n.º 2
0
        private void gridControl1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            PayRecordInfo arg = gridView1.GetRow(gridView1.FocusedRowHandle) as PayRecordInfo;

            if (arg == null)
            {
                XtraMessageBox.Show("选中的信息错误,请刷新后重试", "消息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            PayDetailForm form = new PayDetailForm(arg, WindowsModel.Display);

            form.Show();
        }
        protected void SetWindwosText(PayRecordInfo arg)
        {
            tuition_textEdit.Text    = arg.Tuition.ToString();
            classHours_textEdit.Text = arg.ClassHours.ToString();
            remaining_textEdit.Text  = arg.Remaining.ToString();
            last_dateEdit.Text       = DateTime.Compare(arg.LastDateTime, new DateTime(1970, 1, 1)) <= 0
                ? string.Empty
                : arg.LastDateTime.ToString();
            if (arg.Pay)
            {
                yes_checkEdit.Checked = true;
                no_checkEdit.Checked  = false;
            }
            else
            {
                no_checkEdit.Checked  = true;
                yes_checkEdit.Checked = false;
            }

            notPay_textEdit.Text = arg.NotPay.ToString();
            remark_memoEdit.Text = arg.Remark;
        }
        private void ok_simpleButton_Click(object sender, EventArgs e)
        {
            if (no_checkEdit.Checked && yes_checkEdit.Checked)
            {
                XtraMessageBox.Show("请选择缴费状态", "消息");
                no_checkEdit.Checked = true;
                return;
            }
            if (string.IsNullOrEmpty(last_dateEdit.Text.Trim()))
            {
                last_dateEdit.DateTime = DateTime.Today;
                last_dateEdit.Focus();
                XtraMessageBox.Show("请选择正确的追缴日期", "消息");
                return;
            }

            if (XtraMessageBox.Show("确认更改以上信息吗?", "消息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==
                DialogResult.No)
            {
                return;
            }

            Public.VerificationForm form = new Public.VerificationForm();
            form.ShowDialog();
            if (!form.Result)
            {
                return;
            }

            DialogResult = DialogResult.No;
            _studentInfo = GetWindowsText(_studentInfo);
            if (StudentInfo.Updata(_studentInfo) <= 0)
            {
                XtraMessageBox.Show("修改失败!");
                return;
            }
            PayRecordInfo pr = new PayRecordInfo()
            {
                StudentID       = _studentInfo.ID,
                StudentName     = _studentInfo.Name,
                Tuition         = _studentInfo.Tuition,
                ClassHours      = _studentInfo.ClassHours,
                Remaining       = _studentInfo.Remaining,
                Pay             = _studentInfo.Pay,
                NotPay          = _studentInfo.NotPay,
                Remark          = remark_memoEdit.Text,
                LastDateTime    = last_dateEdit.DateTime,
                OperationID     = AccountInfo.AccountSession.ID,
                OperationPerson = AccountInfo.AccountSession.Person,
            };
            int result = PayRecordInfo.CreateRecord(pr);

            if (result <= 0)
            {
                XtraMessageBox.Show("添加历史修改记录失败", "消息");
                return;
            }

            XtraMessageBox.Show("更新成功");
            Close();
            return;
        }
 public PayDetailForm(PayRecordInfo arg, WindowsModel wm)
 {
     InitializeComponent();
     SetWindwosText(arg);
     ViewInit(wm);
 }