Example #1
0
        private void tsbAdd_Click(object sender, EventArgs e)
        {
            FrmCompanyType frm = new FrmCompanyType();

            frm.ShowDialog(this);
            if (frm.DialogResult == DialogResult.OK)
            {
                this.RefreshListView();
            }
        }
Example #2
0
        private void tsbModify_Click(object sender, EventArgs e)
        {
            try
            {
                List <CompanyType> selectedModelList = this.GetSelectModelList();

                if (selectedModelList.Count > 1)
                {
                    throw new ApplicationException("请选择一个修改内容。");
                }
                ModelService   modelService = new ModelService();
                FrmCompanyType frm          = new FrmCompanyType(selectedModelList[0]);
                frm.ShowDialog(this);
                if (frm.DialogResult == DialogResult.OK)
                {
                    this.RefreshListView();
                }
            }
            catch (Exception ex)
            {
                ErrorHandler.OnError(ex);
            }
        }