Пример #1
0
        private void tsbAdd_Click(object sender, EventArgs e)
        {
            FrmGoods frm = new FrmGoods();

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                this.RefreshListView();
            }
        }
Пример #2
0
        private void tsbModify_Click(object sender, EventArgs e)
        {
            try
            {
                List <Goods> selectedModelList = GetSelectedModelList();
                if (selectedModelList.Count != 1)
                {
                    throw new ApplicationException("请选择唯一的内容进行修改。");
                }

                FrmGoods frm = new FrmGoods(selectedModelList[0]);
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    this.RefreshListView();
                }
            }
            catch (Exception ex)
            {
                ErrorHandler.OnError(ex);
            }
        }