Beispiel #1
0
        /// <summary>
        /// 删除
        /// </summary>
        private void DoDeleteSelectedSupplier()
        {
            SupplierEntity removeEntity = SelectedSupplierRow;

            if (removeEntity == null)
            {
                MsgBox.Warn("没有要删除的数据。");
                return;
            }

            if (MsgBox.AskOK(string.Format("确定要删除供应商“{0}({1})”吗?", removeEntity.SupplierName, removeEntity.SupplierCode)) == DialogResult.OK)
            {
                bool ret = supplierDal.DeleteSupplier(removeEntity.SupplierCode);
                if (ret)
                {
                    bindingSource1.Remove(removeEntity);
                }
                else
                {
                    MsgBox.Warn("删除失败。");
                }
            }
        }