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

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

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