コード例 #1
0
ファイル: GiftCardQuery.xaml.cs プロジェクト: sanlonezhang/ql
        /// <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);
            }
        }