|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
using SlnMesnac.Repository;
|
|
|
using SlnMesnac.Repository.service;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
using System.Windows;
|
|
|
|
|
|
#region << 版 本 注 释 >>
|
|
|
/*--------------------------------------------------------------------
|
|
|
* 版权所有 (c) 2024 WenJY 保留所有权利。
|
|
|
* CLR版本:4.0.30319.42000
|
|
|
* 机器名称:T14-GEN3-7895
|
|
|
* 命名空间:SlnMesnac.WPF.ViewModel
|
|
|
* 唯一标识:19c3035d-e7c3-4b5f-9b09-9623877c8063
|
|
|
*
|
|
|
* 创建者:WenJY
|
|
|
* 电子邮箱:
|
|
|
* 创建时间:2024-11-08 16:26:01
|
|
|
* 版本:V1.0.0
|
|
|
* 描述:
|
|
|
*
|
|
|
*--------------------------------------------------------------------
|
|
|
* 修改人:
|
|
|
* 时间:
|
|
|
* 修改说明:
|
|
|
*
|
|
|
* 版本:V1.0.0
|
|
|
*--------------------------------------------------------------------*/
|
|
|
#endregion << 版 本 注 释 >>
|
|
|
namespace SlnMesnac.WPF.ViewModel
|
|
|
{
|
|
|
public partial class BusbarUpdateViewModel : ObservableObject
|
|
|
{
|
|
|
private readonly Ibase_busbar_infoServices _ibase_busbar_infoServices;
|
|
|
|
|
|
public Action CloseAction { get; set; }
|
|
|
|
|
|
public BusbarUpdateViewModel(base_busbar_info busbar_Info)
|
|
|
{
|
|
|
BusbarInfo = busbar_Info;
|
|
|
_ibase_busbar_infoServices = App.ServiceProvider.GetService<Ibase_busbar_infoServices>();
|
|
|
}
|
|
|
public base_busbar_info _busbar_Info = null;
|
|
|
public base_busbar_info BusbarInfo
|
|
|
{
|
|
|
get => _busbar_Info;
|
|
|
set => SetProperty(ref _busbar_Info, value);
|
|
|
}
|
|
|
|
|
|
[RelayCommand]
|
|
|
private void SaveBusbarInfo()
|
|
|
{
|
|
|
if (_busbar_Info != null)
|
|
|
{
|
|
|
if (_ibase_busbar_infoServices.Update(_busbar_Info))
|
|
|
{
|
|
|
MessageBox.Show($"母排信息保存成功");
|
|
|
|
|
|
CloseAction?.Invoke();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
MessageBox.Show($"母排信息保存失败");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|