37 lines
1.0 KiB
C#
37 lines
1.0 KiB
C#
|
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Threading.Tasks;
|
|||
|
|
using YBDevice.Application;
|
|||
|
|
using YBDevice.Entity;
|
|||
|
|
|
|||
|
|
namespace YBDevice.NWeb.Pages.Device
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>豸<EFBFBD>༭
|
|||
|
|
/// </summary>
|
|||
|
|
public class EditModel : BaseModel
|
|||
|
|
{
|
|||
|
|
public YB_Device data = new YB_Device();
|
|||
|
|
public List<YB_DeviceType> types = new List<YB_DeviceType>();
|
|||
|
|
private IDeviceService _deviceService;
|
|||
|
|
public bool isedit = false;//<2F>Ƿ<EFBFBD><C7B7>ɱ༭,disabled<65><64><EFBFBD>ɱ༭
|
|||
|
|
public EditModel(IDeviceService deviceService)
|
|||
|
|
{
|
|||
|
|
_deviceService = deviceService;
|
|||
|
|
}
|
|||
|
|
public async Task OnGetAsync(int id=0)
|
|||
|
|
{
|
|||
|
|
var BaseUser = BaseInfoService.GetUserInfo();
|
|||
|
|
if (BaseUser.AccountType != AccountType.platform)
|
|||
|
|
{
|
|||
|
|
isedit = true;
|
|||
|
|
}
|
|||
|
|
types = await _deviceService.GetTypeListAsync();
|
|||
|
|
if (id > 0)
|
|||
|
|
{
|
|||
|
|
data = await _deviceService.DetailAsync(id);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|