20230201_145_upperpc/InSituLaboratory/ViewModels/Pages/SequentialDistributionViewModel.cs
2024-03-27 21:49:16 +08:00

69 lines
1.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using InSituLaboratory.Entities;
using InSituLaboratory.Models;
using Prism.Regions;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace InSituLaboratory.ViewModels.Pages
{
public class SequentialDistributionViewModel : ViewModelBase
{
IDialogService _dialogService;
public SequentialDistributionViewModel(IRegionManager regionManager, IDialogService dialogService) : base(regionManager)
{
this.PageTitle = "时序下发";
_dialogService = dialogService;
Refresh();
}
/// <summary>
/// 编辑或者新增
/// </summary>
/// <param name="model"></param>
public override void DoModify(object model)
{
DialogParameters ps = new DialogParameters();
ps.Add("model", model);
_dialogService.ShowDialog("ModifySequentialView", ps, result =>
{
// 判断子窗口的返回状态如果OK刷新当前页面否则不管
if (result.Result == ButtonResult.OK)
{
this.Refresh();
}
});
}
/// <summary>
/// 删除
/// </summary>
/// <param name="model"></param>
public override void DoDelete(object model)
{
try
{
if (MessageBox.Show("是否确定删除此项?", "提示", MessageBoxButton.YesNo) ==
MessageBoxResult.Yes)
{
// 物理删除
MessageBox.Show("删除完成!", "提示");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "提示");
}
}
}
}