コード例 #1
0
        async private void DeleteAllRowData()
        {
            if (materialType == MaterialType.MATERIAL_BINDING)
            {
                if (this.radGridViewBind.RowCount < 1)
                {
                    MessageBox.Show("没有可以删除的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (MessageBox.Show("确认删除【物料绑定】的所有数据?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.Cancel)
                {
                    return;
                }
                int res = await serviceClient.DeleteAllProductContinairCapacityAsync();

                if (res > 0)
                {
                    MessageBox.Show("清除服务数据完成!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("清除服务数据失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else if (materialType == MaterialType.MATERIAL_STOCK_MODIFY)
            {
                if (this.radGridViewBind.RowCount < 1)
                {
                    MessageBox.Show("没有可以删除的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (MessageBox.Show("确认删除【库存管理】的所有数据?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.Cancel)
                {
                    return;
                }
                int res = await serviceClient.DeleteAllMaterialAsync();

                if (res > 0)
                {
                    MessageBox.Show("清除服务数据完成!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("清除服务数据失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            SelectData();
        }