private void DeleteListRow(int iRowIndex) { WarehouseInfo warehouse = GetListRowModel(iRowIndex); if (warehouse == null) { return; } if (MessageBox.Show(string.Format("是否确认删除仓库【{0}】?", warehouse.WarehouseName), "确认删除", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.No) { return; } try { if (warehouse.IsDel != 2) { string strErr = string.Empty; if (!Basic_Func.DeleteWarehouseByID(warehouse, ref strErr)) { Common.Common_Func.ErrorMessage(strErr, "删除失败"); return; } } Common.Common_Func.ErrorMessage("删除仓库成功", "删除成功"); } catch (Exception ex) { Common.Common_Func.ErrorMessage(ex.Message); } finally { GetListQueryData(); } }