private void bbiAddNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { FrmMedium form = new FrmMedium(); if (form.ShowDialog() == DialogResult.OK) { Medium medium = form.Medium; IMediumMgr mediumMgr = new ContainerBootstrapper().ChildContainer.Resolve <IMediumMgr>(); mediumMgr.Save(medium); XtraMessageBox.Show("成功地新建了介质!"); LoadMediums(); } }
private void bbiModify_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Medium medium = gridViewProducts.GetFocusedRow() as Medium; if (medium == null) { XtraMessageBox.Show("请先选择待修改的介质!", "提示"); return; } FrmMedium form = new FrmMedium(medium); if (form.ShowDialog() == DialogResult.OK) { IMediumMgr mediumMgr = new ContainerBootstrapper().ChildContainer.Resolve <IMediumMgr>(); medium = form.Medium; mediumMgr.Save(medium); XtraMessageBox.Show("成功地修改了介质名称!"); } }