示例#1
0
        public ActionResult BindRelationship(BindRelationshipModel model)
        {
            var devModel = this._iShakeAroundService.GetDeviceById(model.id);
            DeviceApply_Data_Device_Identifiers identifiers = new DeviceApply_Data_Device_Identifiers();

            identifiers.device_id = long.Parse(devModel.device_id);
            identifiers.major     = long.Parse(devModel.major);
            identifiers.uuid      = devModel.uuid;
            identifiers.minor     = long.Parse(devModel.minor);
            bool result = this._iShakeAroundService.SetRelationship(identifiers, model.pageids.Split(',').Select(p => long.Parse(p)).ToArray(), Senparc.Weixin.MP.ShakeAroundBindType.建立关联关系);

            return(Json(new
            {
                success = result
            }));
        }
        public ActionResult BindRelationship(BindRelationshipModel model)
        {
            DeviceModel deviceById = _saService.GetDeviceById(model.id);
            DeviceApply_Data_Device_Identifiers deviceApplyDataDeviceIdentifier = new DeviceApply_Data_Device_Identifiers()
            {
                device_id = long.Parse(deviceById.device_id),
                major     = long.Parse(deviceById.major),
                uuid      = deviceById.uuid,
                minor     = long.Parse(deviceById.minor)
            };
            IShakeAroundService shakeAroundService = _saService;
            DeviceApply_Data_Device_Identifiers deviceApplyDataDeviceIdentifier1 = deviceApplyDataDeviceIdentifier;
            string str = model.pageids;

            char[] chrArray = new char[] { ',' };
            bool   flag     = shakeAroundService.SetRelationship(deviceApplyDataDeviceIdentifier1, (
                                                                     from p in str.Split(chrArray)
                                                                     select long.Parse(p)).ToArray(), ShakeAroundBindType.建立关联关系);

            return(Json(new { success = flag }));
        }