コード例 #1
0
        // 删除节点配置信息
        public ActionResult Delete(string Mac)
        {
            ADevice device = new ADevice();
            var     rs     = device.select(Mac);

            if (rs != null)
            {
                device.delete(Mac);
                if (device.select(Mac) == null)
                {
                    return(Content(JsonConvert.SerializeObject(new
                    {
                        code = 1,
                        des = "删除成功",
                    })));
                }
                else
                {
                    return(Content(JsonConvert.SerializeObject(new
                    {
                        code = 0,
                        des = "删除失败",
                    })));
                }
            }
            else
            {
                return(Content(JsonConvert.SerializeObject(new
                {
                    code = -1,
                    des = "不存在此节点",
                })));
            }
        }