public override void DeleteCmd() { DataTable reasonTable = OMWorkBench.DataAgent.GetStateChangeReason(currentAgentId, 0); FrozedAgentForm frozedAgent = new FrozedAgentForm(reasonTable); frozedAgent.Text = "删除"; if (frozedAgent.ShowDialog() == DialogResult.OK) { DataAgent dataAgent = DataAgentFactory.GetDataAgent(); dataAgent.ChangeAgentSatate(OMWorkBench.AgentId, Convert.ToInt32(AgentDGV.CurrentRow.Cells["id"].Value), frozedAgent.FrozedResonStr, 2); _childDS.Tables["organization"].Select("id=" + currentAgentId)[0]["current_state"] = 2; agentBDS.Filter += " and current_state<2"; AgentDGV.DataSource = agentBDS; } base.DeleteCmd(); }
public override void FrozedCmd() { if (mainToolStrip.Items["FrozedTSButton"].Text == "解冻") { OMWorkBench.DataAgent.ChangeAgentSatate(OMWorkBench.AgentId, currentAgentId, "解冻", 0); _childDS.Tables["organization"].Select("id=" + currentAgentId)[0]["current_state"] = 0; MessageBox.Show("已解冻!"); SetForFrozed(true); } else { DataTable reasonTable = OMWorkBench.DataAgent.GetStateChangeReason(currentAgentId, 0); FrozedAgentForm frozedAgent = new FrozedAgentForm(reasonTable); if (frozedAgent.ShowDialog() == DialogResult.OK) { DataAgent dataAgent = DataAgentFactory.GetDataAgent(); dataAgent.ChangeAgentSatate(OMWorkBench.AgentId, Convert.ToInt32(AgentDGV.CurrentRow.Cells["id"].Value), frozedAgent.FrozedResonStr, 1); _childDS.Tables["organization"].Select("id=" + currentAgentId)[0]["current_state"] = 1; SetForFrozed(false); } } }