You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.1 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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($"母排信息保存失败");
}
}
}
}
}