private void RadGridView2_CellEndEdit(object sender, GridViewCellEventArgs e)
        {
            var materialStock = this.radGridViewStock.CurrentRow.Cells[6].Value;
            var describle     = this.radGridViewStock.CurrentRow.Cells[7].Value;
            var materialRid   = this.radGridViewStock.CurrentRow.Cells[3].Value;

            if (materialStock == null)
            {
                return;
            }
            if (materialStock.ToString() != keyOldMaterialStock || describle.ToString() != keyOldMaterialDescrible)
            {
                ProductMaterial productMaterial = new ProductMaterial();
                var             materialCode    = serviceClient.GetMaterialCode(materialRid.ToString());
                productMaterial.keyMaterialCode         = materialCode;
                productMaterial.keyOldMaterialStock     = materialStock.ToString();
                productMaterial.keyOldMaterialDescrible = describle.ToString();
                this.pmStockList.Add(productMaterial);
            }
        }
예제 #2
0
        private void Tool_materialClearDB_Click(object sender, EventArgs e)
        {
            if (this.radGridViewMaterial.Rows.Count < 1)
            {
                MessageBox.Show("没有可以清除的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (MessageBox.Show("确认要清除当前数据?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) != DialogResult.OK)
            {
                return;
            }
            //var delRow = serviceClient.DeleteMaterialBasicMsg(this.currentQueryCondition);
            List <MesService.MaterialResultInfo> materialResultInfoList = new List <MesService.MaterialResultInfo>();

            foreach (var rowInfo in this.radGridViewMaterial.Rows)
            {
                MesService.MaterialResultInfo materialResultInfo = new MesService.MaterialResultInfo();
                var ridCode      = rowInfo.Cells[3].Value.ToString();
                var materialCode = serviceClient.GetMaterialCode(ridCode);
                materialResultInfo.MaterialCode  = materialCode;
                materialResultInfo.ProductTypeNo = rowInfo.Cells[6].Value.ToString();
                materialResultInfo.PcbaSN        = rowInfo.Cells[7].Value.ToString();
                materialResultInfo.ProductSN     = rowInfo.Cells[8].Value.ToString();
                materialResultInfoList.Add(materialResultInfo);
            }
            var delRow = serviceClient.DeleteMaterialBasicHistory(materialResultInfoList.ToArray());

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