/// <summary>
        /// 删除指定id 的强电箱 每个网关只能挂上八个强电箱
        /// </summary>
        /// <param name="id">强电箱的id值</param>
        /// <returns></returns>
        public JsonResult DelEle(int id)
        {
            var data = db.iot_elebox.Find(id);

            //判断是否删除的position是否是最后一个
            try
            {
                util.IsMaxPosition(2, data.Position, data.GateWayId);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }


            //删除该强电箱
            db.iot_elebox.Remove(data);

            var taskinfo = new { status = StatusCode.SUCCESS, message = "删除成功" };
            int uprows   = db.SaveChanges();

            if (uprows < 1)
            {
                taskinfo = new { status = StatusCode.FAIL, message = "删除失败,请检查是否存在该强电箱" };
            }
            return(Json(taskinfo, JsonRequestBehavior.AllowGet));
        }