コード例 #1
0
        /// <summary>
        /// 新增记录
        /// </summary>
        private void btnAdd_MouseDown(object sender, MouseButtonEventArgs e)
        {
            EditRecord win = new EditRecord(this);

            win.ShowDialog();

            if (this.SuccessFlg)
            {
                this.GetDayTotal(DateTime.Now);
                this.GetMonthTotal(DateTime.Now);
                Message.ShowMessage("记录添加成功", this);
                // 刷新显示
                this.Refresh(Convert.ToDateTime(this.dateEdit.SelectedDate));
            }
        }
コード例 #2
0
        /// <summary>
        /// 详细明细选中事件
        /// </summary>
        private void Item_DoubleClick(object sender, MouseButtonEventArgs e)
        {
            Account account = this.dataDetail.SelectedItem as Account;

            if (account != null)
            {
                EditRecord win = new EditRecord(this);
                win.Init(account);
                win.ShowDialog();

                if (this.SuccessFlg)
                {
                    this.GetDayTotal(DateTime.Now);
                    this.GetMonthTotal(DateTime.Now);
                    Message.ShowMessage("记录修改成功", this);
                    // 刷新显示
                    this.Refresh(account.AccountDate);
                }
            }
        }