예제 #1
0
        private static void OnParentInfoChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            OrgDetialWindow sender = d as OrgDetialWindow;

            if (sender.ParentOrgInfo != null && !string.IsNullOrEmpty(sender.ParentOrgInfo.OrgName))
            {
                sender.btnCreateOrgCode.IsEnabled = true;
            }
            else
            {
                sender.btnCreateOrgCode.IsEnabled = false;
            }
        }
        /// <summary>
        /// 添加微会员
        /// </summary>
        private void AddOrgExecute()
        {
            CurOrgInfo = new OrgInfo();
            CurOrgInfo.OrgID = Guid.NewGuid().ToString("n");
            CurOrgInfo.ParentOrgId = "";
            CurOrgInfo.CardType = CeritificateEnum.ID;


            window = new OrgDetialWindow()
                                         {
                                             POrgList = this.POrgList,
                                             DataContext = this,
                                             Owner = Application.Current.MainWindow,
                                             IsCanCreateOrgCode = true
                                         };
            window.ComitEvent += new Action(AddOrg);

            window.ShowDialog();
        }
        /// <summary>
        /// 微会员详细资料
        /// </summary>
        private void ShowOrgDetialExecute()
        {
            window = new OrgDetialWindow()
            {
                DataContext = this,
                ParentOrgInfo = POrgList.FirstOrDefault(p => p.OrgID == CurOrgInfo.ParentOrgId),
                Owner = Application.Current.MainWindow,
                IsCanCreateOrgCode = false
            };
            window.ComitEvent += new Action(ShowOrgDetial);
            window.CancelEvent += new Action(window_CancelEvent);
            window.ShowDialog();
            //else
            //{
            //    string id= CurOrgInfo.OrgID;
            //    GetOrgsListExecute();
            //    CurOrgInfo = OrgList.Where(p => p.OrgID == id).FirstOrDefault();
            //}

        }