
///////////////////////////////////////////////////////////////////////////////  
//文件名称: WinInsuerEditor.xaml
//文件描述: 保险商添加修改
//创 建 者: xls
//创建日期: 2018/5/24 21:35:53
//版 本 号：1.0.0.0
////////////////////////////////////////////////////////////////////////////////

using System;
using System.Windows;
using Com.FirmLib.UI.Common;
using FWindSoft.Wpf;
using FWindSoft.Wpf.SystemTypeExtensions;

namespace Com.FirmLib.UI.Insuer
{
    /// <summary>
    /// WinInsuerEditor.xaml 的交互逻辑
    /// </summary>
    public partial class WinInsuerEditor : BaseWindow
    {
        private VmInsuerEditor m_Vm;
        public WinInsuerEditor():this(new VmInsuerEditor())
        {
            InitializeComponent();
        }
        public WinInsuerEditor(VmInsuerEditor vm)
        {
            InitializeComponent();
            this.m_Vm = vm;
            this.m_Vm.SetRefView(this);
            this.m_Vm.WatchValidateResult(() => !this.HasError());
            this.DataContext = this.m_Vm;
        }
        #region 界面关联事件
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                bg.UpdateSourceForEach();
                if (this.HasError())
                {
                    //MessageShow.Infomation("请修改错误输入项");
                    return;
                }

            }
            catch (Exception ex)
            {
                //MessageShow.Show(ex);
            }
        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }
        #endregion

        /// <summary>
        /// 是否管理
        /// </summary>

        public bool IsManage { get { return this.m_Vm.IsManage; } }
        /// <summary>
        /// 保险商Id
        /// </summary>

        public string NewId { get { return this.m_Vm.Id; } }
    }
}
