Beispiel #1
0
        /// <summary>
        /// 新增提醒項目
        /// </summary>
        private void AddTip()
        {
            MiniTipsDataSet newDs = new MiniTipsDataSet();
            FormEditTip tipForm = new FormEditTip(newDs);

            if (DialogResult.OK == tipForm.ShowDialog())
            {
                _ds.Merge(newDs);
                this._ds.SaveUserDb();
            }
            else
            {
                this._ds.RejectChanges();
            }
            // release all resorce
            newDs.Dispose();
            tipForm.Dispose();
        }
Beispiel #2
0
        /// <summary>
        /// 打開編輯提醒項目 Dialog
        /// </summary>
        private void EditTip()
        {
            if (this.DataGridView_Tips.SelectedRows.Count == 0)
            {
                return;
            }

            DataRowView view = (DataRowView)this.DataGridView_Tips.SelectedRows[0].DataBoundItem;
            FormEditTip tipForm = new FormEditTip((MiniTipsDataSet.TipsRow)view.Row);
            if (DialogResult.OK == tipForm.ShowDialog())
            {
                this._ds.SaveUserDb();
            }
            // release all resorce
            tipForm.Dispose();
        }