
///////////////////////////////////////////////////////////////////////////////  
//文件名称: WinSellerEditor.xaml
//文件描述: 供应商编辑
//创 建 者: xls
//创建日期: 2018/5/24 21:20:17
//版 本 号：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.Seller
{
    /// <summary>
    /// WinSellerEditor.xaml 的交互逻辑
    /// </summary>
    public partial class WinSellerEditor : BaseWindow
    {
        private VmSellerEditor m_Vm;
        public WinSellerEditor():this(new VmSellerEditor())
        {
        }
        public WinSellerEditor(VmSellerEditor 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 SellerId { get { return this.m_Vm.Id; } }
    }
}
