using DevExpress.Mvvm.Native;
|
using DevExpress.Utils.Extensions;
|
|
namespace HStation.WinFrmUI.Basic
|
{
|
public partial class UpdateCatalogParentDlg : DevExpress.XtraEditors.XtraForm
|
{
|
public UpdateCatalogParentDlg()
|
{
|
InitializeComponent();
|
}
|
|
public async void SetBindingData(long TypeId, long vmId, long currentParentId)
|
{
|
var alllist = await new Yw.BLL.SysCatalog().GetByTypeID(TypeId);
|
alllist.Remove(alllist.Find(x => x.ID == vmId));
|
treeListLookUpEdit1TreeList.DataSource = alllist;
|
this.ComboBoxEditParentsChoice.EditValue = currentParentId;
|
}
|
|
public event Func<long, Task<bool>> ReloadEvent;
|
|
//完成
|
private async void BtnOk_Click(object sender, EventArgs e)
|
{
|
if (ComboBoxEditParentsChoice.EditValue == null)
|
{
|
TipFormHelper.ShowWarn("请选择正确的父级!");
|
return;
|
}
|
if (long.TryParse(ComboBoxEditParentsChoice.EditValue.ToString(), out long ParentId))
|
{
|
if (await ReloadEvent.Invoke(ParentId))
|
{
|
MessageBoxHelper.ShowSuccess("修改成功!");
|
}
|
else
|
{
|
MessageBoxHelper.ShowError("修改失败!");
|
}
|
this.DialogResult = DialogResult.OK;
|
this.Close();
|
}
|
}
|
|
private void simpleLabelItemDelete_Click(object sender, EventArgs e)
|
{
|
this.ComboBoxEditParentsChoice.EditValue = null;
|
}
|
}
|
}
|