61 lines
1.5 KiB
C#
61 lines
1.5 KiB
C#
using _29WxOrderWpf.BaseWindows;
|
|
using _29WxOrderWpf.Ctrls.Statistics.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
|
|
namespace _29WxOrderWpf.Ctrls.Statistics;
|
|
|
|
/// <summary>
|
|
/// ShowOrderDialogView.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class ShowOrderDialogView : UserControl
|
|
{
|
|
public ShowOrderDialogView(List<ShopRevenueStatisticsRow> list)
|
|
{
|
|
InitializeComponent();
|
|
this.DataContext = new ShowOrderDialogViewModel(list);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 复制订单号到剪贴板
|
|
/// </summary>
|
|
private void CopyOrderId_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (sender is FrameworkElement element
|
|
&& element.DataContext is ShopRevenueStatisticsRow row
|
|
&& !string.IsNullOrEmpty(row.OrderId))
|
|
{
|
|
Window window = Window.GetWindow(this);
|
|
try
|
|
{
|
|
Clipboard.SetDataObject(row.OrderId);
|
|
BaseMsgWindow.ShowAnimateMessage("复制成功");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
BaseMsgWindow.ShowError("复制失败 " + ex.Message,window: window);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
class ShowOrderDialogViewModel
|
|
{
|
|
public List<ShopRevenueStatisticsRow> Data { get; set; }
|
|
public ShowOrderDialogViewModel(List<ShopRevenueStatisticsRow> list)
|
|
{
|
|
Data = list ?? new List<ShopRevenueStatisticsRow>();
|
|
}
|
|
}
|