Esempio n. 1
0
        async private void Menu_del_Click(object sender, EventArgs e)
        {
            //删除当前行
            var stationName = this.radGridView1.CurrentRow.Cells[1].Value.ToString();

            if (string.IsNullOrEmpty(stationName))
            {
                this.radGridView1.CurrentRow.Delete();
            }
            else
            {
                if (MessageBox.Show($"确认要删除【{stationName}】工站?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.OK)
                {
                    int row = await serviceClient.DeleteStationAsync(cb_processItem.Text.Trim(), stationName);

                    if (row > 0)
                    {
                        //查询删除成功
                        SelectStationList(this.currentSelectProcess);
                    }
                    else
                    {
                        //查询删除失败
                        this.radGridView1.CurrentRow.Delete();
                    }
                    //tool_status.Text = "【型号】删除1行记录 【删除】完成";
                }
            }
        }