|
|
|
@ -61,8 +61,8 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls
|
|
|
|
|
.WhereIf(model.Query.BuildingId.HasValue, o => o.IoTDevice.IoTGateway.BuildingId == model.Query.BuildingId.Value)
|
|
|
|
|
.WhereIf(model.Query.IoTGatewayId.HasValue, o => o.IoTDevice.IoTGatewayId == model.Query.IoTGatewayId.Value)
|
|
|
|
|
.WhereIf(model.Query.CategoryId.HasValue, o => o.IoTDevice.IoTProduct.IoTProductCategoryId == model.Query.CategoryId.Value)
|
|
|
|
|
.WhereIf(model.Query.ProductId.HasValue, o => o.IoTDevice.IoTProductId == model.Query.ProductId.Value)
|
|
|
|
|
.WhereIf(model.Query.DeviceId.HasValue, o => o.IoTDeviceId == model.Query.DeviceId.Value)
|
|
|
|
|
.WhereIf(model.Query.IoTProductId.HasValue, o => o.IoTDevice.IoTProductId == model.Query.IoTProductId.Value)
|
|
|
|
|
.WhereIf(model.Query.IoTDeviceId.HasValue, o => o.IoTDeviceId == model.Query.IoTDeviceId.Value)
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(model.Query.Name), o => o.Name.Contains(model.Query.Name))
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(model.Query.Key), o => o.Key.Contains(model.Query.Key))
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(model.Query.Value), o => o.Value.Contains(model.Query.Value))
|
|
|
|
@ -76,7 +76,7 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls
|
|
|
|
|
|
|
|
|
|
public override void EntityToModel(IoTData entity, EditPlatformIoTDataModel model)
|
|
|
|
|
{
|
|
|
|
|
model.ProductId = entity.IoTDevice?.IoTProductId;
|
|
|
|
|
model.IoTProductId = entity.IoTDevice?.IoTProductId;
|
|
|
|
|
model.CategoryId = entity.IoTDevice?.IoTProduct?.IoTProductCategoryId;
|
|
|
|
|
model.IoTGatewayId = entity.IoTDevice?.IoTGatewayId;
|
|
|
|
|
model.BuildingId = entity.IoTDevice?.IoTGateway?.BuildingId;
|
|
|
|
@ -105,9 +105,9 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls
|
|
|
|
|
.FirstOrDefault(o => o.Id == entity.IoTDevice.IoTGateway.Building.OrganId)?.GetDisplayName();
|
|
|
|
|
ViewData.Add(model.OrganId, name);
|
|
|
|
|
}
|
|
|
|
|
if (model.ProductId.HasValue)
|
|
|
|
|
if (model.IoTProductId.HasValue)
|
|
|
|
|
{
|
|
|
|
|
ViewData.Add(model.ProductId, entity.IoTDevice.IoTProduct.Name);
|
|
|
|
|
ViewData.Add(model.IoTProductId, entity.IoTDevice.IoTProduct.Name);
|
|
|
|
|
}
|
|
|
|
|
if (model.CategoryId.HasValue)
|
|
|
|
|
{
|
|
|
|
@ -119,9 +119,9 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls
|
|
|
|
|
.FirstOrDefault(o => o.Id == model.CategoryId.Value)?.GetDisplayName();
|
|
|
|
|
ViewData.Add(model.CategoryId, name);
|
|
|
|
|
}
|
|
|
|
|
if (model.DeviceId.HasValue)
|
|
|
|
|
if (model.IoTDeviceId.HasValue)
|
|
|
|
|
{
|
|
|
|
|
ViewData.Add(model.DeviceId, entity.IoTDevice.Name);
|
|
|
|
|
ViewData.Add(model.IoTDeviceId, entity.IoTDevice.Name);
|
|
|
|
|
}
|
|
|
|
|
if (model.IoTGatewayId.HasValue)
|
|
|
|
|
{
|
|
|
|
@ -134,9 +134,9 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls
|
|
|
|
|
ViewData.SelectList(o => model.OrganId, () => this._ajax.GetOrgan(model.OrganId).SelectList());
|
|
|
|
|
ViewData.SelectList(o => model.BuildingId, () => this._ajax.GetBuilding(model.OrganId.Value, model.BuildingId).SelectList(), model.OrganId.HasValue);
|
|
|
|
|
ViewData.SelectList(o => model.IoTGatewayId, () => this._ajax.GetIoTGatewayByBuilding(model.BuildingId.Value, model.IoTGatewayId).SelectList(), model.BuildingId.HasValue);
|
|
|
|
|
ViewData.SelectList(o => model.DeviceId, () => this._ajax.GetIoTDevice(model.IoTGatewayId.Value, model.DeviceId).SelectList(), model.IoTGatewayId.HasValue);
|
|
|
|
|
ViewData.SelectList(o => model.IoTDeviceId, () => this._ajax.GetIoTDevice(model.IoTGatewayId.Value, model.IoTDeviceId).SelectList(), model.IoTGatewayId.HasValue);
|
|
|
|
|
ViewData.SelectList(o => model.CategoryId, () => this._ajax.GetIoTProductCategory(model.CategoryId).SelectList());
|
|
|
|
|
ViewData.SelectList(o => model.ProductId, () => this._ajax.GetIoTProductByCategory(model.CategoryId.Value, model.ProductId).SelectList(), model.CategoryId.HasValue);
|
|
|
|
|
ViewData.SelectList(o => model.IoTProductId, () => this._ajax.GetIoTProductByCategory(model.CategoryId.Value, model.IoTProductId).SelectList(), model.CategoryId.HasValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string GetNodeNumber(EditPlatformIoTDataModel model)
|
|
|
|
|