using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Threading.Tasks; using YBDevice.Application; using YBDevice.Entity; namespace YBDevice.NWeb.Pages.Device { /// /// 设备编辑 /// public class EditModel : BaseModel { public YB_Device data = new YB_Device(); public List types = new List(); private IDeviceService _deviceService; public bool isedit = false;//是否可编辑,disabled不可编辑 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); } } } }