Exemplo n.º 1
0
        private void tsbAdd_Click(object sender, EventArgs e)
        {
            FrmCompany frm = new FrmCompany();

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

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