示例#1
0
        private void cmsDelete_Click(object sender, EventArgs e)
        {
            try
            {
                TreeNode tn     = treeMenu.SelectedNode;
                string   A_Code = "";
                string   A_Name = "";

                if (tn == null || tn.Tag.ToString() == "00")
                {
                    return;
                }
                else
                {
                    if (tn.Nodes.Count > 0)
                    {
                        untCommon.InfoMsg("请先删除子区域!");
                        return;
                    }
                    A_Name = tn.Text.ToString();
                    A_Code = tn.Tag.ToString();
                }

                if (untCommon.QuestionMsg("您确定删除 " + A_Name + " 该项吗?"))
                {
                    AreaBLL areabll = new AreaBLL();
                    if (areabll.Del(A_Code) > 0)
                    {
                        loadArea();
                        untCommon.InfoMsg("删除成功!");
                    }
                    else
                    {
                        untCommon.InfoMsg("修改失败!");
                    }
                }
            }
            catch (Exception ex)
            {
                untCommon.InfoMsg("区域管理删除数据异常:" + ex.Message);
            }
        }