7 changed files with 228 additions and 21 deletions
@ -0,0 +1,51 @@ |
|||||
|
<c:BWindow x:Class="BBWY.Client.Views.Order.EditVenderRemark" |
||||
|
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.Order" |
||||
|
mc:Ignorable="d" |
||||
|
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
||||
|
Title="EditVenderRemark" Height="160" Width="300"> |
||||
|
<Grid> |
||||
|
<Grid.RowDefinitions> |
||||
|
<RowDefinition Height="30"/> |
||||
|
<RowDefinition/> |
||||
|
<RowDefinition Height="40"/> |
||||
|
</Grid.RowDefinitions> |
||||
|
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}" |
||||
|
Background="{StaticResource Border.Background}"> |
||||
|
<TextBlock Text="修改商家备注" Style="{StaticResource middleTextBlock}"/> |
||||
|
</Border> |
||||
|
|
||||
|
<Grid Grid.Row="1" Margin="0,5"> |
||||
|
<Grid.RowDefinitions> |
||||
|
<RowDefinition/> |
||||
|
<RowDefinition/> |
||||
|
</Grid.RowDefinitions> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition Width="100"/> |
||||
|
<ColumnDefinition/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
|
||||
|
<TextBlock Text="标签" HorizontalAlignment="Right" VerticalAlignment="Center"/> |
||||
|
<ComboBox x:Name="cbx_flag" Grid.Column="1" Height="25" Width="100" |
||||
|
HorizontalAlignment="Left" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="5,0,0,0" |
||||
|
SelectedIndex="0" FocusVisualStyle="{x:Null}"> |
||||
|
<ComboBox.ItemTemplate> |
||||
|
<DataTemplate> |
||||
|
<StackPanel Orientation="Horizontal"> |
||||
|
<TextBlock Text="{Binding Key}"/> |
||||
|
<Border Height="10" Width="40" Background="{Binding Value}" Margin="5,0,0,0"/> |
||||
|
</StackPanel> |
||||
|
</DataTemplate> |
||||
|
</ComboBox.ItemTemplate> |
||||
|
</ComboBox> |
||||
|
<TextBlock Text="商家备注" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Row="1"/> |
||||
|
<c:BTextBox x:Name="txtVenderRemark" Grid.Column="1" Grid.Row="1" Height="25" Width="150" HorizontalAlignment="Left" Margin="5,0,0,0"/> |
||||
|
</Grid> |
||||
|
|
||||
|
<c:BButton x:Name="btn_Save" Content="保存" Grid.Row="2" Width="60" HorizontalAlignment="Right" Margin="0,0,8,0" |
||||
|
Click="btn_Save_Click"/> |
||||
|
</Grid> |
||||
|
</c:BWindow> |
@ -0,0 +1,70 @@ |
|||||
|
using BBWY.Client.Models; |
||||
|
using BBWY.Controls; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
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; |
||||
|
|
||||
|
namespace BBWY.Client.Views.Order |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// EditVenderRemark.xaml 的交互逻辑
|
||||
|
/// </summary>
|
||||
|
public partial class EditVenderRemark : BWindow |
||||
|
{ |
||||
|
public string OrderId { get; private set; } |
||||
|
|
||||
|
public string Flag { get; private set; } |
||||
|
|
||||
|
public string VenderRemark { get; private set; } |
||||
|
|
||||
|
public EditVenderRemark(string orderId, string venderRemark, string flag) |
||||
|
{ |
||||
|
InitializeComponent(); |
||||
|
|
||||
|
this.OrderId = orderId; |
||||
|
this.VenderRemark = venderRemark; |
||||
|
this.Flag = flag; |
||||
|
this.Loaded += EditVenderRemark_Loaded; |
||||
|
} |
||||
|
|
||||
|
private void EditVenderRemark_Loaded(object sender, RoutedEventArgs e) |
||||
|
{ |
||||
|
txtVenderRemark.Text = VenderRemark; |
||||
|
var flagList = new List<KVModel>() |
||||
|
{ |
||||
|
new KVModel() {Key="灰色",Value="Gray"}, |
||||
|
new KVModel() {Key="红色",Value="Red"}, |
||||
|
new KVModel() {Key="黄色",Value="Yellow"}, |
||||
|
new KVModel() {Key="绿色",Value="Green"}, |
||||
|
new KVModel() {Key="蓝色",Value="Blue"}, |
||||
|
new KVModel() {Key="紫色",Value="Purple"} |
||||
|
}; |
||||
|
cbx_flag.ItemsSource = flagList; |
||||
|
if (!string.IsNullOrEmpty(Flag)) |
||||
|
cbx_flag.SelectedItem = flagList.FirstOrDefault(kv => kv.Value == Flag) ?? flagList[0]; |
||||
|
} |
||||
|
|
||||
|
private void btn_Save_Click(object sender, RoutedEventArgs e) |
||||
|
{ |
||||
|
if (string.IsNullOrEmpty(txtVenderRemark.Text)) |
||||
|
{ |
||||
|
MessageBox.Show("商家备注必填", "提示"); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
this.Flag = (cbx_flag.SelectedItem as KVModel).Value; |
||||
|
this.VenderRemark = txtVenderRemark.Text; |
||||
|
this.DialogResult = true; |
||||
|
this.Close(); |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue