コード例 #1
0
ファイル: frmMain.cs プロジェクト: tomyqg/CSHomework
        private void btnLayoutDelete_Click(object sender, EventArgs e)
        {
            Layout layout = layoutBindingSource.Current as Layout;

            if (layout == null || layout.RefNum != 0)
            {
                return;
            }
            try
            {
                bllPos.DropPositionBelongLayout(layout.Id);
                bllLayout.DropLayout(layout.Id);
                layoutBindingSource.RemoveCurrent();
            }
            catch (Exception)
            {
                string msg = string.Format("删除失败! 标识: {0}, 风格: {1}, 被放映厅引用次数: {2}"
                                           , layout.Id, layout.Style, layout.RefNum);
                MessageBox.Show(msg, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }