Esempio n. 1
0
        private void Tool_productCheckClearDB_Click(object sender, EventArgs e)
        {
            if (this.radGridViewCheck.RowCount < 1)
            {
                MessageBox.Show("没有可以清除的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (MessageBox.Show("确认要清除当前数据?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) != DialogResult.OK)
            {
                return;
            }
            //var delRow = serviceClient.DeleteProductPackage(this.currentQueryCondition,0);
            List <MesService.CheckPackageProductHistory> packageProductHistoryList = new List <MesService.CheckPackageProductHistory>();

            foreach (var rowInfo in this.radGridViewCheck.Rows)
            {
                MesService.CheckPackageProductHistory packageProductHistory = new MesService.CheckPackageProductHistory();
                packageProductHistory.OutCaseCode   = rowInfo.Cells[1].Value.ToString();
                packageProductHistory.ProductSN     = rowInfo.Cells[2].Value.ToString();
                packageProductHistory.ProductTypeNo = rowInfo.Cells[3].Value.ToString();
                packageProductHistory.BindState     = "0";
                packageProductHistoryList.Add(packageProductHistory);
            }
            var delRow = serviceClient.DeleteCheckProductPackageHistory(packageProductHistoryList.ToArray());

            if (delRow > 0)
            {
                MessageBox.Show($"已删除产品{delRow}条!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("未删除任何产品!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            SelectOfPackageCheck("0");
        }