Exemple #1
0
        public ContentResult Pub_API()
        {
            string action = RequestEx["action"];
            string ids    = RequestEx["ids"];

            switch (action)
            {
            case "del":
            {
                pubBll.DelByIDS(ids);
            }
            break;

            case "copy":
            {
                int id = DataConvert.CLng(ids);
                if (id < 1)
                {
                    return(Content(Failed.ToString()));
                }
                M_Pub pubMod = pubBll.SelReturnModel(id);
                pubMod.Pubid         = 0;
                pubMod.PubCreateTime = DateTime.Now;
                pubMod.PubName       = pubMod.PubName + "_copy";
                pubBll.insert(pubMod);
            }
            break;

            case "modelname":    //模型名ajax检测
            {
                string name   = DataConverter.CStr(Request.Form["value"]);
                string result = DBHelper.Table_IsExist(B_Pub.PREFIX + name).ToString().ToLower();
                return(Content(result));
                //return "<font color=blue>数据表已存在! 可重复使用!</font>";
                //return "<font color=green>数据表不存在,系统将自动创建!</font>";
            }

            case "recover":
            {
                pubBll.RecyleByIDS(ids, 1);
            }
            break;
            }
            return(Content(Success.ToString()));
        }
Exemple #2
0
        //批量还原
        protected void Recyle_Btn_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.Form["idchk"]))
            {
                if (pubBll.RecyleByIDS(Request.Form["icdhk"]))
                {
                    Response.Write("<script language=javascript>alert('" + Resources.L.还原成功 + "!');location.href='PubRecycler.aspx'</script>");
                }
                else
                {
                    Response.Write("<script language=javascript>alert('" + Resources.L.还原失败 + "!');location.href='PubRecycler.aspx'</script>");
                }
            }
            else
            {
                function.Script(this, "alert('" + Resources.L.还原失败 + "!')");
            }

            DataBind();
        }