2021-12-12 06:55:48 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using WalkingTec.Mvvm.Core;
|
|
|
|
|
using WalkingTec.Mvvm.Core.Extensions;
|
|
|
|
|
using IoTGateway.Model;
|
|
|
|
|
using Plugin;
|
|
|
|
|
|
|
|
|
|
namespace IoTGateway.ViewModel.BasicData.DriverVMs
|
|
|
|
|
{
|
|
|
|
|
public partial class DriverVM : BaseCRUDVM<Driver>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public DriverVM()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void InitVM()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void DoAdd()
|
|
|
|
|
{
|
2022-03-24 13:38:11 +00:00
|
|
|
|
var DriverService = Wtm.ServiceProvider.GetService(typeof(DriverService)) as DriverService;
|
|
|
|
|
Entity.AssembleName = DriverService.GetAssembleNameByFileName(Entity.FileName);
|
2021-12-12 06:55:48 +00:00
|
|
|
|
if (string.IsNullOrEmpty(Entity.AssembleName))
|
|
|
|
|
{
|
|
|
|
|
MSD.AddModelError("", "程序集获取失败");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
base.DoAdd();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void DoEdit(bool updateAllFields = false)
|
|
|
|
|
{
|
2024-06-02 08:12:03 +00:00
|
|
|
|
var DriverService = Wtm.ServiceProvider.GetService(typeof(DriverService)) as DriverService;
|
|
|
|
|
Entity.AssembleName = DriverService.GetAssembleNameByFileName(Entity.FileName);
|
|
|
|
|
if (string.IsNullOrEmpty(Entity.AssembleName))
|
|
|
|
|
{
|
|
|
|
|
MSD.AddModelError("", "程序集获取失败");
|
|
|
|
|
return;
|
|
|
|
|
}
|
2021-12-12 06:55:48 +00:00
|
|
|
|
base.DoEdit(updateAllFields);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void DoDelete()
|
|
|
|
|
{
|
|
|
|
|
base.DoDelete();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|