Example #1
0
 private void OnDel()
 {
     if (Request.QueryString["act"] == "d")
     {
         string ID        = Request.QueryString["id"];
         string returnMsg = bllModuleNode.ModuleNodeSet("DEL", "", ID);
         if (returnMsg == "-1")
         {
             Utils.RunJavaScript(this, "alert({msg:'栏目删除失败,可能该栏目存在子栏目,应先删除子栏目',title:'提示信息'})");
         }
     }
 }
 private void OnDel()
 {
     if (Request.QueryString["Action"] == "Del")
     {
         string ID = Request.QueryString["NodeID"];
         //判断权限
         if (IsHaveRightByOperCode("Delete"))
         {
             DataTable dt       = BllModuleNode.GetList("ONE", Utils.getOneParams(ID));
             string    nodeName = string.Empty;
             if (dt.Rows.Count > 0)
             {
                 nodeName = dt.Rows[0]["NodeName"].ToString().Replace("'", "\\'");
             }
             string returnMsg = BllModuleNode.ModuleNodeSet("DELONE", "", ID);
             try
             {
                 if (Convert.ToInt32(returnMsg) == -1)
                 {
                     Utils.RunJavaScript(this, "alert({msg:'该栏目包含子栏目,不能直接删除,请先删除其子栏目!',title:'提示信息'})");
                 }
                 else
                 {
                     WriteLog("删除" + nodeName + "节点成功!", "", 2);//写入操作日志
                 }
             }
             catch
             {
                 WriteLog("删除" + nodeName + "节点失败!", returnMsg, 2);//写入操作日志
                 Utils.RunJavaScript(this, "alert({msg:'" + returnMsg.Replace("'", "\\'").Replace("\r\n", "<br>") + "',title:'提示信息'})");
             }
         }
         else
         {
             Utils.RunJavaScript(this, "alert({msg:'你没有删除栏目的权限,请联系站点管理员!',title:'提示信息'})");
         }
     }
 }