| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
-
- ///////////////////////////////////////////////////////////////////////////////
- //文件名称: WinMaintainerInfo.xaml
- //文件描述: 维修商信息
- //创 建 者: xls
- //创建日期: 2018/5/24 22:07:12
- //版 本 号:1.0.0.0
- ////////////////////////////////////////////////////////////////////////////////
- using System;
- using System.Windows;
- using System.Windows.Input;
- using Com.FirmLib.UI.BllCommon;
- using FWindSoft.Wpf;
- using FWindSoft.Wpf.Controls;
- namespace Com.FirmLib.UI.Maintainer
- {
- /// <summary>
- /// WinMaintainerInfo.xaml 的交互逻辑
- /// </summary>
- public partial class WinMaintainerInfo : NChildWindow
- {
- private VmMaintainerInfo m_Vm;
- public WinMaintainerInfo():this(new VmMaintainerInfo())
- {
- InitializeComponent();
-
- }
- public WinMaintainerInfo(VmMaintainerInfo vm)
- {
- InitializeComponent();
- EveryTimeLoad = true;
- this.m_Vm = vm;
- this.m_Vm.SetRefView(this);
- this.DataContext = this.m_Vm;
- this.CommandBindings.Add(new CommandBinding(EditCommands.SingleUpdate, SingleUpdate));
- }
- protected override void LoadData(LoadParameter parameter)
- {
- //初始化列表数据
- m_Vm.Init(parameter);
- //加载醒目信息
- this.Title = this.m_Vm.Name;
- }
- #region 界面关联事件
- private void btnOK_Click(object sender, RoutedEventArgs e)
- {
- try
- {
- if (this.HasError())
- {
- //MessageShow.Infomation("请修改错误输入项");
- return;
- }
- //if (Execute())
- //{
- // MessageShow.Infomation("");
- // DialogResult = true;
- //}
- }
- catch (Exception ex)
- {
- //MessageShow.Show(ex);
- }
- }
- private void btnCancel_Click(object sender, RoutedEventArgs e)
- {
- Close();
- }
- #endregion
- #region 命令绑定相关
- void SingleUpdate(object sender, ExecutedRoutedEventArgs e)
- {
- TextBoxEditor editor = e.Parameter as TextBoxEditor;
- if (editor == null)
- return;
- string field = string.Empty;
- if (editor.Tag != null)
- {
- field = editor.Tag.ToString();
- }
- bool result = this.m_Vm.SingleUpdateVenderItem(field);
- if (!result)
- {
- //editor.Focus();
- editor.IsEditing = true;
- }
- }
- #endregion
- }
- }
|