コード例 #1
0
        async private void Menu_del_Click(object sender, EventArgs e)
        {
            //删除当前行
            var typeNo = this.radGridView1.CurrentRow.Cells[1].Value.ToString();

            if (string.IsNullOrEmpty(typeNo))
            {
                this.radGridView1.CurrentRow.Delete();
            }
            else
            {
                if (MessageBox.Show($"确认要删除产品【{typeNo}】?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.OK)
                {
                    int row = await serviceClient.DeleteProductContinairCapacityAsync(typeNo);

                    LogHelper.Log.Info($"【删除产品】产品名称={typeNo}影响行数={row} 操作用户={MESMainForm.currentUser}");
                    if (row > 0)
                    {
                        //删除产品后,同时将工艺删除
                        row = await serviceClient.DeleteProcessAsync(typeNo);

                        LogHelper.Log.Info($"【删除工艺】工艺名称={typeNo}影响行数={row} 操作用户={MESMainForm.currentUser}");
                        //删除产品和工艺后,删除对应配置
                        if (row > 0)
                        {
                            InitStandConfig.QueryCurrentStandProductDirectory("");//查询并删除当前工艺配置文件
                        }
                        RefreshData();
                    }
                }
            }
        }
コード例 #2
0
 async private void DeleteProduceData()
 {
     //cut 执行delete 服务数据
     if (MessageBox.Show("是否删除该行数据", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
     {
         int del = await mesService.DeleteProductContinairCapacityAsync(curRowStationName);
     }
     SelectServiceData("");
 }