Пример #1
0
        public void Add()
        {
            SelectedForm sf = new SelectedForm();

            sf.SelectedDataManager = this.SelectedDataManager;
            sf.SelectedItems       = this.ExtensionalOrderDetailFBEntityList.ToList();
            bool isBigger5 = false;

            sf.SelectedCompleted += (o, e) =>
            {
                sf.SelectedItems.ForEach(item =>
                {
                    if (ExtensionalOrderDetailFBEntityList.Count >= 5)
                    {
                        isBigger5 = true;
                        return;
                    }
                    item.FBEntityState = FBEntityState.Added;
                    (item.Entity as T_FB_EXTENSIONORDERDETAIL).T_FB_EXTENSIONALORDER = this.ExtensionalOrderFBEntity.Entity as T_FB_EXTENSIONALORDER;
                    this.ExtensionalOrderDetailFBEntityList.Add(item);
                });
                AGrid.ItemsSource = this.ExtensionalOrderDetailFBEntityList;

                if (isBigger5)
                {
                    MessageWindow.Show <string>("提示", "报销明细项不能超过5条!", MessageIcon.Information,
                                                null, "Default", Localization.GetString("OKBUTTON"));
                }
            };

            sf.Show();
            SelectForm = sf;
        }
Пример #2
0
        public void Add()
        {
            SelectedForm sf = new SelectedForm();
            sf.SelectedDataManager = this.SelectedDataManager;
            sf.SelectedItems = this.ExtensionalOrderDetailFBEntityList.ToList();
            bool isBigger5 = false;
            sf.SelectedCompleted += (o, e) =>
            {
                
                sf.SelectedItems.ForEach(item =>
                {
                    if (ExtensionalOrderDetailFBEntityList.Count >= 5)
                    {
                        isBigger5 = true;
                        return;
                    }
                    item.FBEntityState = FBEntityState.Added;
                    (item.Entity as T_FB_EXTENSIONORDERDETAIL).T_FB_EXTENSIONALORDER = this.ExtensionalOrderFBEntity.Entity as T_FB_EXTENSIONALORDER;
                    this.ExtensionalOrderDetailFBEntityList.Add(item);
                });
                AGrid.ItemsSource = this.ExtensionalOrderDetailFBEntityList;

                if (isBigger5)
                {
                    MessageWindow.Show<string>("提示", "报销明细项不能超过5条!", MessageIcon.Information,
                    null, "Default", Localization.GetString("OKBUTTON"));
                }

            };

            sf.Show();
            SelectForm = sf;

           
        }