public ActionResult RemoveRelationship(RemoveRelationshipModel 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; long[] numArray = new long[] { model.pageid }; bool flag = shakeAroundService.SetRelationship(deviceApplyDataDeviceIdentifier, numArray, ShakeAroundBindType.解除关联关系); return(Json(new { success = flag })); }
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 })); }