用户列表页面完成 订单列表页面开始 10%
This commit is contained in:
1 parent
25cdf642bf
commit
edc7913637
52 files changed
+2032
-365
No files matched your search
@@ -0,0 +1,73 @@
|
||||
<UserControl x:Class="_29WxOrderWpf.Ctrls.ShopCtrls.ShopDataGridCtrl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.ShopCtrls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<DataGrid Grid.Row="1" Opacity="0" HorizontalContentAlignment="Center" Margin="2,0,2,2" RowHeight="60" x:Name="dgOrder" Grid.ColumnSpan="2"
|
||||
AutoGenerateColumns = "False" HorizontalGridLinesBrush="{StaticResource HorizontalGridLinesBrush}"
|
||||
VerticalGridLinesBrush="{StaticResource VerticalGridLinesBrush}" CanUserDeleteRows="False" CanUserAddRows="False" ColumnHeaderHeight="40">
|
||||
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Setter Property="Background" Value="White"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource ListRowHoverBackColorBrush}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="Background" Value="{StaticResource ListBackColorBrush}"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource ListRowHoverBackColorBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource mainForegroundColorBrush}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.CellStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridCheckBoxColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}" Width="50"/>
|
||||
<DataGridTemplateColumn Width="*" Header="订单编号" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBox Grid.Row="1" HorizontalAlignment="Center" Width="Auto" Height="20" Background="Transparent" IsReadOnly="True" Text="{Binding order_id}" BorderThickness="0"></TextBox>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Width="*" Header="图标">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="1" HorizontalAlignment="Center" Width="Auto" Height="26" Padding="0" Margin="5" CornerRadius="5" Background="LightYellow" BorderBrush="Orange" BorderThickness="1">
|
||||
<Label HorizontalAlignment="Center" Width="Auto" Content="店铺待发货" Foreground="Orange"></Label>
|
||||
</Border>
|
||||
<TextBox Grid.Row="2" HorizontalAlignment="Center" Width="Auto" Height="20" IsReadOnly="True" Text="收货地址 吕* 1********** 江苏省 镇江市 京口区" BorderThickness="0"></TextBox>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,28 @@
|
||||
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.ShopCtrls
|
||||
{
|
||||
/// <summary>
|
||||
/// ShopDataGridCtrl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ShopDataGridCtrl : UserControl
|
||||
{
|
||||
public ShopDataGridCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
<UserControl x:Class="_29WxOrderWpf.Ctrls.ShopCtrls.ShopListCtrl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.ShopCtrls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800" x:Name="shopListCtrl" Loaded="shopListCtrl_Loaded">
|
||||
<Grid Background="{StaticResource ListCtrlBackColorBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"></RowDefinition>
|
||||
<RowDefinition Height="40"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="40"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid x:Name="gridSearch">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="店名" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="0" Margin="6,0,0,0"/>
|
||||
<Border Grid.Column="1" Margin="4" BorderBrush="{StaticResource mainColorBrush}" BorderThickness="1" CornerRadius="4" Height="26">
|
||||
<TextBox x:Name="txtShopName" Margin="3,0" VerticalContentAlignment="Center" Style="{StaticResource BaseTextBoxStyle}"/>
|
||||
</Border>
|
||||
<TextBlock Text="分组" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="2"/>
|
||||
<Border Grid.Column="3" Margin="4" BorderBrush="{StaticResource mainColorBrush}" BorderThickness="1" CornerRadius="4" Height="26">
|
||||
<ComboBox x:Name="cmbGroup" Margin="3,0" VerticalContentAlignment="Center" Style="{StaticResource BaseComboBoxStyle}" SelectionChanged="cmbGroup_SelectionChanged"/>
|
||||
</Border>
|
||||
<TextBlock Text="备注" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="4"/>
|
||||
<Border Grid.Column="5" Margin="4" BorderBrush="{StaticResource mainColorBrush}" BorderThickness="1" CornerRadius="4" Height="26">
|
||||
<ComboBox x:Name="cmbNotes" Margin="3,0" VerticalContentAlignment="Center" Style="{StaticResource BaseComboBoxStyle}" SelectionChanged="cmbNotes_SelectionChanged"/>
|
||||
</Border>
|
||||
<Button Grid.Column="6" x:Name="btnSearch" Style="{StaticResource BasePageButtonStyle}" Grid.Row="4" Content=" 搜索 " Height="26" Click="btnSearch_Click"></Button>
|
||||
<Button Grid.Column="7" x:Name="btnRestore" Style="{StaticResource BasePageButtonLightStyle}" Grid.Row="4" Content=" 还原 " Height="26" Click="btnRestore_Click" Margin="4,0,6,0"></Button>
|
||||
</Grid>
|
||||
<Grid x:Name="lstTitle" Grid.Row="1" Margin="4,0" Background="{StaticResource ListHeadBackColorBrush}">
|
||||
<Border BorderThickness="0,0,1,0" BorderBrush="{StaticResource ListHeadBorderColorBrush}">
|
||||
<DataGrid Margin="0,0,18,0" x:Name="dgShopHeader" Grid.ColumnSpan="100" AutoGenerateColumns="False" CanUserReorderColumns="False"
|
||||
ColumnHeaderHeight="{Binding ElementName=lstTitle, Path=ActualHeight}" BorderThickness="0"
|
||||
ColumnDisplayIndexChanged="dgShopHeader_ColumnDisplayIndexChanged"
|
||||
LayoutUpdated="dgShopHeader_LayoutUpdated">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn x:Name="colSelectAll" Header="选择" Width="50" HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}">
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Width="14" Height="14">
|
||||
<!--<CheckBox x:Name="headerCheckBox" BorderThickness="0" IsChecked="{Binding DataContext.AreAllSelected, RelativeSource={RelativeSource AncestorType=DataGrid}, UpdateSourceTrigger=PropertyChanged}" Checked="HeaderCheckBox_Checked" Unchecked="HeaderCheckBox_Unchecked"/>-->
|
||||
<CheckBox x:Name="chkSelectAll" BorderThickness="0" IsChecked="False" Checked="ChkSelectAll_Checked" Unchecked="ChkSelectAll_Unchecked" Loaded="ChkSelectAll_Loaded" IsThreeState="True"/>
|
||||
<Border BorderThickness="1" Background="Transparent" BorderBrush="{StaticResource mainColorBrush}" Width="14" Height="14"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False">
|
||||
</Border>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<!--<CheckBox IsChecked="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" VerticalAlignment="Center"/>-->
|
||||
<CheckBox HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Width="100*" HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" Header="AppId"/>
|
||||
<DataGridTextColumn Width="100*" HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" Header="店铺名称"/>
|
||||
<DataGridTextColumn Width="100*" HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" Header="分组"/>
|
||||
<DataGridTextColumn Width="82*" HeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}" Header=" 备注"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Border>
|
||||
</Grid>
|
||||
<!--<ListBox Grid.Row="2" x:Name="lbxShop" ItemsSource="{Binding GlobalConfig.ShopLoginList}" BorderThickness="0" Margin="4,0,4,4">-->
|
||||
<ListBox Grid.Row="2" x:Name="lbxShop" BorderThickness="0" Margin="4,0,4,4" SelectionMode="Extended">
|
||||
<!--使用自定义属性模板去除ListBox高亮显示框-->
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<ContentPresenter Content="{TemplateBinding Content}"
|
||||
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!--<local:ShopListRowCtrl></local:ShopListRowCtrl>-->
|
||||
<Border Margin="0,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="0, 0, 0, 1" MinHeight="50"
|
||||
BorderBrush="{StaticResource ListRowBorderColorBrush}" CornerRadius="0">
|
||||
<Border.Style>
|
||||
<!-- 鼠标进入或悬停Border时切换颜色(悬停时Border的填充控件必须有填充Border,所在层级不限,仅填充透明Grid则触发器无效) -->
|
||||
<Style TargetType="Border">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource ListRowHoverBackColorBrush}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
|
||||
<Grid x:Name="gridListItem">
|
||||
<Grid.ColumnDefinitions>
|
||||
<!--<ColumnDefinition Width="{Binding colShopIdWidth,RelativeSource={RelativeSource AncestorType={x:Type local:ShopListCtrl}}}" ></ColumnDefinition>-->
|
||||
<ColumnDefinition x:Name="colCheck" Width="100*"></ColumnDefinition>
|
||||
<ColumnDefinition x:Name="colShopId" Width="100*"></ColumnDefinition>
|
||||
<ColumnDefinition x:Name="colShopName" Width="100*"></ColumnDefinition>
|
||||
<ColumnDefinition x:Name="colGroupName" Width="100*"></ColumnDefinition>
|
||||
<ColumnDefinition x:Name="colNotes" Width="100*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox Grid.Column="0" Background="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center" Tag="{Binding ShopId}" IsChecked="{Binding IsSelect, Mode=TwoWay}" Click="CheckBox_Click"/>
|
||||
<TextBox Grid.Column="1" Background="Transparent" TextWrapping="Wrap" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" IsReadOnly="True" BorderThickness="0" Tag="{Binding ShopId}" Text="{Binding ShopId}" />
|
||||
<TextBox Grid.Column="2" Background="Transparent" TextWrapping="Wrap" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" IsReadOnly="True" BorderThickness="0" Tag="{Binding ShopId}" Text="{Binding ShopAccount}" />
|
||||
<TextBox Grid.Column="3" Background="Transparent" TextWrapping="Wrap" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" IsReadOnly="True" BorderThickness="0" Tag="{Binding ShopId}" Text="{Binding GroupName}" />
|
||||
<TextBox Grid.Column="4" Background="Transparent" TextWrapping="Wrap" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" IsReadOnly="True" BorderThickness="0" Tag="{Binding ShopId}" Text="{Binding Notes}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<Grid x:Name="gridRefreshOrSelect" Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="0" x:Name="btnRefreshShop" Style="{StaticResource BasePageButtonStyle}" Grid.Row="4" Content=" 刷新店铺 " Height="26" Margin="6,0,0,0" Click="btnRefreshShop_Click"></Button>
|
||||
<Button Grid.Column="6" x:Name="btnApplySelectShop" Style="{StaticResource BasePageButtonStyle}" Grid.Row="4" Content=" 确定 " Height="26" Click="btnApplySelectShop_Click"></Button>
|
||||
<Button Grid.Column="7" x:Name="btnCancelSelectShop" Style="{StaticResource BasePageButtonLightStyle}" Grid.Row="4" Content=" 取消 " Height="26" Margin="4,0,6,0" Click="btnCancelSelectShop_Click"></Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,191 @@
|
||||
using _29WxOrderWpf.Utils;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
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.ShopCtrls
|
||||
{
|
||||
/// <summary>
|
||||
/// ShopListCtrl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ShopListCtrl : UserControl
|
||||
{
|
||||
public bool? IsAcceptChoiceShop { get; set; } = false;
|
||||
CheckBox chkSelectAll = null;
|
||||
public ShopListCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = this;
|
||||
}
|
||||
|
||||
private void shopListCtrl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.lbxShop.ItemsSource = GlobalConfig.ShopLoginList;
|
||||
|
||||
Task.Run(() => {
|
||||
while(MainWindow.Instance.hasReadShop == false)
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
|
||||
Dispatcher.Invoke(new Action(() => {
|
||||
cmbGroup.Items.Clear();
|
||||
cmbGroup.Items.Add("");
|
||||
foreach (var group in GlobalConfig.ShopLoginList.Select(s => s.GroupName).Distinct())
|
||||
{
|
||||
if (!string.IsNullOrEmpty(group))
|
||||
this.cmbGroup.Items.Add(group);
|
||||
}
|
||||
cmbNotes.Items.Clear();
|
||||
cmbNotes.Items.Add("");
|
||||
foreach (var notes in GlobalConfig.ShopLoginList.Select(s => s.Notes).Distinct())
|
||||
{
|
||||
if (!string.IsNullOrEmpty(notes))
|
||||
this.cmbNotes.Items.Add(notes);
|
||||
}
|
||||
|
||||
}));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void dgShopHeader_ColumnDisplayIndexChanged(object sender, DataGridColumnEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void dgShopHeader_LayoutUpdated(object sender, EventArgs e)
|
||||
{
|
||||
foreach (var item in lbxShop.Items)
|
||||
{
|
||||
ListBoxItem container = (ListBoxItem)lbxShop.ItemContainerGenerator.ContainerFromIndex(lbxShop.Items.IndexOf(item));
|
||||
if (container != null)
|
||||
{
|
||||
// 找到grid控件并修改列大小
|
||||
Grid grid = UiCtrlUtils.FindVisualChild<Grid>(container, "gridListItem");
|
||||
if (grid != null)
|
||||
{
|
||||
for(int i = 0; i< grid.ColumnDefinitions.Count; i++)
|
||||
{
|
||||
if (dgShopHeader.Columns.Count > i)
|
||||
{
|
||||
// 最后一列因滚动条变窄,已在表头补偿
|
||||
if (i == grid.ColumnDefinitions.Count - 1)
|
||||
grid.ColumnDefinitions[i].Width = new GridLength(Math.Max(0, dgShopHeader.Columns[i].ActualWidth - 0));
|
||||
else
|
||||
grid.ColumnDefinitions[i].Width = new GridLength(dgShopHeader.Columns[i].ActualWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ChkSelectAll_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
foreach (var shop in GlobalConfig.ShopLoginList.ToList())
|
||||
{
|
||||
//shop.IsSelect = ((sender as CheckBox)?.IsChecked).ParseToBool();
|
||||
shop.IsSelect = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void ChkSelectAll_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
foreach (var shop in GlobalConfig.ShopLoginList.ToList())
|
||||
{
|
||||
//shop.IsSelect = ((sender as CheckBox)?.IsChecked).ParseToBool();
|
||||
shop.IsSelect = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void ChkSelectAll_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
chkSelectAll = sender as CheckBox;
|
||||
}
|
||||
|
||||
private void CheckBox_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
chkSelectAll.Checked -= ChkSelectAll_Checked;
|
||||
chkSelectAll.Unchecked -= ChkSelectAll_Unchecked;
|
||||
if (GlobalConfig.ShopLoginList.All(s => s.IsSelect))
|
||||
chkSelectAll.IsChecked = true;
|
||||
else if (GlobalConfig.ShopLoginList.All(s => !s.IsSelect))
|
||||
chkSelectAll.IsChecked = false;
|
||||
else
|
||||
chkSelectAll.IsChecked = null;
|
||||
chkSelectAll.Checked += ChkSelectAll_Checked;
|
||||
chkSelectAll.Unchecked += ChkSelectAll_Unchecked;
|
||||
}
|
||||
|
||||
private void cmbNotes_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void cmbGroup_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void btnSearch_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ObservableCollection<ShopLoginInfo> shops = new ObservableCollection<ShopLoginInfo>();
|
||||
foreach (var shop in GlobalConfig.ShopLoginList)
|
||||
{
|
||||
if (!shop.ShopAccount.ParseToString().Contains(txtShopName.Text))
|
||||
continue;
|
||||
if (!shop.GroupName.ParseToString().Contains(cmbGroup.Text))
|
||||
continue;
|
||||
if (!shop.Notes.ParseToString().Contains(cmbNotes.Text))
|
||||
continue;
|
||||
|
||||
shops.Add(shop);
|
||||
}
|
||||
this.lbxShop.ItemsSource = shops;
|
||||
}
|
||||
|
||||
private void btnRestore_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
txtShopName.Text = "";
|
||||
cmbNotes.Text = "";
|
||||
cmbGroup.Text = "";
|
||||
this.lbxShop.ItemsSource = GlobalConfig.ShopLoginList;
|
||||
}
|
||||
|
||||
private void btnRefreshShop_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MainWindow.Instance.GetServerShop();
|
||||
}
|
||||
|
||||
private void btnCancelSelectShop_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.IsAcceptChoiceShop = false;
|
||||
MainWindow.Instance.gridUser.Visibility = Visibility.Hidden;
|
||||
}
|
||||
|
||||
|
||||
private void btnApplySelectShop_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.IsAcceptChoiceShop = true;
|
||||
MainWindow.Instance.gridUser.Visibility = Visibility.Hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<UserControl x:Class="_29WxOrderWpf.Ctrls.ShopCtrls.ShopListRowCtrl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.ShopCtrls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<TextBlock Text="{Binding ShopAccount}"></TextBlock>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,28 @@
|
||||
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.ShopCtrls
|
||||
{
|
||||
/// <summary>
|
||||
/// ShopListRowCtrl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ShopListRowCtrl : UserControl
|
||||
{
|
||||
public ShopListRowCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.ShopCtrls
|
||||
{
|
||||
internal class ShopListViewModel
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user