Пример #1
0
        public void DisplayThis(JMoneyLog log, UpdateMoneyInfoDelegate updateMoneyInfoCallback)
        {
            updateMoneyInfo = updateMoneyInfoCallback;
            if (log != null)
            {
                //Edit
                btnAddOK.Text = "OK";
                btnAbort.Text = "Cancel";

                SurrentSerialNo = log.SerialNo;  //設定模式為編輯

                dtpDate.Value = log.Date;
                switch (log.Type)
                {
                case "生活支出":
                    cbType.SelectedIndex = 0;
                    break;

                case "固定支出":
                    cbType.SelectedIndex = 1;
                    break;

                case "特別支出":
                    cbType.SelectedIndex = 2;
                    break;

                case "收入":
                    cbType.SelectedIndex = 3;
                    break;

                case "轉帳":
                    cbType.SelectedIndex = 4;
                    break;
                }
                cbItem.Text     = log.Item;
                tbValue.Text    = log.Amount.ToString();
                cbSource.Text   = log.Source;
                cbTarget.Text   = log.Target;
                tbContents.Text = log.Remark;
            }
            else
            {
                //Add
                btnAddOK.Text = "Add";
                btnAbort.Text = "Close";
            }

            this.ShowDialog();
        }
Пример #2
0
        public DML_MainF()
        {
            InitializeComponent();

            updateMoneyInfo = new UpdateMoneyInfoDelegate(UpdateMoneyInfoCallback);
        }