public JsonResult AddEle([System.Web.Http.FromBody] iot_elebox model)
        {
            if (util.IsExist(2, model.Uid))
            {
                return(Json(new { status = StatusCode.FAIL, meassage = "该强电箱已被添加,请勿重复添加" }));
            }
            iot_elebox ele      = new iot_elebox();
            var        taskinfo = new { status = StatusCode.SUCCESS, message = "添加成功" };
            //判断是否在空值表中存在该类型的position  如果有就将该position值赋给该模型 并且在空值表中删除该条目
            int position = util.GetGateWayPositon(2, model.GateWayId);

            if (position > 7)
            {
                return(Json(new { status = StatusCode.FAIL, message = "强电箱负载达到最大值" }));
            }
            ele.Position   = position;
            ele.Name       = model.Name;
            ele.Uid        = model.Uid;
            ele.GateWayId  = model.GateWayId;
            ele.CreateTime = new DateTime().Date;

            db.iot_elebox.Add(ele);


            int uprows = db.SaveChanges();

            if (uprows < 1)
            {
                taskinfo = new { status = StatusCode.FAIL, message = "添加失败" };
            }

            return(Json(taskinfo, JsonRequestBehavior.DenyGet));
        }