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();
}
///
/// 编辑或者新增
///
///
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();
}
});
}
///
/// 删除
///
///
public override void DoDelete(object model)
{
try
{
if (MessageBox.Show("是否确定删除此项?", "提示", MessageBoxButton.YesNo) ==
MessageBoxResult.Yes)
{
// 物理删除
MessageBox.Show("删除完成!", "提示");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "提示");
}
}
}
}