69 lines
1.9 KiB
C#
69 lines
1.9 KiB
C#
|
|
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, "提示");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|