15 changed files with 920 additions and 39 deletions
@ -0,0 +1,44 @@ |
|||||
|
using BBWY.Client.Models.APIModel.Response.PackTask; |
||||
|
using BBWY.Common.Http; |
||||
|
using BBWY.Common.Models; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Net.Http; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace BBWY.Client.APIServices.QiKu |
||||
|
{ |
||||
|
public class PackTaskExpressService : BaseApiService, IDenpendency |
||||
|
{ |
||||
|
public PackTaskExpressService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
public ApiResponse<List<string>> GetExpressNameList() |
||||
|
{ |
||||
|
return SendRequest<List<string>>(globalContext.QKApiHost, $"api/PackTaskExpress/GetExpressNameList", |
||||
|
null |
||||
|
, null, HttpMethod.Get); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 订阅快递100
|
||||
|
/// </summary>
|
||||
|
/// <param name="waybillNo"></param>
|
||||
|
/// <param name="sourceExpressName"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public ApiResponse<object> SubscribeKuaiDi100(string waybillNo, string sourceExpressName) |
||||
|
{ |
||||
|
return SendRequest<object>(globalContext.QKApiHost, $"api/PackTaskExpress/SubscribeKuaiDi100", |
||||
|
new |
||||
|
{ |
||||
|
waybillNo, |
||||
|
sourceExpressName |
||||
|
} |
||||
|
, null, HttpMethod.Post); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,121 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace BBWY.Client.Models.APIModel.Request |
||||
|
{ |
||||
|
public class CreatePackTaskV2Request |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 店铺Id
|
||||
|
/// </summary>
|
||||
|
public string ShopId { get; set; } |
||||
|
/// <summary>
|
||||
|
/// skuid
|
||||
|
/// </summary>
|
||||
|
public string SkuId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 品名
|
||||
|
/// </summary>
|
||||
|
public string BrandName { get; set; } |
||||
|
/// <summary>
|
||||
|
/// sku数量
|
||||
|
/// </summary>
|
||||
|
public int SkuCount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 落仓(本地仓=0,齐越仓=1,京东仓=2)
|
||||
|
/// </summary>
|
||||
|
public PositionType PositionType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 打包类型(单件=0,多件=1)
|
||||
|
/// </summary>
|
||||
|
public int PackType { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 配件数量
|
||||
|
/// </summary>
|
||||
|
public int GoodsNumber { get; set; } |
||||
|
/// <summary>
|
||||
|
/// sku配件名称
|
||||
|
/// </summary>
|
||||
|
public string SkuGoodsTitle { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 基础包装(快递袋=0,纸箱=1,麻袋=2)
|
||||
|
/// </summary>
|
||||
|
public int BasicPack { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 增量耗材
|
||||
|
/// </summary>
|
||||
|
public string Increment1 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 注意事项
|
||||
|
/// </summary>
|
||||
|
public string MarkMessage { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 对接人(发布任务人)
|
||||
|
/// </summary>
|
||||
|
public string UserId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
///条形码Id
|
||||
|
/// </summary>
|
||||
|
public long? BarCodeId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合格证Id
|
||||
|
/// </summary>
|
||||
|
public string CerId { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 是否需要条形码
|
||||
|
/// </summary>
|
||||
|
public bool? NeedBar { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 是否需要合格证
|
||||
|
/// </summary>
|
||||
|
public bool? NeedCer { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 合格证位置
|
||||
|
/// </summary>
|
||||
|
public int? CertificatePosition { get; set; } |
||||
|
|
||||
|
|
||||
|
#region 更新数据
|
||||
|
/// <summary>
|
||||
|
/// 货号
|
||||
|
/// </summary>
|
||||
|
public string ProductNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 图
|
||||
|
/// </summary>
|
||||
|
public string Logo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 名称
|
||||
|
/// </summary>
|
||||
|
public string SkuName { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 品牌
|
||||
|
/// </summary>
|
||||
|
public string Brand { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 配送方式
|
||||
|
/// </summary>
|
||||
|
public DistributionMode? DistributionMode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 绑定快递单号
|
||||
|
/// </summary>
|
||||
|
public List<string> WayBillNoList { get; set; } |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,109 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace BBWY.Client.Models.APIModel.Request |
||||
|
{ |
||||
|
public class UpdatePackTaskV2Request |
||||
|
{/// <summary>
|
||||
|
/// 任务id(修改使用)
|
||||
|
/// </summary>
|
||||
|
public long TaskId { get; set; } |
||||
|
|
||||
|
public string SkuId { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 品名
|
||||
|
/// </summary>
|
||||
|
public string BrandName { get; set; } |
||||
|
/// <summary>
|
||||
|
/// sku数量
|
||||
|
/// </summary>
|
||||
|
public int SkuCount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 落仓(本地仓=0,齐越仓=1,京东仓=2)
|
||||
|
/// </summary>
|
||||
|
public PositionType PositionType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 打包类型(单件=0,多件=1)
|
||||
|
/// </summary>
|
||||
|
public int PackType { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 配件数量
|
||||
|
/// </summary>
|
||||
|
public int GoodsNumber { get; set; } |
||||
|
/// <summary>
|
||||
|
/// sku配件名称
|
||||
|
/// </summary>
|
||||
|
public string SkuGoodsTitle { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 基础包装(快递袋=0,纸箱=1,麻袋=2)
|
||||
|
/// </summary>
|
||||
|
public int BasicPack { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 增量耗材
|
||||
|
/// </summary>
|
||||
|
public string Increment1 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 注意事项
|
||||
|
/// </summary>
|
||||
|
public string MarkMessage { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
///条形码Id
|
||||
|
/// </summary>
|
||||
|
public long? BarCodeId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合格证Id
|
||||
|
/// </summary>
|
||||
|
public string CerId { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 是否需要条形码
|
||||
|
/// </summary>
|
||||
|
public bool? NeedBar { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 是否需要合格证
|
||||
|
/// </summary>
|
||||
|
public bool? NeedCer { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 合格证位置
|
||||
|
/// </summary>
|
||||
|
public int? CertificatePosition { get; set; } |
||||
|
|
||||
|
#region 更新数据
|
||||
|
/// <summary>
|
||||
|
/// 货号
|
||||
|
/// </summary>
|
||||
|
public string ProductNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 图
|
||||
|
/// </summary>
|
||||
|
public string Logo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 名称
|
||||
|
/// </summary>
|
||||
|
public string SkuName { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 品牌
|
||||
|
/// </summary>
|
||||
|
public string Brand { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
#endregion
|
||||
|
/// <summary>
|
||||
|
/// 配送方式
|
||||
|
/// </summary>
|
||||
|
public DistributionMode? DistributionMode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 绑定快递单号
|
||||
|
/// </summary>
|
||||
|
public List<string> WayBillNoList { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace BBWY.Client.Models.PackTask |
||||
|
{ |
||||
|
public class PackTaskExpress : NotifyObject |
||||
|
{ |
||||
|
private string sourceExpressName; |
||||
|
private string waybillNo; |
||||
|
/// <summary>
|
||||
|
/// 快递单号
|
||||
|
/// </summary>
|
||||
|
public string WaybillNo { get=> waybillNo; set { Set(ref waybillNo, value); } } |
||||
|
/// <summary>
|
||||
|
/// 原快递公司
|
||||
|
/// </summary>
|
||||
|
public string SourceExpressName { get => sourceExpressName; set { Set(ref sourceExpressName, value); } } |
||||
|
|
||||
|
|
||||
|
public string NewGuid { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,94 @@ |
|||||
|
<c:BWindow x:Class="BBWY.Client.Views.PackTask.AddExpressWindow" |
||||
|
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
||||
|
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask" |
||||
|
mc:Ignorable="d" |
||||
|
Style="{StaticResource bwstyle}" |
||||
|
Height="245" Width="320" |
||||
|
xmlns:b="http://schemas.microsoft.com/xaml/behaviors" |
||||
|
xmlns:ctr="clr-namespace:BBWY.Client.Converters" |
||||
|
xmlns:cmodel="clr-namespace:BBWY.Client.Models" |
||||
|
xmlns:sys="clr-namespace:System;assembly=mscorlib" |
||||
|
CloseButtonVisibility="Visible" |
||||
|
WindowStyle="None" |
||||
|
MinButtonVisibility="Collapsed" |
||||
|
MaxButtonVisibility="Collapsed" |
||||
|
RightButtonGroupMargin="0,5,5,0" |
||||
|
CloseButtonColor="White" |
||||
|
Title="添加物流"> |
||||
|
<Window.Resources> |
||||
|
<ResourceDictionary > |
||||
|
<ResourceDictionary.MergedDictionaries> |
||||
|
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/> |
||||
|
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/> |
||||
|
|
||||
|
</ResourceDictionary.MergedDictionaries> |
||||
|
</ResourceDictionary> |
||||
|
</Window.Resources> |
||||
|
<Grid > |
||||
|
|
||||
|
<TextBlock Text="警告:填写错误的物流信息将导致打包任务无法更新任务状态" FontSize="12" TextWrapping="Wrap" Margin="30 45 30 0" VerticalAlignment="Top" HorizontalAlignment="Left" Foreground=" #ec808d"/> |
||||
|
|
||||
|
<StackPanel Panel.ZIndex="100" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Vertical" Margin="88,82,0,0" |
||||
|
Visibility="{Binding SelectShop,Mode=OneWay,Converter={StaticResource objConverter},ConverterParameter=店铺:Visible:Collapsed}" |
||||
|
> |
||||
|
<c:BTextBox x:Name="tbShop" Width="200" Height="25" TextChanged="tbShop_TextChanged" HorizontalAlignment="Left" Text="{Binding ExpressName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="快递公司" |
||||
|
BorderThickness="0 0 0 0" Margin="0 0 0 1" |
||||
|
/> |
||||
|
<ListBox MaxHeight="300" x:Name="tipBoxShop" SelectionChanged="tipBoxShop_SelectionChanged" Background="{StaticResource Border.Background}"> |
||||
|
|
||||
|
</ListBox> |
||||
|
</StackPanel> |
||||
|
<Grid> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<Grid.RowDefinitions> |
||||
|
<RowDefinition Height="30"/> |
||||
|
<RowDefinition/> |
||||
|
<RowDefinition Height="40"/> |
||||
|
</Grid.RowDefinitions> |
||||
|
<Border BorderThickness="0,0,0,1" Background="#8080ff" BorderBrush="{StaticResource MainMenu.BorderBrush}" |
||||
|
> |
||||
|
<TextBlock Text="添加物流" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="White" Margin="20 0 0 0"/> |
||||
|
</Border> |
||||
|
|
||||
|
<StackPanel Grid.Row="1" Orientation="Vertical" > |
||||
|
|
||||
|
<StackPanel Orientation="Horizontal" Margin=" 0 50 0 0" HorizontalAlignment="Center"> |
||||
|
<TextBlock Margin="0 0 5 0" VerticalAlignment="Center" Text="快递公司:"/> |
||||
|
|
||||
|
<Border BorderBrush="{StaticResource Border.Brush}" VerticalAlignment="Center" BorderThickness="1" Height="30" > |
||||
|
<c:BTextBox WaterRemark="快递公司" Visibility="Hidden" Text="{Binding ExpressName}" BorderThickness="0" Height="25" Width="200" VerticalAlignment="Center" HorizontalAlignment="Left"/> |
||||
|
</Border> |
||||
|
|
||||
|
</StackPanel> |
||||
|
<StackPanel Orientation="Horizontal" Margin="0 10 0 0" HorizontalAlignment="Center"> |
||||
|
<TextBlock Margin="0 0 5 0" VerticalAlignment="Center" Text="快递单号:"/> |
||||
|
|
||||
|
<Border BorderBrush="{StaticResource Border.Brush}" VerticalAlignment="Center" BorderThickness="1" Height="30" > |
||||
|
<c:BTextBox WaterRemark="快递单号" Text="{Binding WaybillNo,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" BorderThickness="0" Height="25" Width="200" VerticalAlignment="Center" HorizontalAlignment="Left"/> |
||||
|
</Border> |
||||
|
|
||||
|
</StackPanel> |
||||
|
|
||||
|
|
||||
|
</StackPanel> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<Border Grid.Row="2" Height="1" VerticalAlignment="Top" BorderBrush="{StaticResource Border.Background}" BorderThickness="1"/> |
||||
|
<DockPanel Grid.Row="2"> |
||||
|
<c:BButton Background="{StaticResource Button.Background}" DockPanel.Dock="Right" Content="确定" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch" Click="BButton_Click_1" /> |
||||
|
<c:BButton Foreground="{StaticResource Button.Background}" Grid.Row="2" Style="{StaticResource LinkButton}" Content="取消" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch" Click="BButton_Click" /> |
||||
|
</DockPanel> |
||||
|
|
||||
|
</Grid> |
||||
|
</Grid> |
||||
|
|
||||
|
|
||||
|
</c:BWindow> |
@ -0,0 +1,214 @@ |
|||||
|
using BBWY.Client.APIServices.QiKu; |
||||
|
using BBWY.Client.Models.PackTask; |
||||
|
using BBWY.Controls; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
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.Shapes; |
||||
|
using WebSocketSharp; |
||||
|
|
||||
|
namespace BBWY.Client.Views.PackTask |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// AddExpressWindow.xaml 的交互逻辑
|
||||
|
/// </summary>
|
||||
|
public partial class AddExpressWindow : BWindow |
||||
|
{ |
||||
|
public AddExpressWindow(Action<string, string, string> addExpressData, List<string> expressNameList, PackTaskExpressService packTaskExpressService, PackTaskExpress updateData=null) |
||||
|
{ |
||||
|
InitializeComponent(); |
||||
|
AddExpressData = addExpressData; |
||||
|
ExpressNameList = expressNameList; |
||||
|
this.packTaskExpressService = packTaskExpressService; |
||||
|
this.DataContext = this; |
||||
|
|
||||
|
if (updateData!=null) |
||||
|
{ |
||||
|
WaybillNo=updateData.WaybillNo; |
||||
|
ExpressName = updateData.SourceExpressName; |
||||
|
NewGuid = updateData.NewGuid; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
PackTaskExpressService packTaskExpressService; |
||||
|
|
||||
|
private string waybillNo; |
||||
|
public string WaybillNo { get => waybillNo; set { Set(ref waybillNo, value); } } |
||||
|
|
||||
|
public string expressName; |
||||
|
public string ExpressName { get => expressName; set { Set(ref expressName, value); } } |
||||
|
|
||||
|
|
||||
|
public string NewGuid { get; set; } |
||||
|
|
||||
|
public List<string> ExpressNameList { get; set; } |
||||
|
|
||||
|
public Action<string, string, string> AddExpressData { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 取消
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
private void BButton_Click(object sender, RoutedEventArgs e) |
||||
|
{ |
||||
|
this.Close(); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 确定
|
||||
|
/// </summary>
|
||||
|
/// <param name="sender"></param>
|
||||
|
/// <param name="e"></param>
|
||||
|
private void BButton_Click_1(object sender, RoutedEventArgs e) |
||||
|
{ |
||||
|
if (WaybillNo.IsNullOrEmpty()) |
||||
|
{ |
||||
|
MessageBox.Show("快递单号不能为空"); |
||||
|
return; |
||||
|
} |
||||
|
if (ExpressName.IsNullOrEmpty()) |
||||
|
{ |
||||
|
MessageBox.Show("快递公司不能为空不能为空"); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
var res = packTaskExpressService.SubscribeKuaiDi100(WaybillNo, ExpressName); |
||||
|
|
||||
|
if (res.Success) |
||||
|
{ |
||||
|
if (NewGuid.IsNullOrEmpty()) |
||||
|
{ |
||||
|
AddExpressData?.Invoke(Guid.NewGuid().ToString(), WaybillNo, ExpressName); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
AddExpressData?.Invoke(NewGuid, WaybillNo, ExpressName); |
||||
|
} |
||||
|
this.Close(); |
||||
|
return; |
||||
|
} |
||||
|
MessageBox.Show(res.Msg); |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
private void tbShop_TextChanged(object sender, TextChangedEventArgs e) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
var textBoxt = (TextBox)sender; |
||||
|
//创建一个ListBox
|
||||
|
|
||||
|
if (tipBoxShop != null && tipBoxShop.Items.Count > 0) |
||||
|
{ |
||||
|
tipBoxShop.Items.Clear(); |
||||
|
|
||||
|
} |
||||
|
if (string.IsNullOrEmpty(textBoxt.Text)) |
||||
|
{ |
||||
|
tipBoxShop.Visibility = Visibility.Collapsed; |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
if (ExpressNameList == null || ExpressNameList.Count < 0) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
var res = packTaskExpressService.GetExpressNameList(); |
||||
|
if (res.Success) |
||||
|
{ |
||||
|
ExpressNameList = res.Data; |
||||
|
} |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
foreach (var department in ExpressNameList) |
||||
|
{ |
||||
|
if (department.Contains(textBoxt.Text)) |
||||
|
{ |
||||
|
ListBoxItem item = new ListBoxItem(); |
||||
|
Label lb = new Label(); |
||||
|
lb.BorderThickness = new Thickness(0); |
||||
|
lb.HorizontalAlignment = HorizontalAlignment.Left; |
||||
|
lb.VerticalAlignment = VerticalAlignment.Center; |
||||
|
lb.Background = Brushes.Transparent; |
||||
|
|
||||
|
lb.Margin = (new Thickness(0)); |
||||
|
lb.Content = department; |
||||
|
item.Content = lb; |
||||
|
tipBoxShop.Items.Add(item); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
if (tipBoxShop != null) |
||||
|
tipBoxShop.Visibility = Visibility.Visible; |
||||
|
} |
||||
|
catch (Exception) |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private void tipBoxShop_SelectionChanged(object sender, SelectionChangedEventArgs e) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
var list = (ListBox)sender; |
||||
|
if (list.Items.Count <= 0) |
||||
|
{ |
||||
|
return; |
||||
|
} |
||||
|
var value = (ListBoxItem)list.SelectedValue; |
||||
|
var content = (Label)value.Content; |
||||
|
tbShop.Text = content.Content.ToString(); |
||||
|
tipBoxShop.Visibility = Visibility.Collapsed; |
||||
|
} |
||||
|
catch (Exception) |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
private void tbShop_LostFocus(object sender, RoutedEventArgs e) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
if (tipBoxShop != null && tipBoxShop.Items.Count > 0) |
||||
|
{ |
||||
|
tipBoxShop.Items.Clear(); |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
catch (Exception) |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue