Пример #1
0
        private void btnBatchRemove_Click(object sender, RoutedEventArgs e)
        {
            List <TopItemVM> list = GetSelectedSysNoList();

            if (list.Count > 0)
            {
                TopItemInfo entity = new TopItemInfo();
                entity.WebChannel = new BizEntity.Common.WebChannel()
                {
                    ChannelID = viewModel.ChannelID
                };
                entity.CategoryType = ucPosition.PageType;
                List <TopItemInfo> entityList = new List <TopItemInfo>();
                list.ForEach(item =>
                {
                    var newEntity           = entity.DeepCopy <TopItemInfo>();
                    newEntity.ProductSysNo  = item.ProductSysNo;
                    newEntity.CategorySysNo = CategorySysNo;
                    newEntity.CategoryType  = CategoryType;
                    entity.IsExtend         = chkIsExtend.IsChecked;
                    entityList.Add(newEntity);
                });
                facade.CancleTopItem(entityList, (obj, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }
                    DataGrid.Bind();
                });
            }
        }
Пример #2
0
        private static void UpdateItemsSource(DataGrid dataGrid)
        {
            IEnumerable view       = null;
            var         rowsSource = (IEnumerable <IEnumerable>)dataGrid.GetRowsSource();

            if (rowsSource != null)
            {
                view = new Lists2DView(rowsSource);
            }

            var colsSource = (IEnumerable <IEnumerable>)dataGrid.GetColumnsSource();

            if (colsSource != null)
            {
                view = new Lists2DTransposedView(colsSource);
            }

            var transposedSource = dataGrid.GetTransposedSource();

            if (transposedSource != null)
            {
                view = new TransposedItemsSource(transposedSource);
            }

            dataGrid.Bind(ItemsControl.ItemsSourceProperty)
            .OneWayTo(view)
            .IgnoreReturnValue();
            dataGrid.RaiseEvent(new RoutedEventArgs(Events.ColumnsChangedEvent));
        }
Пример #3
0
        /// <summary>
        /// 强制失效
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        //private void btnInvalid_Click(object sender, RoutedEventArgs e)
        //{
        //    List<GiftCardInfo> items= new List<GiftCardInfo>();
        //    gridVM.ForEach(item =>
        //    {
        //        if (item.IsChecked == true)
        //            items.Add(item.ConvertVM<GiftCardVM, GiftCardInfo>());
        //    });

        //    if (items.Count > 0)
        //        facade.BatchSetGiftCardInvalid(items, (obj, args) =>
        //        {
        //            args.FaultsHandle();
        //            DataGrid.Bind();
        //        });
        //    else
        //        Window.Alert(ResGiftCardInfo.Information_MoreThanOneRecord, MessageType.Error);
        //}

        private void btnBatchActivatek_Click(object sender, RoutedEventArgs e)
        {
            List <int> sysNoList = new List <int>();

            gridVM.ForEach(item =>
            {
                if (item.IsChecked == true)
                {
                    sysNoList.Add(item.SysNo.Value);
                }
            });

            if (sysNoList.Count > 0)
            {
                facade.BatchActivateGiftCard(sysNoList, (msg) =>
                {
                    Window.Alert("提示", msg, MessageType.Information, (obj, args) =>
                    {
                        DataGrid.Bind();
                    });
                });
            }
            else
            {
                Window.Alert(ResGiftCardInfo.Information_MoreThanOneRecord, MessageType.Error);
            }
        }
Пример #4
0
 private void ButtonSearch_Click(object sender, RoutedEventArgs e)
 {
     if (ValidationManager.Validate(this.Grid))
     {
         this.DataGrid.QueryCriteria = Newegg.Oversea.Silverlight.Utilities.UtilityHelper.DeepClone <CountdownQueryFilterVM>(this._ViewModel);
         DataGrid.Bind();
     }
 }
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            if (CheckQueryCondition())
            {
                m_selectItemIds = new List <int>();
                SetSelectCountText();

                DataGrid.Bind();
            }
        }
Пример #6
0
 private void Button_Search_Click(object sender, RoutedEventArgs e)
 {
     if (ValidationManager.Validate(this.SeachBuilder))
     {
         filter   = model.ConvertVM <GiftCardVM, ECCentral.QueryFilter.IM.GiftCardFilter>();
         filterVM = Newegg.Oversea.Silverlight.Utilities.UtilityHelper.DeepClone <ECCentral.QueryFilter.IM.GiftCardFilter>(filter);
         DataGrid.QueryCriteria = this.filter;
         DataGrid.Bind();
     }
 }
Пример #7
0
        private void HyperlinkButtonEdit_Click(object sender, RoutedEventArgs e)
        {
            FloorVM         vm = DataGrid.SelectedItem as FloorVM;
            UCFloorMaintain uc = new UCFloorMaintain(vm);

            uc.Dialog = CurrentPage.Context.Window.ShowDialog(MKT.Resources.ResFloor.Title_Floor_Maintain,
                                                              uc, (s, args) =>
            {
                DataGrid.Bind();
            });
        }
Пример #8
0
 public override void OnPageLoad(object sender, EventArgs e)
 {
     base.OnPageLoad(sender, e);
     facade = new FloorFacade(this);
     facade.GetTemplate((s, args) =>
     {
         Templates = args.Result;
         cbPageCodes.ItemsSource   = EnumConverter.GetKeyValuePairs <PageCodeType>(EnumConverter.EnumAppendItemType.All);
         cbPageCodes.SelectedIndex = 0;
         DataGrid.Bind();
     });
 }
        private void btnNew_Click(object sender, RoutedEventArgs e)
        {
            UCGiftCardFabricationMaintain ucMaintain = new UCGiftCardFabricationMaintain();

            // this.Window.ShowDialog("新建礼品卡制作单", ucMaintain);
            ucMaintain.Dialog = Window.ShowDialog(ResGiftCardInfo.Title_NewGiftCard, ucMaintain, (obj, args) =>
            {
                filter   = model.ConvertVM <GiftCardFabricationVM, ECCentral.QueryFilter.IM.GiftCardFabricationFilter>();
                filterVM = Newegg.Oversea.Silverlight.Utilities.UtilityHelper.DeepClone <ECCentral.QueryFilter.IM.GiftCardFabricationFilter>(filter);
                DataGrid.QueryCriteria = this.filter;
                DataGrid.Bind();
            });
        }
Пример #10
0
        private void hlEdit_Click(object sender, RoutedEventArgs e)
        {
            GiftCardVM            item     = this.DataGrid.SelectedItem as GiftCardVM;
            UCGiftCardUsageDetail ucDetail = new UCGiftCardUsageDetail();

            ucDetail.VM     = gridVM.SingleOrDefault(a => a.SysNo.Value == item.SysNo);
            ucDetail.Dialog = this.Window.ShowDialog(ResGiftCardInfo.Information_GiftCardInformation, ucDetail, (obj, args) =>
            {
                if (args.DialogResult == Newegg.Oversea.Silverlight.Controls.Components.DialogResultType.OK)
                {
                    DataGrid.Bind();
                }
            });
        }
Пример #11
0
        private void ButtonCreate_Click(object sender, RoutedEventArgs e)
        {
            FloorVM v = new FloorVM();

            v.Templates     = Templates;
            v.TemplateSysNo = Templates[0].TemplateSysNo.Value;
            UCFloorMaintain uc = new UCFloorMaintain(v);

            uc.Dialog = CurrentPage.Context.Window.ShowDialog(MKT.Resources.ResFloor.Title_Floor_New,
                                                              uc, (ss, argss) =>
            {
                DataGrid.Bind();
            });
        }
Пример #12
0
        public override void OnPageLoad(object sender, EventArgs e)
        {
            base.OnPageLoad(sender, e);

            facade = new FloorFacade(this);
            facade.GetTemplate((s, args) =>
            {
                Templates = args.Result;
            });

            facade.QueryPageID(((int)PageCodeType.Promotion).ToString(), CPApplication.Current.CompanyCode, (s, args) =>
            {
                args.Result.Insert(0, new KeyValuePair <string, string>(string.Empty, ResCommonEnum.Enum_All));
                cbPageID.ItemsSource   = args.Result;
                cbPageID.SelectedValue = string.IsNullOrEmpty(this.Request.Param) || args.Result.FirstOrDefault(t => t.Key == this.Request.Param).Key == null? string.Empty : this.Request.Param;
                DataGrid.Bind();
            });
        }
Пример #13
0
        void Grid_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key != Key.Enter)
            {
                return;
            }
            var textBox = e.OriginalSource as TextBox;

            if (textBox != null)
            {
                var txtBinding = textBox.GetBindingExpression(TextBox.TextProperty);
                if (txtBinding != null)
                {
                    txtBinding.UpdateSource();
                    DataGrid.Bind();
                    e.Handled = true;
                }
            }
        }
Пример #14
0
        private void ButtonSearch_Click(object sender, RoutedEventArgs e)
        {
            SetQueryFilter();

            if (filter.PageType == null)
            {
                Window.Alert("请选择页面类型。");
                return;
            }

            if (filter.RefSysNo == null)
            {
                Window.Alert("请选择类别。");
                return;
            }
            CategorySysNo = ucPosition.PageID;
            CategoryType  = ucPosition.PageType;
            DataGrid.Bind();
        }
Пример #15
0
        private static void UpdateItemsSource(DataGrid dataGrid)
        {
            IEnumerable view = null;

            if (dataGrid.GetRowsSource() is IEnumerable <IEnumerable> rowsSource)
            {
                view = new Lists2DView(rowsSource);
            }
            else if (dataGrid.GetColumnsSource() is IEnumerable <IEnumerable> colsSource)
            {
                view = new Lists2DTransposedView(colsSource);
            }
            else if (dataGrid.GetTransposedSource() is IEnumerable transposedSource)
            {
                view = new TransposedItemsSource(transposedSource);
            }

            _ = dataGrid.Bind(ItemsControl.ItemsSourceProperty)
                .OneWayTo(view);
            dataGrid.RaiseEvent(new RoutedEventArgs(Events.ColumnsChangedEvent));
        }
Пример #16
0
 private void HyperlinkButtonDelete_Click(object sender, RoutedEventArgs e)
 {
     Window.Confirm(ResFloor.Info_Confirm_Delete, (s, args) =>
     {
         if (args.DialogResult == DialogResultType.OK)
         {
             var sysNo = (DataGrid.SelectedItem as FloorVM).SysNo;
             facade.DeleteFloor(sysNo, (s1, args1) =>
             {
                 if (args1.FaultsHandle())
                 {
                     return;
                 }
                 else
                 {
                     DataGrid.Bind();
                 }
             });
         }
     });
 }
Пример #17
0
        private void ButtonVoid_Click(object sender, RoutedEventArgs e)
        {
            List <int> sysNos = GetCheckedNo();

            if (sysNos.Count > 0)
            {
                _Facade.Void(sysNos, (result) =>
                {
                    if (result)
                    {
                        //Window.Alert("批量作废成功!");
                        Window.Alert(ResGroupBuyingQuery.Msg_BatchVoidSuccess);
                        DataGrid.Bind();
                    }
                    else
                    {
                        //Window.Alert("批量作废失败!");
                        Window.Alert(ResGroupBuyingQuery.Msg_BatchVoidFailed);
                    }
                });
            }
        }
Пример #18
0
        private void hlbUpdate_Click(object sender, RoutedEventArgs e)
        {
            if (DataGrid.SelectedItem != null)
            {
                TopItemVM vm = (DataGrid.SelectedItem as TopItemVM);

                if (vm.HasValidationErrors)
                {
                    return;
                }

                if (!string.IsNullOrEmpty(vm.Priority))
                {
                    TopItemInfo entity = new TopItemInfo();
                    entity.WebChannel = new BizEntity.Common.WebChannel()
                    {
                        ChannelID = viewModel.ChannelID
                    };
                    entity.CategorySysNo = CategorySysNo;
                    entity.CategoryType  = CategoryType;
                    entity.ProductSysNo  = vm.ProductSysNo;
                    entity.Priority      = int.Parse(vm.Priority);
                    entity.CompanyCode   = viewModel.CompanyCode;
                    entity.WebChannel    = new BizEntity.Common.WebChannel()
                    {
                        ChannelID = viewModel.ChannelID
                    };
                    entity.IsExtend = chkIsExtend.IsChecked;
                    facade.SetTopItem(entity, (obj, args) =>
                    {
                        if (args.FaultsHandle())
                        {
                            return;
                        }
                        DataGrid.Bind();
                    });
                }
            }
        }
Пример #19
0
        private void btnStop_Click(object sender, RoutedEventArgs e)
        {
            List <int> sysNos = GetCheckedNo();

            if (sysNos.Count > 0)
            {
                _Facade.Stop(sysNos, (result) =>
                {
                    if (result)
                    {
                        //Window.Alert("中止处理成功!");
                        Window.Alert(ResGroupBuyingQuery.Msg_StopSuccess);
                        DataGrid.Bind();
                    }
                    else
                    {
                        //Window.Alert("中止处理失败!");
                        Window.Alert(ResGroupBuyingQuery.Msg_StopFailed);
                    }
                });
            }
        }
Пример #20
0
 private void ButtonSearch_Click(object sender, RoutedEventArgs e)
 {
     DataGrid.Bind();
 }