using Microsoft.AspNetCore.Mvc.Rendering;
using Nirvana.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using YBDevice.Application;
using YBDevice.Entity;
namespace YBDevice.NWeb.Pages.Info
{
///
/// ×ÊѶ±à¼
///
public class EditModel : BaseModel
{
public SecInfoSubmitModel data = new SecInfoSubmitModel();
public List types = new List();
public List texttypes = new List();
public List offlist = new List();
private IInfoService _infoService;
private IOfficialService _officialService;
public List appidlist = new List();
public EditModel(IInfoService infoService,IOfficialService officialService)
{
_infoService = infoService;
_officialService = officialService;
}
public async Task OnGetAsync(Guid? id)
{
types = await _infoService.GetAllTypeAsync();
texttypes = EnumHelper.GetEnumDictionary().Select(x => new SelectListItem
{
Value = x.Key.ToString(),
Text = x.Value
}).ToList();
offlist = await _officialService.GetAllListAsync(2);
if (id.HasValue && id.Value !=Guid.Empty)
{
data = await _infoService.DetailAsync(id.Value);
appidlist = data.AppId.Split(',').ToList();
}
}
}
}