예제 #1
0
        private void tsbAdd_Click(object sender, EventArgs e)
        {
            FrmDrugFrom frm = new FrmDrugFrom();

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

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