Esempio n. 1
0
        private void m_addAccountBtn_Click(object sender, EventArgs e)
        {
            AddAccountWnd addWnd = new AddAccountWnd();

            if (DialogResult.OK != addWnd.ShowDialog() && addWnd.NewAccount == null)
            {
                return;
            }

            m_mainwnd.AddAccountBillToView(addWnd.NewAccount);
            AddAccountToView(addWnd.NewAccount);
        }
        private void m_initLab_Click(object sender, EventArgs e)
        {
            AddAccountWnd addWnd = new AddAccountWnd();

            if (DialogResult.OK != addWnd.ShowDialog())
            {
                return;
            }

            m_mainWnd.AddAccountBillToView(addWnd.NewAccount);
            InitAccountList();
        }
Esempio n. 3
0
        private void m_accountListDGV_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }

            Account account = GetAccountInView(e.RowIndex);

            // 删除
            if (e.ColumnIndex == 6)
            {
                if (DialogResult.No == MessageBox.Show(this, "删除后不可恢复!确定删除吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning))
                {
                    return;
                }

                m_accountListDGV.Rows.RemoveAt(e.RowIndex);
                m_mainwnd.RemoveAccount(account.Name);
                return;
            }

            if (e.ColumnIndex == 7)
            {
                AddAccountWnd addWnd = new AddAccountWnd(account);
                if (DialogResult.OK != addWnd.ShowDialog() && addWnd.NewAccount == null)
                {
                    return;
                }

                Account newAccount = addWnd.NewAccount;
                m_accountListDGV.Rows[e.RowIndex].Cells[1].Value = Utility.FormatAccountString(account.Number);
                m_accountListDGV.Rows[e.RowIndex].Cells[2].Value = account.ExpiredDate;
                m_accountListDGV.Rows[e.RowIndex].Cells[3].Value = account.BillStartDay + "/" + account.BillExpiredDay;
                m_accountListDGV.Rows[e.RowIndex].Cells[4].Value = account.CreditAmount.ToString();
                m_accountListDGV.Rows[e.RowIndex].Cells[5].Value = account.Rate.ToString();

                m_mainwnd.UpdateAccount(newAccount);
                return;
            }
        }