Browse Source

init

master
yibo 6 years ago
commit
bec7d4e1d5
54 changed files with 3977 additions and 0 deletions
  1. +6
    -0
      .gitignore
  2. +22
    -0
      B3DealerClient.sln
  3. +6
    -0
      B3DealerClient/App.config
  4. +45
    -0
      B3DealerClient/App.xaml
  5. +62
    -0
      B3DealerClient/App.xaml.cs
  6. +244
    -0
      B3DealerClient/B3DealerClient.csproj
  7. +26
    -0
      B3DealerClient/BL/LoginBL.cs
  8. +70
    -0
      B3DealerClient/Control/DataFormat/DataFormat.cs
  9. +58
    -0
      B3DealerClient/Control/DataFormat/IND560DataFormat.cs
  10. +121
    -0
      B3DealerClient/Control/DataFormat/Xk3124DataFormat.cs
  11. +136
    -0
      B3DealerClient/Control/DataFormat/Xk3190A9DataFormat.cs
  12. +60
    -0
      B3DealerClient/Control/NumberPad.xaml
  13. +85
    -0
      B3DealerClient/Control/NumberPad.xaml.cs
  14. +37
    -0
      B3DealerClient/Control/WeightConfig.cs
  15. +27
    -0
      B3DealerClient/Control/WeightControl.xaml
  16. +256
    -0
      B3DealerClient/Control/WeightControl.xaml.cs
  17. +53
    -0
      B3DealerClient/Control/WeightSettingWindow.xaml
  18. +94
    -0
      B3DealerClient/Control/WeightSettingWindow.xaml.cs
  19. +25
    -0
      B3DealerClient/FunctionSelectDialog.xaml
  20. +61
    -0
      B3DealerClient/FunctionSelectDialog.xaml.cs
  21. BIN
      B3DealerClient/Images/login.png
  22. BIN
      B3DealerClient/Images/setting.png
  23. +25
    -0
      B3DealerClient/LoginWindow.xaml
  24. +89
    -0
      B3DealerClient/LoginWindow.xaml.cs
  25. +55
    -0
      B3DealerClient/Properties/AssemblyInfo.cs
  26. +71
    -0
      B3DealerClient/Properties/Resources.Designer.cs
  27. +117
    -0
      B3DealerClient/Properties/Resources.resx
  28. +30
    -0
      B3DealerClient/Properties/Settings.Designer.cs
  29. +7
    -0
      B3DealerClient/Properties/Settings.settings
  30. +34
    -0
      B3DealerClient/SettingDialog.xaml
  31. +92
    -0
      B3DealerClient/SettingDialog.xaml.cs
  32. +8
    -0
      B3DealerClient/Style/Border.xaml
  33. +31
    -0
      B3DealerClient/Style/Button.xaml
  34. +414
    -0
      B3DealerClient/Style/Calendar.xaml
  35. +43
    -0
      B3DealerClient/Style/CheckBox.xaml
  36. +92
    -0
      B3DealerClient/Style/Colors.xaml
  37. +35
    -0
      B3DealerClient/Style/ComboBox.xaml
  38. +117
    -0
      B3DealerClient/Style/DataGrid.xaml
  39. +164
    -0
      B3DealerClient/Style/DatePicker.xaml
  40. +12
    -0
      B3DealerClient/Style/TSIcon.xaml
  41. +67
    -0
      B3DealerClient/Utils/AppContext.cs
  42. +66
    -0
      B3DealerClient/Utils/ControlAttachProperty.cs
  43. +50
    -0
      B3DealerClient/Utils/DbUtil.cs
  44. +28
    -0
      B3DealerClient/Utils/WindowUtil.cs
  45. +47
    -0
      B3DealerClient/Utils/XmlUtil.cs
  46. +250
    -0
      B3DealerClient/Windows/CarcassInStoreWindow_/CarcassInStoreWindow.xaml
  47. +27
    -0
      B3DealerClient/Windows/CarcassInStoreWindow_/CarcassInStoreWindow.xaml.cs
  48. +250
    -0
      B3DealerClient/Windows/CarcassSaleOutWindow_/CarcassSaleOutWindow.xaml
  49. +27
    -0
      B3DealerClient/Windows/CarcassSaleOutWindow_/CarcassSaleOutWindow.xaml.cs
  50. +173
    -0
      B3DealerClient/Windows/FreshInStoreWindow_/FreshInStoreWindow.xaml
  51. +27
    -0
      B3DealerClient/Windows/FreshInStoreWindow_/FreshInStoreWindow.xaml.cs
  52. +8
    -0
      B3DealerClient/Windows/FreshSaleOutWindow_/FreshSaleOutWindow.xaml
  53. +27
    -0
      B3DealerClient/Windows/FreshSaleOutWindow_/FreshSaleOutWindow.xaml.cs
  54. BIN
      B3DealerClient/app.ico

+ 6
- 0
.gitignore View File

@ -0,0 +1,6 @@
.*
*.TMP
*.suo
*.user
obj
bin

+ 22
- 0
B3DealerClient.sln View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "B3DealerClient", "B3DealerClient\B3DealerClient.csproj", "{24AC5416-A243-485A-BC71-533606677CA3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{24AC5416-A243-485A-BC71-533606677CA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24AC5416-A243-485A-BC71-533606677CA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24AC5416-A243-485A-BC71-533606677CA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24AC5416-A243-485A-BC71-533606677CA3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

+ 6
- 0
B3DealerClient/App.config View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

+ 45
- 0
B3DealerClient/App.xaml View File

@ -0,0 +1,45 @@
<Application x:Class="B3DealerClient.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="LoginWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Style/Colors.xaml"/>
<ResourceDictionary Source="Style/Button.xaml"/>
<ResourceDictionary Source="Style/TSIcon.xaml"/>
<ResourceDictionary Source="Style/ComboBox.xaml"/>
<ResourceDictionary Source="Style/DatePicker.xaml"/>
<ResourceDictionary Source="Style/DataGrid.xaml"/>
<ResourceDictionary Source="Style/CheckBox.xaml"/>
<ResourceDictionary Source="Style/Border.xaml"/>
<!--<ResourceDictionary Source="pack://application:,,,/TSingSoft.WpfControls;component/Style/Colors.xaml"/>
<ResourceDictionary Source="pack://application:,,,/TSingSoft.WpfControls;component/Style/Global.xaml" />
<ResourceDictionary Source="pack://application:,,,/TSingSoft.WpfControls;component/Style/Themes/TSIcon.xaml" />
<ResourceDictionary Source="pack://application:,,,/TSingSoft.WpfControls;component/Control/TSButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/TSingSoft.WpfControls;component/Style/Style.xaml"/>-->
</ResourceDictionary.MergedDictionaries>
<!--<Style TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource DefaultScrollBar}"></Style>
<Style TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource DefaultScrollViewer}"></Style>-->
<!--<Style TargetType="TextBox" BasedOn="{StaticResource DefaultTextBox}"></Style>
<Style TargetType="CheckBox" BasedOn="{StaticResource DefaultCheckBox}"></Style>-->
<!--<Style TargetType="RadioButton" BasedOn="{StaticResource DefaultRadioButton}"></Style>-->
<!--<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource DefaultMenuItem}"></Style>
<Style TargetType="{x:Type Menu}" BasedOn="{StaticResource DefaultMenu}"></Style>
<Style TargetType="{x:Type ContextMenu}" BasedOn="{StaticResource DefaultContextMenu}"></Style>
<Style TargetType="{x:Type DataGrid}" BasedOn="{StaticResource DefaultDataGrid}"></Style>
<Style TargetType="{x:Type TreeView}" BasedOn="{StaticResource DefaultTreeView}"></Style>
<Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource DefaultComboBox}"></Style>
<Style TargetType="{x:Type DatePicker}" BasedOn="{StaticResource DefaultDatePicker}"></Style>
<Style TargetType="{x:Type ListBox}" BasedOn="{StaticResource DefaultListBox}"></Style>
<Style TargetType="{x:Type ListView}" BasedOn="{StaticResource DefaultListView}"></Style>-->
<Style TargetType="Button" BasedOn="{StaticResource DefaultButton}"/>
<Style TargetType="ComboBox" BasedOn="{StaticResource ComboBoxStyle}"/>
<Style TargetType="DatePicker" BasedOn="{StaticResource DatePickerStyle1}"/>
<Style TargetType="DataGrid" BasedOn="{StaticResource DataGridStyle1}"/>
<Style TargetType="CheckBox" BasedOn="{StaticResource DefaultCheckBox}"/>
</ResourceDictionary>
</Application.Resources>
</Application>

+ 62
- 0
B3DealerClient/App.xaml.cs View File

@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
namespace B3DealerClient
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
public App()
{
App.Current.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(Current_DispatcherUnhandledException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
}
private void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
MessageBox.Show(e.Exception.Message, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
//LogHelper.Error(e.Exception.Message, e.Exception);
e.Handled = true;
}
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
var ex = e.ExceptionObject as Exception;
if (ex != null)
{
MessageBox.Show(ex.Message, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
//LogHelper.Error(ex.Message, ex);
}
}
EventWaitHandle ProgramStarted;
readonly string[] FOLDERS = new string[] { "Config", "Log" };
protected override void OnStartup(StartupEventArgs e)
{
//bool createNew;
//ProgramStarted = new EventWaitHandle(false, EventResetMode.AutoReset, "PigButcherManageSolution.Windows", out createNew);
//if (!createNew)
//{
// MessageBox.Show(@"系统已经在运行中,如果要重新启动,请从进程中关闭...", @"系统警告");
// App.Current.Shutdown();
//}
base.OnStartup(e);
foreach (var folder in FOLDERS)
{
if (!System.IO.Directory.Exists(folder))
System.IO.Directory.CreateDirectory(folder);
}
}
}
}

+ 244
- 0
B3DealerClient/B3DealerClient.csproj View File

@ -0,0 +1,244 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{24AC5416-A243-485A-BC71-533606677CA3}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>B3DealerClient</RootNamespace>
<AssemblyName>B3DealerClient</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>app.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Forks.EnterpriseServices, Version=3.1.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\MyFolder\Company\Code\BwpB3DealerProject\TSREF\release\Forks.EnterpriseServices.dll</HintPath>
</Reference>
<Reference Include="Forks.JsonRpc.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\MyFolder\Company\Code\BwpB3DealerProject\TSREF\release\Forks.JsonRpc.Client.dll</HintPath>
</Reference>
<Reference Include="Forks.Utils, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\MyFolder\Company\Code\BwpB3DealerProject\TSREF\release\Forks.Utils.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=4.0.3.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\MyFolder\Company\Code\BwpB3DealerProject\TSREF\release\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="BL\LoginBL.cs" />
<Compile Include="Control\DataFormat\DataFormat.cs" />
<Compile Include="Control\DataFormat\IND560DataFormat.cs" />
<Compile Include="Control\DataFormat\Xk3124DataFormat.cs" />
<Compile Include="Control\DataFormat\Xk3190A9DataFormat.cs" />
<Compile Include="Control\NumberPad.xaml.cs">
<DependentUpon>NumberPad.xaml</DependentUpon>
</Compile>
<Compile Include="Control\WeightConfig.cs" />
<Compile Include="Control\WeightControl.xaml.cs">
<DependentUpon>WeightControl.xaml</DependentUpon>
</Compile>
<Compile Include="Control\WeightSettingWindow.xaml.cs">
<DependentUpon>WeightSettingWindow.xaml</DependentUpon>
</Compile>
<Compile Include="FunctionSelectDialog.xaml.cs">
<DependentUpon>FunctionSelectDialog.xaml</DependentUpon>
</Compile>
<Compile Include="LoginWindow.xaml.cs">
<DependentUpon>LoginWindow.xaml</DependentUpon>
</Compile>
<Compile Include="SettingDialog.xaml.cs">
<DependentUpon>SettingDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Utils\AppContext.cs" />
<Compile Include="Utils\ControlAttachProperty.cs" />
<Compile Include="Utils\DbUtil.cs" />
<Compile Include="Utils\WindowUtil.cs" />
<Compile Include="Utils\XmlUtil.cs" />
<Compile Include="Windows\CarcassInStoreWindow_\CarcassInStoreWindow.xaml.cs">
<DependentUpon>CarcassInStoreWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\CarcassSaleOutWindow_\CarcassSaleOutWindow.xaml.cs">
<DependentUpon>CarcassSaleOutWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\FreshInStoreWindow_\FreshInStoreWindow.xaml.cs">
<DependentUpon>FreshInStoreWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\FreshSaleOutWindow_\FreshSaleOutWindow.xaml.cs">
<DependentUpon>FreshSaleOutWindow.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="BO\" />
</ItemGroup>
<ItemGroup>
<Page Include="Control\NumberPad.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Control\WeightControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Control\WeightSettingWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="FunctionSelectDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="LoginWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SettingDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Style\Border.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Style\Button.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Style\Calendar.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Style\CheckBox.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Style\Colors.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Style\ComboBox.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Style\DataGrid.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Style\DatePicker.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Style\TSIcon.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\CarcassInStoreWindow_\CarcassInStoreWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\CarcassSaleOutWindow_\CarcassSaleOutWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\FreshInStoreWindow_\FreshInStoreWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\FreshSaleOutWindow_\FreshSaleOutWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Resource Include="app.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\login.png" />
<Resource Include="Images\setting.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

+ 26
- 0
B3DealerClient/BL/LoginBL.cs View File

@ -0,0 +1,26 @@
using Forks.JsonRpc.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace B3DealerClient.BL
{
class LoginBL
{
internal static string GetUserNameByCode(string code)
{
var method = "/MainSystem/B3Dealer/Rpcs/BaseInfoRpc/GetUserNameByEmployeeCode";
var result = RpcFacade.Call<string>(method, code);
if (string.IsNullOrEmpty(result))
throw new Exception("编码错误");
return result;
}
internal static void Login(string userName, string pwd)
{
RpcFacade.Login(userName, pwd);
}
}
}

+ 70
- 0
B3DealerClient/Control/DataFormat/DataFormat.cs View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace B3DealerClient.Control
{
interface IDataFormat
{
char Beginchar { get; }
char Endchar { get; }
short Bufsize { get; }
bool ParseAscii(string buf, out string weight, out bool isStatic);
bool ParseAscii(string buf, out string weight, out bool isStatic, out string subStr);
}
internal abstract class DataFormatBase : IDataFormat
{
public abstract int DataLength
{
get;
}
public abstract char Beginchar
{
get;
}
public abstract char Endchar
{
get;
}
public abstract short Bufsize { get; }
public const short BUFSIZE = 36;
// 根据开始字符找出 一个完整的数据帧
public string FindDataFrame(string buf, int fSize)
{
var bufSize = buf.Length;
if (fSize > bufSize)
{
return string.Empty;
}
int index = buf.IndexOf(Beginchar); // 查找开始字符的索引
if (index < 0 || (index + fSize) > bufSize)
{
return string.Empty;
}
string data = buf.Substring(index, fSize);
// 检查结束字符
if (data[fSize - 1] != Endchar)
{
return string.Empty;
}
return data;
}
public abstract string ParseData(string buf, out bool isStatic);
public abstract bool ParseAscii(string buf, out string weight, out bool isStatic);
public abstract bool ParseAscii(string buf, out string weight, out bool isStatic, out string subStr);
}
}

+ 58
- 0
B3DealerClient/Control/DataFormat/IND560DataFormat.cs View File

@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace B3DealerClient.Control
{
internal class IND560DataFormat : DataFormatBase
{
public override int DataLength
{
get { return 10; }
}
public override char Beginchar
{
get { return (char)0x80; }//这种数据没有固定的开始标志
}
public override char Endchar
{
get { return (char)0x67; }
}
public override short Bufsize
{
get { return 36; }
}
public override string ParseData(string buf, out bool isStatic)
{
isStatic = false;
return string.Empty;
}
public override bool ParseAscii(string buf, out string weight, out bool isStatic)
{
isStatic = true;
weight = buf.Replace("kg", "").Replace((char)0x0D, (char)0x20).Replace((char)0x0A, (char)0x20).Replace((char)0x3F, (char)0x20);
weight = weight.Trim();
if (weight.Any(x => x == ' '))
{
var arr = weight.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
if (arr.Length > 1)
weight = arr[1];
}
return true;
}
public override bool ParseAscii(string buf, out string weight, out bool isStatic, out string subStr)
{
weight = "";
isStatic = false;
subStr = "";
return false;
}
}
}

+ 121
- 0
B3DealerClient/Control/DataFormat/Xk3124DataFormat.cs View File

@ -0,0 +1,121 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace B3DealerClient.Control
{
internal class Xk3124DataFormat : DataFormatBase
{
public override int DataLength
{
get { return 17; }
}
public override char Beginchar
{
get { return (char)0x02; }
}
public override char Endchar
{
get { return (char)0x0D; ; }
}
public override short Bufsize
{
get { return 36; }
}
public override string ParseData(string buf, out bool isStatic)
{
StringBuilder str = new StringBuilder();
char swa = buf[1]; // 状态字A
char swb = buf[2]; // 状态字B
int dotIndex = (swa & 0x07) - 2; // 小数点位置
bool isPositive = (((swb >> 1) & 0x01) == 0); // 符号:是否为正数
isStatic = (((swb >> 3) & 0x01) == 0);
char[] num = new char[6];
for (int i = 0; i < 6; i++)
{
num[i] = buf[i + 4];
}
if (dotIndex < 0)
{ // 不考虑精确到十,百位
return str.ToString();
}
for (int i = 0; i < 6 - dotIndex; i++)
{
str.Append(num[i]);
}
str.Append('.');
for (int i = 0; i < dotIndex; i++)
{
str.Append(num[6 - dotIndex + i]);
}
// 去掉空格
string result = str.ToString().Trim();
// 取消前面多余的0
for (int i = 0; i < result.Length; i++)
{
if (result[i] != '0')
{
result = result.Substring(i, result.Length - i);
break;
}
}
if (result.IndexOf('.') == 0)
{
result = result.Insert(0, "0");
}
if (result.IndexOf('.') == result.Length - 1)
{
result = result.Remove(result.IndexOf('.'), 1);
}
if (!isPositive)
{ // 负数
result = result.Insert(0, "-");
}
return result;
}
public override bool ParseAscii(string buf, out string weight, out bool isStatic)
{
isStatic = false;
weight = FindDataFrame(buf, DataLength);
if (string.IsNullOrEmpty(weight))
{
return false;
}
weight = ParseData(weight, out isStatic);
return true;
}
public override bool ParseAscii(string buf, out string weight, out bool isStatic, out string subStr)
{
weight = "";
isStatic = false;
subStr = "";
return false;
}
}
}

+ 136
- 0
B3DealerClient/Control/DataFormat/Xk3190A9DataFormat.cs View File

@ -0,0 +1,136 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace B3DealerClient.Control
{
internal class Xk3190A9DataFormat : DataFormatBase
{
public override int DataLength
{
get { return 12; }
}
public override char Beginchar
{
get { return (char)0x02; }
}
public override char Endchar
{
get { return (char)0x03; }
}
public override short Bufsize
{
get { return 36; }
}
public override string ParseData(string buf, out bool isStatic)
{
string weight;
// 小数位数0-4
int dot = (short)(0x0F & buf[8]);
weight = buf.Substring(2, 6).Trim();
// insert dot
weight = InsertDot(weight, dot);
isStatic = true; // 默认 为 稳定
// buffer[1] 符号位
if (buf[1] == '-')
{
weight = weight.Insert(0, "-");
}
return weight;
}
public override bool ParseAscii(string buf, out string weight, out bool isStatic)
{
isStatic = false;
weight = FindDataFrame(buf, DataLength);
if (string.IsNullOrEmpty(weight))
{
return false;
}
weight = ParseData(weight, out isStatic);
return true;
}
private static string InsertDot(string weight, int dotBits)
{
string str = weight.TrimStart(new[] {
'0'
});
str = str.Trim();
if (dotBits > 0)
{
//str = str.Insert(str.Length - dotBits, ".");
if (string.IsNullOrEmpty(str))
{
str = "0";
str = str.Insert(str.Length, ".");
for (int i = 0; i < dotBits; i++)
{
str = str.Insert(str.Length, "0");
}
}
else
str = str.Insert(str.Length - dotBits, ".");
}
if (str.IndexOf(".") == 0)
{
str = str.Insert(0, "0");
}
return str;
}
public override bool ParseAscii(string buf, out string weight, out bool isStatic, out string subStr)
{
isStatic = false;
weight = FindDataFrame(buf, DataLength, out subStr);
if (string.IsNullOrEmpty(weight))
{
return false;
}
weight = ParseData(weight, out isStatic);
return true;
}
// 根据开始字符找出 一个完整的数据帧
public string FindDataFrame(string buf, int fSize, out string subStr)
{
var bufSize = buf.Length;
subStr = "";
int index = buf.IndexOf(Beginchar); // 查找开始字符的索引
if (index < 0 || (index + fSize) > bufSize)
{
return string.Empty;
}
string data = buf.Substring(index, fSize);
subStr = buf.Substring(index + fSize);
// 检查结束字符
if (data[fSize - 1] != Endchar)
{
return string.Empty;
}
return data;
}
}
}

+ 60
- 0
B3DealerClient/Control/NumberPad.xaml View File

@ -0,0 +1,60 @@
<Window x:Class="B3DealerClient.Control.NumberPad"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="键盘" Height="420" Width="380" ShowInTaskbar="False"
WindowStartupLocation="CenterOwner" ResizeMode="NoResize" FontSize="32">
<Window.Resources>
<DropShadowEffect x:Key="DropShadowEffect" ShadowDepth="1" Direction="-90" BlurRadius="3" />
<Style TargetType="Label">
<Setter Property="Label.Effect" Value="{StaticResource DropShadowEffect}"/>
</Style>
<LinearGradientBrush x:Key="IPhoneSteelBackground" EndPoint="0.5,1.272" StartPoint="0.5,0">
<GradientStop Color="#FF9097A3" Offset="0"/>
<GradientStop Color="#FF444D5B" Offset="1"/>
</LinearGradientBrush>
<Style TargetType="Button">
<EventSetter Event="Click" Handler="button_Click" />
<Setter Property="Margin" Value="4"/>
<Setter Property="Button.Effect" Value="{StaticResource DropShadowEffect}"/>
<Setter Property="Background" Value="WhiteSmoke"/>
<Setter Property="RenderTransform">
<Setter.Value>
<!-- Workaround for ATI video cards that don't render good with dropshadoweffect-->
<RotateTransform Angle="0.00000000001"/>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid Background="{DynamicResource IPhoneSteelBackground}">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Button Grid.Row="1" Grid.Column="0" BorderThickness="1" BorderBrush="Gray" CommandParameter="NUMPAD7" >7</Button>
<Button Grid.Row="1" Grid.Column="1" CommandParameter="NUMPAD8" BorderThickness="1" Content="8" />
<Button Grid.Row="1" Grid.Column="2" CommandParameter="NUMPAD9" Content="9" />
<Button x:Name="back" Grid.Row="1" Grid.Column="3" CommandParameter="BACK" >
<Path Stretch="Fill" Width="36" Height="24" Data="F1M555.0371,274.4893L552.7871,276.7383L549.9861,273.9373L547.1991,276.7243L545.1131,274.6393L547.9001,271.8523L545.0101,268.9603L547.2601,266.7113L550.1501,269.6023L552.8921,266.8613L554.9761,268.9463L552.2361,271.6883z M555.3751,264.0003L544.8751,264.0003C543.1251,264.1253,535.0001,270.7503,535.0001,272.2503C535.0001,273.7503,543.1251,279.3753,544.8751,279.5003L555.3751,279.5003C558.8751,279.5003,559.3751,277.7093,559.3751,275.5003L559.3751,268.0003C559.3751,265.7913,558.7501,264.0003,555.3751,264.0003" Fill="#FF333333"/>
</Button>
<Button Grid.Row="2" Grid.Column="0" x:Name="button9" CommandParameter="NUMPAD4" Content="4"/>
<Button Grid.Row="2" Grid.Column="1" CommandParameter="NUMPAD5" Content="5" />
<Button Grid.Row="2" Grid.Column="2" CommandParameter="NUMPAD6" Content="6" />
<Button Grid.Row="3" Grid.Column="0" CommandParameter="NUMPAD1" Content="1"/>
<Button Grid.Row="3" Grid.Column="1" CommandParameter="NUMPAD2" Content="2"/>
<Button Grid.Row="3" Grid.Column="2" CommandParameter="NUMPAD3" Content="3" />
<Button Grid.Row="2" Grid.Column="3" Grid.RowSpan="3" CommandParameter="RETURN" Content="确认"/>
<Button Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" CommandParameter="NUMPAD0" Content="0" />
<Button Grid.Row="4" Grid.Column="2" CommandParameter="DECIMAL" Content="." />
<Label Grid.Column="0" Grid.ColumnSpan="4" x:Name="lbl" Content="{Binding Result}" HorizontalContentAlignment="Right" Background="WhiteSmoke" Margin="4"/>
</Grid>
</Window>

+ 85
- 0
B3DealerClient/Control/NumberPad.xaml.cs View File

@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
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.Shapes;
namespace B3DealerClient.Control
{
/// <summary>
/// NumberPad.xaml 的交互逻辑
/// </summary>
public partial class NumberPad : Window, INotifyPropertyChanged
{
#region Public Properties
private string _result = string.Empty;
public string Result
{
get { return _result; }
private set
{
if (_result != value)
{
_result = value;
this.OnPropertyChanged("Result");
}
}
}
#endregion
public NumberPad(Window owner)
{
InitializeComponent();
this.Owner = owner;
lbl.DataContext = this;
}
private void button_Click(object sender, RoutedEventArgs e)
{
Button button = sender as Button;
switch (button.CommandParameter.ToString())
{
case "ESC":
this.Close();
break;
case "RETURN":
this.DialogResult = true;
break;
case "BACK":
if (Result.Length > 0)
Result = Result.Remove(Result.Length - 1);
break;
default:
Result += button.Content.ToString();
break;
}
}
#region INotifyPropertyChanged members
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(String info)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(info));
}
}
#endregion
}
}

+ 37
- 0
B3DealerClient/Control/WeightConfig.cs View File

@ -0,0 +1,37 @@
using B3DealerClient.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace B3DealerClient.Control
{
public class WeightConfig
{
public string WeightSet { get; set; }
public string ComSet { get; set; }
public int? RateSet { get; set; }
public int? BitSet { get; set; }
public string Format { get; set; }
public decimal? Discont { get; set; }
public static WeightConfig Init(string flag)
{
var path = Path.Combine("Config", flag + "WeightConfig.xml");
return XmlUtil.DeserializeFromFile<WeightConfig>(path);
}
public void Save(string flag)
{
var path = Path.Combine("Config", flag + "WeightConfig.xml");
XmlUtil.SerializerObjToFile(this, path);
}
}
}

+ 27
- 0
B3DealerClient/Control/WeightControl.xaml View File

@ -0,0 +1,27 @@
<UserControl x:Class="B3DealerClient.Control.WeightControl"
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"
mc:Ignorable="d"
d:DesignHeight="80" d:DesignWidth="240">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.6*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.RowSpan="2" CornerRadius="5" Background="Black" Margin="0,0,5,0">
<Label Name="lblChengZhong" Content="0" Foreground="Red" FontSize="28" FontFamily="DigifaceWide" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</Border>
<Button Name="weightSetBtn" Grid.Column="1" Content="称设置" FontSize="15" Margin="0,0,0,3" Click="weightSetBtn_Click"/>
<Button Name="weightSwitch" Grid.Column="1" Grid.Row="1" Content="启用称重" Margin="0,3,0,0" FontSize="15" Click="weightSwitch_Click"/>
</Grid>
</UserControl>

+ 256
- 0
B3DealerClient/Control/WeightControl.xaml.cs View File

@ -0,0 +1,256 @@
using B3DealerClient.Utils;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO.Ports;
using System.Linq;
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 B3DealerClient.Control
{
/// <summary>
/// WeightControl.xaml 的交互逻辑
/// </summary>
public partial class WeightControl : UserControl, IDisposable
{
WeightConfig config;
SerialPort weightPort;
IDataFormat _dataFormat;
Thread _inQueryThread;
private bool _mainProcessIsRun;
readonly StringBuilder _dataStrBuilder = new StringBuilder();
private bool switchOn;
[Browsable(true), Description("称设置标识")]
public string WeightFalg { get; set; }
//[Browsable(true), Description("读取到值的事件")]
public event Action<decimal> ReceivedValue;
public event Action BeforeStart;
[Browsable(false)]
public decimal Weight
{
get
{
var v = Convert.ToDecimal(lblChengZhong.Content);
if (config != null)
v -= (config.Discont ?? 0);
return v;
}
}
[Browsable(false)]
public bool SwitchOn
{
get
{
return switchOn;
}
}
[Browsable(false)]
public decimal? Discont { get { return config.Discont; } }
public WeightControl()
{
InitializeComponent();
this.Loaded += WeightControl_Loaded;
}
void WeightControl_Loaded(object sender, RoutedEventArgs e)
{
var parentWindow = WindowUtil.GetParentWindow(this);
if (parentWindow != null)
{
parentWindow.Closing += delegate
{
if (_inQueryThread != null && _inQueryThread.IsAlive)
{
DisableWeight();
}
};
}
}
private void weightSetBtn_Click(object sender, RoutedEventArgs e)
{
if (new WeightSettingWindow(WeightFalg).ShowDialog() == true)
config = WeightConfig.Init(WeightFalg);
}
private void weightSwitch_Click(object sender, RoutedEventArgs e)
{
try
{
if (config == null)
{
config = WeightConfig.Init(WeightFalg);
}
weightSetBtn.IsEnabled = switchOn;
switchOn = !switchOn;
ChangeWeightBtnState();
if (switchOn)
{
if (BeforeStart != null)
BeforeStart();
OpenSerialPort();
_mainProcessIsRun = true;
ReadData();
}
else
{
DisableWeight();
}
}
catch
{
switchOn = !switchOn;
weightSetBtn.IsEnabled = !switchOn;
ChangeWeightBtnState();
throw;
}
}
void ChangeWeightBtnState()
{
if (switchOn)
weightSwitch.Content = "停止称重";
else
weightSwitch.Content = "启用称重";
}
void OpenSerialPort()
{
if (!switchOn)
return;
if (config.RateSet == null)
throw new Exception("请先配置称相关信息");
weightPort = new SerialPort();
weightPort.PortName = config.ComSet;
weightPort.BaudRate = config.RateSet.Value;
weightPort.DataBits = config.BitSet.Value;
weightPort.ReadBufferSize = 4096 * 100;
if (!string.IsNullOrEmpty(config.Format))
format = "{0:{format}}".Replace("{format}", config.Format);
switch (config.WeightSet)
{
case "IND560":
_dataFormat = new IND560DataFormat();
break;
case "Xk3124":
case "IND231":
_dataFormat = new Xk3124DataFormat();
break;
case "Xk3190A9":
_dataFormat = new Xk3190A9DataFormat();
break;
}
if (!weightPort.IsOpen)
{
try
{
weightPort.Open();
}
catch (InvalidOperationException)
{
throw new Exception("指定的端口已打开");
}
catch (UnauthorizedAccessException)
{
throw new Exception("对端口的访问被拒绝");
}
}
}
void ReadData()
{
_inQueryThread = new Thread(InQuery);
_inQueryThread.Start();
}
string format = "{0:0.00}";
private void InQuery()
{
while (_mainProcessIsRun)
{
int availableCount = weightPort.BytesToRead;
if (availableCount == 0)
{
Thread.Sleep(10);
}
char[] buffer = new char[availableCount];
weightPort.Read(buffer, 0, availableCount);
foreach (var c in buffer)
{
if (c == _dataFormat.Beginchar)
{
_dataStrBuilder.Clear();
_dataStrBuilder.Append(c);
}
else if (c == _dataFormat.Endchar || _dataStrBuilder.Length > _dataFormat.Bufsize)
{
_dataStrBuilder.Append(c);
bool isStatic;
string str;
if (_dataFormat.ParseAscii(_dataStrBuilder.ToString(), out str, out isStatic))
{
if (string.IsNullOrEmpty(str))
str = "0";
decimal v = 0;
decimal.TryParse(str, out v);
this.Dispatcher.BeginInvoke(new Action(() =>
{
lblChengZhong.Content = string.Format(format, v);
}));
if (str != "0")
{
if (ReceivedValue != null)
ReceivedValue(v - (config.Discont ?? 0));
}
}
_dataStrBuilder.Clear();
}
else
{
_dataStrBuilder.Append(c);
}
}
}
}
void DisableWeight()
{
_mainProcessIsRun = false;
lblChengZhong.Content = string.Format(format, 0);
format = "{0:0.00}";
Thread.Sleep(10);
if (_inQueryThread.IsAlive)
{
_inQueryThread.Abort();
}
if (weightPort.IsOpen)
weightPort.Close();
}
public void Dispose()
{
((IDisposable)weightPort).Dispose();
}
}
}

+ 53
- 0
B3DealerClient/Control/WeightSettingWindow.xaml View File

@ -0,0 +1,53 @@
<Window x:Class="B3DealerClient.Control.WeightSettingWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="称设置" Height="420" Width="300" ResizeMode="NoResize" WindowStartupLocation="CenterOwner" FontSize="18">
<Window.Resources>
<Style TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,0,10,0"/>
</Style>
<Style TargetType="ComboBox">
<Setter Property="Margin" Value="8"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<Style TargetType="TextBox">
<Setter Property="Margin" Value="8"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
</Window.Resources>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="85"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="称型号" />
<ComboBox Name="weightSet" Grid.Column="1" />
<TextBlock Text="端口号" Grid.Row="1"/>
<ComboBox Name="comSet" Grid.Column="1" Grid.Row="1" />
<TextBlock Text="波特率" Grid.Row="2"/>
<ComboBox Name="rateSet" Grid.Column="1" Grid.Row="2" />
<TextBlock Text="数据位" Grid.Row="3"/>
<ComboBox Name="bitSet" Grid.Column="1" Grid.Row="3"/>
<TextBlock Text="显示格式" Grid.Row="4"/>
<TextBox Name="format" Grid.Column="1" Grid.Row="4" />
<TextBlock Text="扣重" Grid.Row="5"/>
<TextBox Name="discont" Grid.Column="1" Grid.Row="5"/>
<StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" Grid.Row="6" HorizontalAlignment="Center">
<Button Name="saveBtn" Content="保存" Width="90" Height="40" Margin="0,0,15,0" Click="saveBtn_Click"/>
<Button Name="closeBtn" Content="关闭" Width="90" Height="40" Margin="15,0,0,0" Click="closeBtn_Click"/>
</StackPanel>
</Grid>
</Window>

+ 94
- 0
B3DealerClient/Control/WeightSettingWindow.xaml.cs View File

@ -0,0 +1,94 @@
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.Shapes;
namespace B3DealerClient.Control
{
/// <summary>
/// WeightSettingWindow.xaml 的交互逻辑
/// </summary>
public partial class WeightSettingWindow : Window
{
List<string> weight = new List<string> { "IND560", "Xk3124", "Xk3190A9" };
List<string> com = new List<string> { "COM1", "COM2", "COM3", "COM4", "COM5" };
List<string> rate = new List<string> { "1200", "2400", "4800", "7200", "9600" };
List<string> bit = new List<string> { "5", "6", "7", "8" };
string _flag;
WeightConfig config;
public WeightSettingWindow(string flag)
{
this._flag = flag;
InitializeComponent();
weightSet.ItemsSource = weight;
comSet.ItemsSource = com;
rateSet.ItemsSource = rate;
bitSet.ItemsSource = bit;
config = WeightConfig.Init(flag);
if (!string.IsNullOrEmpty(config.WeightSet))
weightSet.SelectedIndex = weight.IndexOf(config.WeightSet);
else
weightSet.SelectedIndex = 0;
if (!string.IsNullOrEmpty(config.ComSet))
comSet.SelectedIndex = com.IndexOf(config.ComSet);
else
comSet.SelectedIndex = 0;
if (config.RateSet.HasValue)
rateSet.SelectedIndex = rate.IndexOf(config.RateSet.ToString());
else
rateSet.SelectedIndex = 2;
if (config.BitSet.HasValue)
bitSet.SelectedIndex = bit.IndexOf(config.BitSet.ToString());
else
bitSet.SelectedIndex = 3;
if (string.IsNullOrEmpty(config.Format))
format.Text = "0.00";
else
format.Text = config.Format;
if (config.Discont == null)
discont.Text = "0.00";
else
discont.Text = config.Discont.ToString();
}
bool changed;
private void saveBtn_Click(object sender, RoutedEventArgs e)
{
config.WeightSet = weight[this.weightSet.SelectedIndex];
config.ComSet = com[this.comSet.SelectedIndex];
config.RateSet = int.Parse(rate[this.rateSet.SelectedIndex]);
config.BitSet = int.Parse(bit[this.bitSet.SelectedIndex]);
config.Format = format.Text;
if (!string.IsNullOrEmpty(discont.Text))
{
decimal v;
if (decimal.TryParse(discont.Text, out v))
config.Discont = v;
else
throw new Exception("扣重格式输入不正确");
}
else
config.Discont = 0;
config.Save(_flag);
changed = true;
MessageBox.Show("保存成功!");
}
private void closeBtn_Click(object sender, RoutedEventArgs e)
{
if (changed)
DialogResult = true;
this.Close();
}
}
}

+ 25
- 0
B3DealerClient/FunctionSelectDialog.xaml View File

@ -0,0 +1,25 @@
<Window x:Class="B3DealerClient.FunctionSelectDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="功能选择" Height="500" Width="500" FontSize="19" ResizeMode="NoResize">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.Resources>
<Style TargetType="Button" BasedOn="{StaticResource DefaultButton}">
<Setter Property="Margin" Value="50"/>
<EventSetter Event="Click" Handler="FuncionSelect"/>
</Style>
</Grid.Resources>
<Button Content="白条收货" Tag="0"/>
<Button Grid.Column="1" Content="白条发货" Tag="1"/>
<Button Grid.Row="1" Content="鲜品收货" Tag="2"/>
<Button Grid.Row="1" Grid.Column="1" Content="鲜品发货" Tag="3"/>
</Grid>
</Window>

+ 61
- 0
B3DealerClient/FunctionSelectDialog.xaml.cs View File

@ -0,0 +1,61 @@
using B3DealerClient.Windows.CarcassInStoreWindow_;
using B3DealerClient.Windows.CarcassSaleOutWindow_;
using B3DealerClient.Windows.FreshInStoreWindow_;
using B3DealerClient.Windows.FreshSaleOutWindow_;
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.Shapes;
namespace B3DealerClient
{
/// <summary>
/// FunctionSelectDialog.xaml 的交互逻辑
/// </summary>
public partial class FunctionSelectDialog : Window
{
public FunctionSelectDialog()
{
InitializeComponent();
}
private void FuncionSelect(object sender, RoutedEventArgs e)
{
var fuc = (sender as Button).Tag.ToString();
Window window = null;
switch (fuc)
{
case "0":
window = new CarcassInStoreWindow();
break;
case "1":
window = new CarcassSaleOutWindow();
break;
case "2":
window = new FreshInStoreWindow();
break;
case "3":
window = new FreshSaleOutWindow();
break;
}
if (window != null)
{
window.Closing += delegate
{
this.Show();
};
window.Show();
this.Hide();
}
}
}
}

BIN
B3DealerClient/Images/login.png View File

Before After
Width: 582  |  Height: 393  |  Size: 228 KiB

BIN
B3DealerClient/Images/setting.png View File

Before After
Width: 64  |  Height: 64  |  Size: 1.5 KiB

+ 25
- 0
B3DealerClient/LoginWindow.xaml View File

@ -0,0 +1,25 @@
<Window x:Class="B3DealerClient.LoginWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="LoginWindow" Height="433" Width="622" WindowStyle="None" AllowsTransparency="True"
ResizeMode="NoResize" BorderThickness="40" MouseLeftButtonDown="Window_MouseLeftButtonDown"
Loaded="Window_Loaded">
<Window.Background>
<ImageBrush ImageSource="images/login.png"/>
</Window.Background>
<Window.Effect>
<DropShadowEffect BlurRadius="40" Color="#000000" ShadowDepth="0"/>
</Window.Effect>
<Canvas>
<Image Source="images\setting.png" Canvas.Right="10" Canvas.Top="10" Width="32" PreviewMouseDown="Image_PreviewMouseDown"/>
<Label Content="用户名" FontFamily="微软雅黑" FontSize="22px" Canvas.Left="130" Canvas.Top="142" Width="90" Foreground="Gray"/>
<TextBox Name="userNameInput" Canvas.Left="220" Canvas.Top="145" FontFamily="微软雅黑" FontSize="18" Height="35" Width="187" Padding="5,0,0,0" VerticalContentAlignment="Center" PreviewMouseDown="userNameInput_PreviewMouseDown"/>
<Label Content="密 码" FontFamily="微软雅黑" FontSize="22px" Canvas.Left="130" Canvas.Top="192" Width="90" Foreground="Gray"/>
<PasswordBox Name="pwdInput" Canvas.Left="220" Canvas.Top="195" FontSize="18" Height="35" Width="187" Padding="5,0,0,0" VerticalContentAlignment="Center" PreviewMouseDown="pwdInput_PreviewMouseDown" Password=""/>
<Button Name="loginBtn" IsDefault="True" Content="登录" Canvas.Left="145" Canvas.Top="255" Width="110" Height="45" FontSize="18" Click="loginBtn_Click">
</Button>
<Button Style="{x:Null}" Content="退出" Canvas.Left="290" Canvas.Top="255" Width="110" Height="45" FontSize="18" BorderBrush="#A0A0A0" Click="ExitBtn_Click"/>
</Canvas>
</Window>

+ 89
- 0
B3DealerClient/LoginWindow.xaml.cs View File

@ -0,0 +1,89 @@
using B3DealerClient.BL;
using B3DealerClient.Control;
using B3DealerClient.Utils;
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.Shapes;
namespace B3DealerClient
{
/// <summary>
/// LoginWindow.xaml 的交互逻辑
/// </summary>
public partial class LoginWindow : Window
{
public LoginWindow()
{
InitializeComponent();
}
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
this.DragMove();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
userNameInput.Text = AppContext.Instance.UserName;
}
private void Image_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
new SettingDialog().ShowDialog();
}
private void loginBtn_Click(object sender, RoutedEventArgs e)
{
if (string.IsNullOrEmpty(userNameInput.Text))
throw new Exception("请输入用户名");
AppContext.InitRpc();
LoginBL.Login(userNameInput.Text, pwdInput.Password);
AppContext.Instance.UserName = userNameInput.Text;
AppContext.Save();
AfterLogin();
}
void AfterLogin()
{
var dialog = new FunctionSelectDialog();
dialog.Closing += delegate { this.Show(); };
dialog.Show();
this.Hide();
}
private void ExitBtn_Click(object sender, RoutedEventArgs e)
{
App.Current.Shutdown();
}
private void userNameInput_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
var dialog = new NumberPad(this);
if (dialog.ShowDialog() == true)
{
if (!string.IsNullOrEmpty(dialog.Result))
{
AppContext.InitRpc();
userNameInput.Text = LoginBL.GetUserNameByCode(dialog.Result);
}
}
}
private void pwdInput_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
var dialog = new NumberPad(this);
if (dialog.ShowDialog() == true)
pwdInput.Password = dialog.Result;
}
}
}

+ 55
- 0
B3DealerClient/Properties/AssemblyInfo.cs View File

@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("B3DealerClient")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("B3DealerClient")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请在
//<PropertyGroup> 中的 .csproj 文件中
//设置 <UICulture>CultureYouAreCodingWith</UICulture>。 例如,如果您在源文件中
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(在页面或应用程序资源词典中
// 未找到某个资源的情况下使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(在页面、应用程序或任何主题特定资源词典中
// 未找到某个资源的情况下使用)
)]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

+ 71
- 0
B3DealerClient/Properties/Resources.Designer.cs View File

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace B3DealerClient.Properties
{
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// 返回此类使用的、缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("B3DealerClient.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 为所有资源查找重写当前线程的 CurrentUICulture 属性,
/// 方法是使用此强类型资源类。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

+ 117
- 0
B3DealerClient/Properties/Resources.resx View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

+ 30
- 0
B3DealerClient/Properties/Settings.Designer.cs View File

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace B3DealerClient.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

+ 7
- 0
B3DealerClient/Properties/Settings.settings View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

+ 34
- 0
B3DealerClient/SettingDialog.xaml View File

@ -0,0 +1,34 @@
<Window x:Class="B3DealerClient.SettingDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="系统设置" Height="400" Width="400" ShowInTaskbar="False"
WindowStartupLocation="CenterOwner" ResizeMode="NoResize" FontSize="16" Loaded="Window_Loaded">
<Window.Resources>
<Style TargetType="Button" BasedOn="{StaticResource DefaultButton}">
<EventSetter Event="Click" Handler="Button_Click" />
</Style>
</Window.Resources>
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="服务器地址:" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,0,0"/>
<TextBox x:Name="ServerUrlInput" Grid.Column="1" Width="220" Margin="10" TextWrapping="Wrap"/>
<TextBlock Grid.Row="1" Text="服务数据库:" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,0,0"/>
<TextBox x:Name="DbConnectInput" Grid.Row="1" Grid.Column="1" Width="220" Margin="10" TextWrapping="Wrap"/>
<StackPanel Orientation="Horizontal" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Center">
<Button Content="保存" Width="80" Height="40" Margin="15,5"/>
<Button Content="升级" Width="80" Height="40" Margin="15,5"/>
<Button Content="关闭" Width="80" Height="40" Margin="15,5"/>
</StackPanel>
</Grid>
</Window>

+ 92
- 0
B3DealerClient/SettingDialog.xaml.cs View File

@ -0,0 +1,92 @@
using B3DealerClient.Control;
using B3DealerClient.Utils;
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.Shapes;
namespace B3DealerClient
{
/// <summary>
/// SettingDialog.xaml 的交互逻辑
/// </summary>
public partial class SettingDialog : Window
{
public SettingDialog()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
ServerUrlInput.Text = AppContext.Instance.ServerUrl;
DbConnectInput.Text = AppContext.Instance.SqlConnection;
}
private void Button_Click(object sender, RoutedEventArgs e)
{
var btn = (sender as Button).Content.ToString();
switch (btn)
{
case "保存":
Save();
break;
case "升级":
Update();
break;
default:
Close();
break;
}
}
void Save()
{
string uri = ServerUrlInput.Text.Trim();
if (string.IsNullOrEmpty(uri))
throw new Exception("服务器地址不能为空");
string dbConnect = DbConnectInput.Text.Trim();
if (string.IsNullOrEmpty(dbConnect))
throw new Exception("数据库设置不能为空");
AppContext.Instance.ServerUrl = uri;
AppContext.Instance.SqlConnection = dbConnect;
AppContext.Save();
AppContext.ReInitRpc();
MessageBox.Show("保存成功!");
}
void Update()
{
if (string.IsNullOrEmpty(AppContext.Instance.SqlConnection))
throw new Exception("请设置数据库连接");
try
{
DbUtil.UpdateDatabase(AppContext.Instance.SqlConnection);
}
catch (Exception ex)
{
MessageBox.Show(string.Format("错误:{0}。详情:{1}", ex.Message, ex.StackTrace));
return;
}
MessageBox.Show("数据库升级成功");
}
//private void ServerUrlInput_PreviewMouseDown(object sender, MouseButtonEventArgs e)
//{
// var pad = new NumberPad(this);
// if (pad.ShowDialog() == true)
// {
// ServerUrlInput.Text = pad.Result;
// }
//}
}
}

+ 8
- 0
B3DealerClient/Style/Border.xaml View File

@ -0,0 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="DefaultBorder" TargetType="Border">
<Setter Property="CornerRadius" Value="3"/>
<Setter Property="BorderBrush" Value="LightGray"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
</ResourceDictionary>

+ 31
- 0
B3DealerClient/Style/Button.xaml View File

@ -0,0 +1,31 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="DefaultButton" TargetType="Button">
<Setter Property="Background" Value="#2B6DE8"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Name="border" BorderThickness="0" CornerRadius="3" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Control.Background" Value="#286CB5"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Control.Background" Value="Black"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Control.Background" Value="#BABABA"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="RedButton" TargetType="Button" BasedOn="{StaticResource DefaultButton}">
<Setter Property="Background" Value="Red"/>
</Style>
</ResourceDictionary>

+ 414
- 0
B3DealerClient/Style/Calendar.xaml View File

@ -0,0 +1,414 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="CalendarDayButtonStyle" TargetType="{x:Type CalendarDayButton}">
<Setter Property="MinWidth" Value="5"/>
<Setter Property="MinHeight" Value="5"/>
<Setter Property="FontSize" Value="10"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CalendarDayButton}">
<Grid Width="60" Height="60">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.1"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="HighlightBackground"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="HighlightBackground"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="HighlightBackground"/>
<DoubleAnimation Duration="0" To=".35" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="NormalText"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="SelectionStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Unselected"/>
<VisualState x:Name="Selected">
<Storyboard>
<DoubleAnimation Duration="0" To=".75" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedBackground"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CalendarButtonFocusStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="CalendarButtonFocused">
<Storyboard>
<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DayButtonFocusVisual">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="CalendarButtonUnfocused">
<Storyboard>
<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DayButtonFocusVisual">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="ActiveStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Active"/>
<VisualState x:Name="Inactive">
<Storyboard>
<ColorAnimation Duration="0" To="#FF777777" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="NormalText"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="DayStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="RegularDay"/>
<VisualState x:Name="Today">
<Storyboard>
<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="TodayBackground"/>
<ColorAnimation Duration="0" To="#FFFFFFFF" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="NormalText"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="BlackoutDayStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="NormalDay"/>
<VisualState x:Name="BlackoutDay">
<Storyboard>
<DoubleAnimation Duration="0" To=".2" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Blackout"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="TodayBackground" Fill="#FFAAAAAA" Opacity="0" RadiusY="1" RadiusX="1"/>
<Rectangle x:Name="SelectedBackground" Fill="#FFBADDE9" Opacity="0" RadiusY="1" RadiusX="1"/>
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"/>
<Rectangle x:Name="HighlightBackground" Fill="#FFBADDE9" Opacity="0" RadiusY="1" RadiusX="1"/>
<ContentPresenter x:Name="NormalText" TextElement.FontSize="16" TextElement.Foreground="#FF333333" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="5,1,5,1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
<Path x:Name="Blackout" Data="M8.1772461,11.029181 L10.433105,11.029181 L11.700684,12.801641 L12.973633,11.029181 L15.191895,11.029181 L12.844727,13.999395 L15.21875,17.060919 L12.962891,17.060919 L11.673828,15.256231 L10.352539,17.060919 L8.1396484,17.060919 L10.519043,14.042364 z" Fill="#FF000000" HorizontalAlignment="Stretch" Margin="3" Opacity="0" RenderTransformOrigin="0.5,0.5" Stretch="Fill" VerticalAlignment="Stretch"/>
<Rectangle x:Name="DayButtonFocusVisual" IsHitTestVisible="false" RadiusY="1" RadiusX="1" Stroke="#FF45D6FA" Visibility="Collapsed"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CalendarItemStyle1" TargetType="{x:Type CalendarItem}">
<Setter Property="Margin" Value="0,3,0,3"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CalendarItem}">
<ControlTemplate.Resources>
<DataTemplate x:Key="{x:Static CalendarItem.DayTitleTemplateResourceKey}">
<TextBlock Foreground="#FF333333" FontWeight="Bold" FontSize="11" FontFamily="Verdana" HorizontalAlignment="Center" Margin="0,6,0,6" Text="{Binding}" VerticalAlignment="Center"/>
</DataTemplate>
</ControlTemplate.Resources>
<Grid x:Name="PART_Root">
<Grid.Resources>
<SolidColorBrush x:Key="DisabledColor" Color="#A5FFFFFF"/>
</Grid.Resources>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_DisabledVisual"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="1">
<Border BorderBrush="#FFFFFFFF" BorderThickness="2" CornerRadius="1">
<Grid>
<Grid.Resources>
<ControlTemplate x:Key="PreviousButtonTemplate" TargetType="{x:Type Button}">
<Grid Cursor="Hand">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimation Duration="0" To="#FF73A9D8" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="path"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="(Shape.Fill).(Brush.Opacity)" Storyboard.TargetName="path"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle Fill="#11E5EBF1" Opacity="1" Stretch="Fill"/>
<Grid>
<Path x:Name="path" Data="M288.75,232.25 L288.75,240.625 L283,236.625 z" Fill="#FF333333" HorizontalAlignment="Left" Height="20" Margin="14,-6,0,0" Stretch="Fill" VerticalAlignment="Center" Width="12"/>
</Grid>
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="NextButtonTemplate" TargetType="{x:Type Button}">
<Grid Cursor="Hand">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimation Duration="0" To="#FF73A9D8" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="path"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="(Shape.Fill).(Brush.Opacity)" Storyboard.TargetName="path"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle Fill="#11E5EBF1" Opacity="1" Stretch="Fill"/>
<Grid>
<Path x:Name="path" Data="M282.875,231.875 L282.875,240.375 L288.625,236 z" Fill="#FF333333" HorizontalAlignment="Right" Height="20" Margin="0,-6,14,0" Stretch="Fill" VerticalAlignment="Center" Width="12"/>
</Grid>
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="HeaderButtonTemplate" TargetType="{x:Type Button}">
<Grid Cursor="Hand">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimation Duration="0" To="#FF73A9D8" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="buttonContent"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="buttonContent"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter x:Name="buttonContent" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" TextElement.Foreground="#FF333333" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1,4,1,9" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</ControlTemplate>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button x:Name="PART_PreviousButton" Grid.Column="0" Focusable="False" HorizontalAlignment="Left" Height="20" Grid.Row="0" Template="{StaticResource PreviousButtonTemplate}" Width="30"/>
<Button x:Name="PART_HeaderButton" Grid.Column="1" FontWeight="Bold" Focusable="False" FontSize="16" HorizontalAlignment="Center" Grid.Row="0" Template="{StaticResource HeaderButtonTemplate}" VerticalAlignment="Center"/>
<Button x:Name="PART_NextButton" Grid.Column="2" Focusable="False" HorizontalAlignment="Right" Height="20" Grid.Row="0" Template="{StaticResource NextButtonTemplate}" Width="30"/>
<Grid x:Name="PART_MonthView" Grid.ColumnSpan="3" HorizontalAlignment="Center" Margin="6,10,6,6" Grid.Row="1" Visibility="Visible">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
</Grid>
<Grid x:Name="PART_YearView" Grid.ColumnSpan="3" HorizontalAlignment="Center" Margin="6,35,6,6" Grid.Row="1" Visibility="Hidden">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
</Grid>
</Grid>
</Border>
</Border>
<Rectangle x:Name="PART_DisabledVisual" Fill="{StaticResource DisabledColor}" Opacity="0" RadiusY="2" RadiusX="2" Stretch="Fill" Stroke="{StaticResource DisabledColor}" StrokeThickness="1" Visibility="Collapsed"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Visibility" TargetName="PART_DisabledVisual" Value="Visible"/>
</Trigger>
<DataTrigger Binding="{Binding DisplayMode, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Calendar}}}" Value="Year">
<Setter Property="Visibility" TargetName="PART_MonthView" Value="Hidden"/>
<Setter Property="Visibility" TargetName="PART_YearView" Value="Visible"/>
</DataTrigger>
<DataTrigger Binding="{Binding DisplayMode, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Calendar}}}" Value="Decade">
<Setter Property="Visibility" TargetName="PART_MonthView" Value="Hidden"/>
<Setter Property="Visibility" TargetName="PART_YearView" Value="Visible"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CalendarButtonStyle1" TargetType="{x:Type CalendarButton}">
<Setter Property="Background" Value="#FFBADDE9"/>
<Setter Property="MinWidth" Value="40"/>
<Setter Property="MinHeight" Value="42"/>
<Setter Property="FontSize" Value="10"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CalendarButton}">
<Grid Width="105" Height="105">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.1"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="SelectionStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Unselected"/>
<VisualState x:Name="Selected">
<Storyboard>
<DoubleAnimation Duration="0" To=".75" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedBackground"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="ActiveStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Active"/>
<VisualState x:Name="Inactive">
<Storyboard>
<ColorAnimation Duration="0" To="#FF777777" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="NormalText"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CalendarButtonFocusStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="CalendarButtonFocused">
<Storyboard>
<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="CalendarButtonFocusVisual">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="CalendarButtonUnfocused">
<Storyboard>
<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="CalendarButtonFocusVisual">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="SelectedBackground" Fill="{TemplateBinding Background}" Opacity="0" RadiusY="1" RadiusX="1"/>
<Rectangle x:Name="Background" Fill="{TemplateBinding Background}" Opacity="0" RadiusY="1" RadiusX="1"/>
<ContentPresenter x:Name="NormalText" TextElement.Foreground="#FF333333" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1,0,1,1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" TextElement.FontSize="20"/>
<Rectangle x:Name="CalendarButtonFocusVisual" IsHitTestVisible="false" RadiusY="1" RadiusX="1" Stroke="#FF45D6FA" Visibility="Collapsed"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Visibility" TargetName="CalendarButtonFocusVisual" Value="Visible"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CalendarStyle1" TargetType="{x:Type Calendar}">
<Setter Property="Foreground" Value="#FF333333"/>
<Setter Property="CalendarDayButtonStyle" Value="{StaticResource CalendarDayButtonStyle}" />
<Setter Property="CalendarItemStyle" Value="{StaticResource CalendarItemStyle1}"/>
<Setter Property="CalendarButtonStyle" Value="{StaticResource CalendarButtonStyle1}"/>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFE4EAF0" Offset="0"/>
<GradientStop Color="#FFECF0F4" Offset="0.16"/>
<GradientStop Color="#FFFCFCFD" Offset="0.16"/>
<GradientStop Color="#FFFFFFFF" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="BorderBrush">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFA3AEB9" Offset="0"/>
<GradientStop Color="#FF8399A9" Offset="0.375"/>
<GradientStop Color="#FF718597" Offset="0.375"/>
<GradientStop Color="#FF617584" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Calendar}">
<StackPanel x:Name="PART_Root" HorizontalAlignment="Center">
<CalendarItem x:Name="PART_CalendarItem" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Style="{TemplateBinding CalendarItemStyle}"/>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

+ 43
- 0
B3DealerClient/Style/CheckBox.xaml View File

@ -0,0 +1,43 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:B3DealerClient.Utils">
<Style x:Key="DefaultCheckBox" TargetType="{x:Type CheckBox}">
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="Foreground" Value="{StaticResource TextForeground}"></Setter>
<Setter Property="Padding" Value="0"></Setter>
<Setter Property="local:ControlAttachProperty.IconMargin" Value="1, 1, 3, 1"></Setter>
<Setter Property="local:ControlAttachProperty.IconSize" Value="18"></Setter>
<Setter Property="FontSize" Value="{StaticResource FontSize}"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<Grid x:Name="grid" Margin="{TemplateBinding Padding}" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock x:Name="icon" Style="{StaticResource TSIcon}" Text="&#xe68b;"
FontSize="{TemplateBinding local:ControlAttachProperty.IconSize}"
Margin="{TemplateBinding local:ControlAttachProperty.IconMargin}"
Foreground="{TemplateBinding Foreground}"/>
<ContentPresenter VerticalAlignment="Center"/>
</StackPanel>
</Grid>
<!--触发器:设置选中状态符号-->
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Text" Value="&#xe660;" TargetName="icon" ></Setter>
<Setter Property="Foreground" Value="{StaticResource CheckedForeground}"></Setter>
</Trigger>
<Trigger Property="IsChecked" Value="{x:Null}">
<Setter Property="Text" Value="&#xe68c;" TargetName="icon" ></Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Foreground" Value="{StaticResource MouseOverForeground}"></Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="{StaticResource DisableOpacity}" TargetName="grid" ></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

+ 92
- 0
B3DealerClient/Style/Colors.xaml View File

@ -0,0 +1,92 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--Window窗体-->
<SolidColorBrush x:Key="WindowBackground" Color="#007ACB"></SolidColorBrush>
<SolidColorBrush x:Key="WindowInnerBackground" Color="Transparent"></SolidColorBrush>
<SolidColorBrush x:Key="WindowBorderBrush" Color="#920892"></SolidColorBrush>
<DropShadowEffect x:Key="WindowDropShadow" Color="#F472F4" BlurRadius="8" ShadowDepth="0" Direction="0" Opacity="0.7" />
<SolidColorBrush x:Key="CaptionForeground" Color="White"></SolidColorBrush>
<LinearGradientBrush x:Key="CaptionBackground" StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color="#571457" Offset="0"/>
<GradientStop Color="#6A196A" Offset="1"/>
</LinearGradientBrush>
<!--MessageBoxX-->
<SolidColorBrush x:Key="InfoForeground" Color="White"></SolidColorBrush>
<SolidColorBrush x:Key="QuestionForeground" Color="#74B80C"></SolidColorBrush>
<SolidColorBrush x:Key="WarningForeground" Color="DarkOrange"></SolidColorBrush>
<SolidColorBrush x:Key="ErrorForeground" Color="#E74E4E"></SolidColorBrush>
<!--WaitingBox-->
<SolidColorBrush x:Key="WaitingBoxBackground" Color="#921692"></SolidColorBrush>
<!--边框:Menu-->
<DropShadowEffect x:Key="DefaultDropShadow" Color="Black" BlurRadius="5" ShadowDepth="2" Direction="315" Opacity="0.6" />
<!--输入组件-->
<SolidColorBrush x:Key="TextForeground" Color="White"></SolidColorBrush>
<!--used-->
<SolidColorBrush x:Key="TextBackground" Color="#0D234B"></SolidColorBrush>
<SolidColorBrush x:Key="TextSelectionBrush" Color="#8F8787"></SolidColorBrush>
<!--TextBox默认Label颜色-->
<SolidColorBrush x:Key="TextLabelBackground" Color="#508AB6"></SolidColorBrush>
<!--输入框-->
<SolidColorBrush x:Key="ControlBorderBrush" Color="#999C9F"></SolidColorBrush>
<SolidColorBrush x:Key="MouseOverBorderBrush" Color="#F6D1D1"></SolidColorBrush>
<SolidColorBrush x:Key="FocusBackground" Color="#365080"></SolidColorBrush>
<SolidColorBrush x:Key="FocusBorderBrush" Color="#EBCECE"></SolidColorBrush>
<!--ScrollBar-->
<SolidColorBrush x:Key="ScrollBarForeround" Color="#877F7F"></SolidColorBrush>
<SolidColorBrush x:Key="ScrollBarBackground" Color="#3E3E42"></SolidColorBrush>
<!--ItemsControl:DataGrid,Tree-->
<sys:Double x:Key="HeaderFontSize">14</sys:Double>
<SolidColorBrush x:Key="HeaderBorderBrush" Color="#A6FFA500"></SolidColorBrush>
<SolidColorBrush x:Key="HeaderBackground" Color="#0A48D3"></SolidColorBrush>
<SolidColorBrush x:Key="ItemsContentBackground" Color="#1389D7"></SolidColorBrush>
<SolidColorBrush x:Key="ItemsAlternationContentBackground" Color="#128EE0"></SolidColorBrush>
<SolidColorBrush x:Key="GridLinesBrush" Color="#A6D0C2A7"></SolidColorBrush>
<SolidColorBrush x:Key="ItemSelectedForeground" Color="White"></SolidColorBrush>
<SolidColorBrush x:Key="ItemSelectedBackground" Color="#A145F8"></SolidColorBrush>
<SolidColorBrush x:Key="ItemMouseOverBackground" Color="#BA7DF4"></SolidColorBrush>
<SolidColorBrush x:Key="ItemMouseOverForeground" Color="White"></SolidColorBrush>
<!--高亮:日历Today-->
<SolidColorBrush x:Key="ItemHighlighteBackground" Color="Blue"></SolidColorBrush>
<SolidColorBrush x:Key="ItemHighlighteForeground" Color="White"></SolidColorBrush>
<!--普通无背景按钮-->
<SolidColorBrush x:Key="CheckedForeground" Color="#FF0CC50C"></SolidColorBrush>
<!--used-->
<SolidColorBrush x:Key="MouseOverForeground" Color="Orange"></SolidColorBrush>
<!--used-->
<SolidColorBrush x:Key="PressedForeground" Color="DarkOrange"></SolidColorBrush>
<SolidColorBrush x:Key="LinkForeground" Color="#0816BB"></SolidColorBrush>
<!--Popup,ComboBox-->
<SolidColorBrush x:Key="PopupBackground" Color="#066EB3"></SolidColorBrush>
<!--Button-->
<SolidColorBrush x:Key="ButtonBackground" Color="#1D4A9A"></SolidColorBrush>
<SolidColorBrush x:Key="ButtonForeground" Color="White"></SolidColorBrush>
<SolidColorBrush x:Key="ButtonMouseOverBackground" Color="Orange"></SolidColorBrush>
<SolidColorBrush x:Key="ButtonMouseOverForeground" Color="White"></SolidColorBrush>
<SolidColorBrush x:Key="ButtonPressedBackground" Color="DarkOrange"></SolidColorBrush>
<SolidColorBrush x:Key="ButtonPressedForeground" Color="White"></SolidColorBrush>
<!--Menu-->
<SolidColorBrush x:Key="MenuForeground" Color="#920892"></SolidColorBrush>
<SolidColorBrush x:Key="MenuBackground" Color="#DDD1D1"></SolidColorBrush>
<SolidColorBrush x:Key="MenuBorderBrush" Color="DarkBlue"></SolidColorBrush>
<SolidColorBrush x:Key="MenuMouseOverBackground" Color="#0D3CD2"></SolidColorBrush>
<SolidColorBrush x:Key="MenuMouseOverForeground" Color="White"></SolidColorBrush>
<SolidColorBrush x:Key="MenuPressedBackground" Color="#082CA0"></SolidColorBrush>
<SolidColorBrush x:Key="MenuPressedForeground" Color="White"></SolidColorBrush>
<!--State brush-->
<SolidColorBrush x:Key="SuccessfulfaiBrush" Color="#16B32A"></SolidColorBrush>
<SolidColorBrush x:Key="FailedBrush" Color="#B92222"></SolidColorBrush>
<FontFamily x:Key="FontFamily" >Microsoft YaHei</FontFamily>
<sys:Double x:Key="FontSize">13</sys:Double>
<!--used-->
<sys:Double x:Key="DisableOpacity">0.5</sys:Double>
<!--used-->
<sys:Double x:Key="ReadonlyOpacity">0.88</sys:Double>
<sys:Double x:Key="WatermarkOpacity">0.4</sys:Double>
<sys:String x:Key="DateFormat">yyyy年MM月dd日</sys:String>
<sys:String x:Key="DateTimeFormat">yyyy-MM-dd HH:mm:ss</sys:String>
</ResourceDictionary>

+ 35
- 0
B3DealerClient/Style/ComboBox.xaml View File

@ -0,0 +1,35 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="ComboBoxItem" x:Key="ComboBoxItemStyle">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Height" Value="40" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Grid Background="{TemplateBinding Background}" Margin="0,0.5">
<Border x:Name="ItemBackground" IsHitTestVisible="False" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"
Background="{TemplateBinding Background}" />
<ContentPresenter x:Name="contentPresenter" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="ItemBackground" Property="Background" Value="{StaticResource ItemSelectedBackground}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="ItemBackground" Property="Background" Value="{StaticResource ItemMouseOverBackground}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ComboBox" x:Key="ComboBoxStyle">
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="ItemContainerStyle" Value="{StaticResource ComboBoxItemStyle }"/>
</Style>
</ResourceDictionary>

+ 117
- 0
B3DealerClient/Style/DataGrid.xaml View File

@ -0,0 +1,117 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="#1581ED"/>
<!--行样式-->
<Style x:Key="DefaultDataGridRow" TargetType="{x:Type DataGridRow}">
<Setter Property="Margin" Value="0,0,0,0" />
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="#F0F0F0" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="DefaultDataGridCell"
TargetType="{x:Type DataGridCell}">
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderThickness" Value="0"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="{ComponentResourceKey ResourceId=DataGridSelectAllButtonStyle, TypeInTargetAssembly={x:Type DataGrid}}" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid>
<Rectangle x:Name="Border" Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" SnapsToDevicePixels="True"/>
<Polygon x:Name="Arrow" Fill="Black" HorizontalAlignment="Right" Margin="8,8,3,3" Opacity="0.15" Points="0,10 10,10 10,0" Stretch="Uniform" VerticalAlignment="Bottom"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Stroke" TargetName="Border" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Fill" TargetName="Border" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Visibility" TargetName="Arrow" Value="Collapsed"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DataGridStyle1" TargetType="{x:Type DataGrid}">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="BorderBrush" Value="#FF688CAF"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="RowDetailsVisibilityMode" Value="VisibleWhenSelected"/>
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
<Setter Property="AutoGenerateColumns" Value="False"/>
<Setter Property="RowHeight" Value="50"/>
<Setter Property="CanUserAddRows" Value="False"/>
<Setter Property="IsReadOnly" Value="True"/>
<Setter Property="CanUserSortColumns" Value="False"/>
<Setter Property="CanUserResizeColumns" Value="False"/>
<Setter Property="AlternationCount" Value="2"/>
<Setter Property="HorizontalScrollBarVisibility" Value="Hidden"/>
<Setter Property="SelectionMode" Value="Single"/>
<Setter Property="SelectionUnit" Value="FullRow" />
<Setter Property="EnableRowVirtualization" Value="True" />
<Setter Property="EnableColumnVirtualization" Value="False" />
<Setter Property="RowStyle" Value="{StaticResource DefaultDataGridRow}" />
<Setter Property="CellStyle" Value="{StaticResource DefaultDataGridCell}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGrid}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
<ScrollViewer x:Name="DG_ScrollViewer" Focusable="false">
<ScrollViewer.Template>
<ControlTemplate TargetType="{x:Type ScrollViewer}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Button Command="{x:Static DataGrid.SelectAllCommand}" Focusable="false" Style="{DynamicResource {ComponentResourceKey ResourceId=DataGridSelectAllButtonStyle, TypeInTargetAssembly={x:Type DataGrid}}}" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Width="{Binding CellsPanelHorizontalOffset, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
<DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Grid.Column="1" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Column}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" Grid.ColumnSpan="2" Grid.Row="1"/>
<ScrollBar x:Name="PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Width="30"/>
<Grid Grid.Column="1" Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ScrollBar x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
</Grid>
</Grid>
</ControlTemplate>
</ScrollViewer.Template>
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsGrouping" Value="true"/>
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
</MultiTrigger.Conditions>
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
</MultiTrigger>
</Style.Triggers>
</Style>
</ResourceDictionary>

+ 164
- 0
B3DealerClient/Style/DatePicker.xaml View File

@ -0,0 +1,164 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Calendar.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="DatePickerStyle1" TargetType="{x:Type DatePicker}">
<Setter Property="Foreground" Value="#FF333333"/>
<Setter Property="IsTodayHighlighted" Value="True"/>
<Setter Property="SelectedDateFormat" Value="Short"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Padding" Value="2"/>
<Setter Property="Margin" Value="3"/>
<Setter Property="CalendarStyle" Value="{StaticResource CalendarStyle1}" />
<Setter Property="BorderBrush">
<Setter.Value>
<LinearGradientBrush EndPoint=".5,0" StartPoint=".5,1">
<GradientStop Color="#FFA3AEB9" Offset="0"/>
<GradientStop Color="#FF8399A9" Offset="0.375"/>
<GradientStop Color="#FF718597" Offset="0.375"/>
<GradientStop Color="#FF617584" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DatePicker}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_DisabledVisual"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="PART_Root" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<Grid.Resources>
<SolidColorBrush x:Key="DisabledBrush" Color="#A5FFFFFF"/>
<ControlTemplate x:Key="DropDownButtonTemplate" TargetType="{x:Type Button}">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0"/>
<VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver"/>
<VisualTransition GeneratedDuration="0:0:0.1" To="Pressed"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimation Duration="0" To="#FF448DCA" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" Storyboard.TargetName="Background"/>
<ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient">
<SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient">
<SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient">
<SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" Storyboard.TargetName="Background">
<SplineColorKeyFrame KeyTime="0" Value="#FF448DCA"/>
</ColorAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight">
<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient">
<SplineColorKeyFrame KeyTime="0" Value="#EAFFFFFF"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient">
<SplineColorKeyFrame KeyTime="0" Value="#C6FFFFFF"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient">
<SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient">
<SplineColorKeyFrame KeyTime="0" Value="#F4FFFFFF"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid Background="#11FFFFFF" FlowDirection="LeftToRight" HorizontalAlignment="Center" Height="25" Margin="0" VerticalAlignment="Center" Width="25">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="20*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="23*"/>
<RowDefinition Height="19*"/>
<RowDefinition Height="19*"/>
<RowDefinition Height="19*"/>
</Grid.RowDefinitions>
<Border x:Name="Highlight" BorderBrush="#FF45D6FA" BorderThickness="1" Grid.ColumnSpan="4" CornerRadius="0,0,1,1" Margin="-1" Opacity="0" Grid.Row="0" Grid.RowSpan="4"/>
<Border x:Name="Background" BorderBrush="#FFFFFFFF" BorderThickness="1" Background="#FF1F3B53" Grid.ColumnSpan="4" CornerRadius=".5" Margin="0,-1,0,0" Opacity="1" Grid.Row="1" Grid.RowSpan="3"/>
<Border x:Name="BackgroundGradient" BorderBrush="#BF000000" BorderThickness="1" Grid.ColumnSpan="4" CornerRadius=".5" Margin="0,-1,0,0" Opacity="1" Grid.Row="1" Grid.RowSpan="3">
<Border.Background>
<LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
<GradientStop Color="#FFFFFFFF" Offset="0"/>
<GradientStop Color="#F9FFFFFF" Offset="0.375"/>
<GradientStop Color="#E5FFFFFF" Offset="0.625"/>
<GradientStop Color="#C6FFFFFF" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
</Border>
<Rectangle Grid.ColumnSpan="4" Grid.RowSpan="1" StrokeThickness="1">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.3,-1.1" StartPoint="0.46,1.6">
<GradientStop Color="#FF4084BD"/>
<GradientStop Color="#FFAFCFEA" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
<Rectangle.Stroke>
<LinearGradientBrush EndPoint="0.48,-1" StartPoint="0.48,1.25">
<GradientStop Color="#FF494949"/>
<GradientStop Color="#FF9F9F9F" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Stroke>
</Rectangle>
<Path Grid.ColumnSpan="4" Grid.Column="0" Data="M11.426758,8.4305077 L11.749023,8.4305077 L11.749023,16.331387 L10.674805,16.331387 L10.674805,10.299648 L9.0742188,11.298672 L9.0742188,10.294277 C9.4788408,10.090176 9.9094238,9.8090878 10.365967,9.4510155 C10.82251,9.0929432 11.176106,8.7527733 11.426758,8.4305077 z M14.65086,8.4305077 L18.566387,8.4305077 L18.566387,9.3435936 L15.671368,9.3435936 L15.671368,11.255703 C15.936341,11.058764 16.27293,10.960293 16.681133,10.960293 C17.411602,10.960293 17.969301,11.178717 18.354229,11.615566 C18.739157,12.052416 18.931622,12.673672 18.931622,13.479336 C18.931622,15.452317 18.052553,16.438808 16.294415,16.438808 C15.560365,16.438808 14.951641,16.234707 14.468243,15.826504 L14.881817,14.929531 C15.368796,15.326992 15.837872,15.525723 16.289043,15.525723 C17.298809,15.525723 17.803692,14.895514 17.803692,13.635098 C17.803692,12.460618 17.305971,11.873379 16.310528,11.873379 C15.83071,11.873379 15.399232,12.079271 15.016094,12.491055 L14.65086,12.238613 z" Fill="#FF2F2F2F" HorizontalAlignment="Center" Margin="4,3,4,3" Grid.Row="1" Grid.RowSpan="3" RenderTransformOrigin="0.5,0.5" Stretch="Fill" VerticalAlignment="Center"/>
<Ellipse Grid.ColumnSpan="4" Fill="#FFFFFFFF" HorizontalAlignment="Center" Height="3" StrokeThickness="0" VerticalAlignment="Center" Width="3"/>
<Border x:Name="DisabledVisual" BorderBrush="#B2FFFFFF" BorderThickness="1" Grid.ColumnSpan="4" CornerRadius="0,0,.5,.5" Opacity="0" Grid.Row="0" Grid.RowSpan="4"/>
</Grid>
</Grid>
</ControlTemplate>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button x:Name="PART_Button" Grid.Column="1" Foreground="{TemplateBinding Foreground}" Focusable="False" HorizontalAlignment="Left" Margin="3,0,3,0" Grid.Row="0" Template="{StaticResource DropDownButtonTemplate}" VerticalAlignment="Top" Width="25" Height="25"/>
<DatePickerTextBox x:Name="PART_TextBox" Grid.Column="0" Focusable="{TemplateBinding Focusable}" HorizontalContentAlignment="Stretch" Grid.Row="0" VerticalContentAlignment="Stretch" IsReadOnly="True"/>
<Grid x:Name="PART_DisabledVisual" Grid.ColumnSpan="2" Grid.Column="0" IsHitTestVisible="False" Opacity="0" Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Rectangle Grid.Column="0" Fill="#A5FFFFFF" RadiusY="1" Grid.Row="0" RadiusX="1" Width="100"/>
<Rectangle Grid.Column="1" Fill="#A5FFFFFF" Height="30" Margin="3,0,3,0" RadiusY="1" Grid.Row="0" RadiusX="1" Width="30"/>
<Popup x:Name="PART_Popup" AllowsTransparency="True" Placement="Bottom" PlacementTarget="{Binding ElementName=PART_TextBox}" StaysOpen="False"/>
</Grid>
</Grid>
</Border>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="false">
<Setter Property="Foreground" TargetName="PART_TextBox" Value="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

+ 12
- 0
B3DealerClient/Style/TSIcon.xaml View File

@ -0,0 +1,12 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--TSIcon-->
<Style x:Key="TSIcon" TargetType="TextBlock">
<Setter Property="FontFamily" Value="/Resources/#SF2015"></Setter>
<Setter Property="Foreground" Value="{StaticResource TextForeground}"/>
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="20"/>
</Style>
</ResourceDictionary>

+ 67
- 0
B3DealerClient/Utils/AppContext.cs View File

@ -0,0 +1,67 @@
using B3DealerClient.Utils;
using Forks.JsonRpc.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace B3DealerClient
{
public class AppContext
{
private static AppContext inst = null;
public static AppContext Instance
{
get
{
if (inst == null)
inst = XmlUtil.DeserializeFromFile<AppContext>();
return inst;
}
}
public string ServerUrl { get; set; }
public string UserName { get; set; }
public string SqlConnection { get; set; }
public static void Save()
{
XmlUtil.SerializerObjToFile(Instance);
}
[XmlIgnore]
public bool RpcInited { get; set; }
public static void ReInitRpc()
{
CheckUrl();
if (AppContext.Instance.RpcInited)
RpcFacade.ReInit(AppContext.Instance.ServerUrl);
else
{
RpcFacade.Init(AppContext.Instance.ServerUrl, "B3DealerClient");
AppContext.Instance.RpcInited = true;
}
}
public static void InitRpc()
{
CheckUrl();
if (!AppContext.Instance.RpcInited)
{
RpcFacade.Init(AppContext.Instance.ServerUrl, "B3DealerClient");
AppContext.Instance.RpcInited = true;
}
}
static void CheckUrl()
{
if (string.IsNullOrEmpty(AppContext.Instance.ServerUrl))
throw new Exception("请先配置服务器地址");
}
}
}

+ 66
- 0
B3DealerClient/Utils/ControlAttachProperty.cs View File

@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace B3DealerClient.Utils
{
public static class ControlAttachProperty
{
#region IconSizeProperty 字体图标大小
/// <summary>
/// 字体图标
/// </summary>
public static readonly DependencyProperty IconSizeProperty = DependencyProperty.RegisterAttached(
"IconSize", typeof(double), typeof(ControlAttachProperty), new FrameworkPropertyMetadata(12D));
public static double GetIconSize(DependencyObject d)
{
return (double)d.GetValue(IconSizeProperty);
}
public static void SetIconSize(DependencyObject obj, double value)
{
obj.SetValue(IconSizeProperty, value);
}
#endregion
#region IconMarginProperty 字体图标边距
/// <summary>
/// 字体图标
/// </summary>
public static readonly DependencyProperty IconMarginProperty = DependencyProperty.RegisterAttached(
"IconMargin", typeof(Thickness), typeof(ControlAttachProperty), new FrameworkPropertyMetadata(null));
public static Thickness GetIconMargin(DependencyObject d)
{
return (Thickness)d.GetValue(IconMarginProperty);
}
public static void SetIconMargin(DependencyObject obj, Thickness value)
{
obj.SetValue(IconMarginProperty, value);
}
#endregion
#region IsNumberPad 字体图标边距
/// <summary>
/// 字体图标
/// </summary>
public static readonly DependencyProperty IsNumberPadProperty = DependencyProperty.RegisterAttached(
"IsNumberPad", typeof(bool), typeof(ControlAttachProperty), new FrameworkPropertyMetadata(true));
public static bool GetIsNumberPad(DependencyObject d)
{
return (bool)d.GetValue(IsNumberPadProperty);
}
public static void SetIsNumberPad(DependencyObject obj, bool value)
{
obj.SetValue(IsNumberPadProperty, value);
}
#endregion
}
}

+ 50
- 0
B3DealerClient/Utils/DbUtil.cs View File

@ -0,0 +1,50 @@
using Forks.EnterpriseServices.DomainObjects2;
using Forks.Utils;
using Forks.Utils.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace B3DealerClient.Utils
{
public static class DbUtil
{
public static void UpdateDatabase(string sqlConnection)
{
using (ISqlUtil sqlUtil = new SqlUtil(sqlConnection))
{
var boTypes = GetTypes();
Dmo.UpdateTables(sqlUtil, boTypes);
}
}
static IEnumerable<Type> GetTypes()
{
var asm = Assembly.GetExecutingAssembly();
foreach (var t in asm.GetExportedTypes())
{
if (t.IsAbstract)
{
continue;
}
if (t.IsClass && IsMapTable(t))
{
yield return t;
}
}
}
static bool IsMapTable(Type t)
{
var attr = ReflectionUtil.GetAttribute<MapToTableAttribute>(t);
if (attr == null)
{
return false;
}
return true;
}
}
}

+ 28
- 0
B3DealerClient/Utils/WindowUtil.cs View File

@ -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.Media;
namespace B3DealerClient.Utils
{
public static class WindowUtil
{
public static Window GetParentWindow(DependencyObject obj)
{
var parent = VisualTreeHelper.GetParent(obj);
while (parent != null)
{
if (parent is Window)
{
return (Window)parent;
}
parent = VisualTreeHelper.GetParent(parent);
}
return null;
}
}
}

+ 47
- 0
B3DealerClient/Utils/XmlUtil.cs View File

@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace B3DealerClient.Utils
{
public static class XmlUtil
{
static string config = "Config";
public static void SerializerObjToFile(object obj, string fileName = "")
{
if (string.IsNullOrWhiteSpace(fileName))
{
fileName = Path.Combine(config, obj.GetType().Name + ".xml");
}
var ser = new XmlSerializer(obj.GetType());
using (var stream = File.Open(fileName, FileMode.Create))
{
ser.Serialize(stream, obj);
}
}
public static T DeserializeFromFile<T>(string fileName = "")
where T : new()
{
if (string.IsNullOrWhiteSpace(fileName))
{
fileName = Path.Combine(config, typeof(T).Name + ".xml");
}
if (!File.Exists(fileName))
{
return new T();
}
using (var reader = new StreamReader(fileName))
{
var xs = new XmlSerializer(typeof(T));
object obj = xs.Deserialize(reader);
reader.Close();
return (T)obj;
}
}
}
}

+ 250
- 0
B3DealerClient/Windows/CarcassInStoreWindow_/CarcassInStoreWindow.xaml View File

@ -0,0 +1,250 @@
<Window x:Class="B3DealerClient.Windows.CarcassInStoreWindow_.CarcassInStoreWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:B3DealerClient.Control"
Title="白条收货" Height="700" Width="1100" FontSize="17">
<Window.Resources>
<Style TargetType="TextBox">
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="35"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<Style TargetType="Border" BasedOn="{StaticResource DefaultBorder}"/>
</Window.Resources>
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="100"/>
<RowDefinition/>
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.8*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Margin="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.8*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<local:WeightControl x:Name="weightControl" HorizontalAlignment="Left" Width="250" Margin="2,5,0,5"/>
<WrapPanel HorizontalAlignment="Right" Margin="0,10,10,0">
<TextBlock Text="扣钩重:"/>
<TextBox Margin="0,-5,0,0" Text="2.5"/>
</WrapPanel>
<WrapPanel Grid.Column="1" HorizontalAlignment="Center" Margin="0,10">
<TextBlock Text="供应商:"/>
<TextBlock Text="龙达肉食" MinWidth="120"/>
<TextBlock Text="仓库:"/>
<TextBlock Text="白条库" MinWidth="120"/>
</WrapPanel>
</Grid>
</Border>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="180"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Margin="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.9*"/>
<ColumnDefinition/>
<ColumnDefinition Width="0.9*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition Height="60"/>
</Grid.RowDefinitions>
<Grid.Resources>
<Style TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,0,2,0"/>
</Style>
</Grid.Resources>
<TextBlock Text="装货日期"/>
<TextBox Grid.Column="1" Text="2019/01/25"/>
<TextBlock Grid.Column="2" Text="供应商"/>
<TextBox Grid.Column="3" Text="龙达肉食"/>
<TextBlock Grid.Row="1" Text="计划到货日期"/>
<TextBox Grid.Row="1" Grid.Column="1" Text="2019/01/25"/>
<TextBlock Grid.Row="1" Grid.Column="2" Text="仓库"/>
<TextBox Grid.Row="1" Grid.Column="3" Text="白条库"/>
<WrapPanel Grid.Row="2" Grid.ColumnSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center">
<WrapPanel.Resources>
<Style TargetType="Button" BasedOn="{StaticResource DefaultButton}">
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="50"/>
<Setter Property="Margin" Value="20,0"/>
</Style>
</WrapPanel.Resources>
<Button Content="查询"/>
<Button Content="清除条件"/>
</WrapPanel>
</Grid>
</Border>
<Border Grid.Row="1" Margin="2">
<DataGrid Margin="5">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource DefaultDataGridRow}">
<!--<EventSetter Event="PreviewMouseDown" Handler="TangGridFocus"/>-->
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Selected}" Value="False" />
<Condition Binding="{Binding Finish}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0.0" Color="#9ACD32"/>
<GradientStop Offset="1.0" Color="White"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="Black"/>
</MultiDataTrigger>
<DataTrigger Binding="{Binding Selected}" Value="True">
<Setter Property="Background" Value="#1581ED"/>
<Setter Property="Foreground" Value="White"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding WeightID}" Header="单号" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding Order}" Header="供应商" Width="1.2*"/>
<DataGridTextColumn Binding="{Binding Number ,StringFormat=\{0:yyyy/MM/dd\}}" Header="装货日期" Width="1.0*"/>
<DataGridTextColumn Binding="{Binding Already,StringFormat=\{0:yyyy/MM/dd\}}" Header="预计到货日期" Width="1.0*"/>
<!--<DataGridTextColumn Binding="{Binding TotalWeight, StringFormat=\{0:0.######\}}" Header="重量" Width="1*"/>-->
</DataGrid.Columns>
</DataGrid>
</Border>
</Grid>
<Grid Grid.Row="1" Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="0.4*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<GroupBox Header="装车明细">
<DataGrid>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource DefaultDataGridRow}">
<!--<EventSetter Event="PreviewMouseDown" Handler="TangGridFocus"/>-->
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Selected}" Value="False" />
<Condition Binding="{Binding Finish}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0.0" Color="#9ACD32"/>
<GradientStop Offset="1.0" Color="White"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="Black"/>
</MultiDataTrigger>
<DataTrigger Binding="{Binding Selected}" Value="True">
<Setter Property="Background" Value="#1581ED"/>
<Setter Property="Foreground" Value="White"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding WeightID}" Header="单号" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding Order}" Header="存货" Width="1.0*"/>
<DataGridTextColumn Binding="{Binding TotalWeight, StringFormat=\{0:0.######\}}" Header="重量" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding TotalWeight, StringFormat=\{0:0.######\}}" Header="件数" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding Number ,StringFormat=\{0:0.######\}}" Header="已入库重量" Width="0.8*"/>
<DataGridTextColumn Binding="{Binding Already,StringFormat=\{0:0.######\}}" Header="已入库件数" Width="0.8*"/>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
<GroupBox Header="收货明细" Grid.Row="1" Margin="0,0,0,1">
<DataGrid>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource DefaultDataGridRow}">
<!--<EventSetter Event="PreviewMouseDown" Handler="TangGridFocus"/>-->
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Selected}" Value="False" />
<Condition Binding="{Binding Finish}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0.0" Color="#9ACD32"/>
<GradientStop Offset="1.0" Color="White"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="Black"/>
</MultiDataTrigger>
<DataTrigger Binding="{Binding Selected}" Value="True">
<Setter Property="Background" Value="#1581ED"/>
<Setter Property="Foreground" Value="White"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridCheckBoxColumn Binding="{Binding WeightID}" Header="" Width="0.4*"/>
<DataGridTextColumn Binding="{Binding Order}" Header="存货" Width="1.0*"/>
<DataGridTextColumn Binding="{Binding TotalWeight, StringFormat=\{0:0.######\}}" Header="重量" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding TotalWeight, StringFormat=\{0:0.######\}}" Header="扣重" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding TotalWeight, StringFormat=\{0:0.######\}}" Header="净重" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding TotalWeight, StringFormat=\{0:0.######\}}" Header="件数" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding Number ,StringFormat=\{0:HH:mm:ss\}}" Header="确认时间" Width="0.8*"/>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</Grid>
<Border Grid.Row="2" Grid.ColumnSpan="2" Margin="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.8*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<WrapPanel HorizontalAlignment="Right">
<WrapPanel.Resources>
<Style TargetType="Button" BasedOn="{StaticResource DefaultButton}">
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="50"/>
<Setter Property="Margin" Value="30,12"/>
</Style>
</WrapPanel.Resources>
<Button Content="称重记录"/>
<Button Content="入库完成"/>
</WrapPanel>
<WrapPanel Grid.Column="1" HorizontalAlignment="Right">
<WrapPanel.Resources>
<Style TargetType="Button" BasedOn="{StaticResource DefaultButton}">
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="50"/>
<Setter Property="Margin" Value="30,12"/>
</Style>
</WrapPanel.Resources>
<Button Content="删除选中" Background="Red"/>
<TextBlock Text="件数录入:" VerticalAlignment="Center"/>
<TextBox Text="2.5" Margin="10,0"/>
<Button Content="确认"/>
</WrapPanel>
</Grid>
</Border>
</Grid>
</Window>

+ 27
- 0
B3DealerClient/Windows/CarcassInStoreWindow_/CarcassInStoreWindow.xaml.cs View File

@ -0,0 +1,27 @@
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.Shapes;
namespace B3DealerClient.Windows.CarcassInStoreWindow_
{
/// <summary>
/// CarcassInStoreWindow.xaml 的交互逻辑
/// </summary>
public partial class CarcassInStoreWindow : Window
{
public CarcassInStoreWindow()
{
InitializeComponent();
}
}
}

+ 250
- 0
B3DealerClient/Windows/CarcassSaleOutWindow_/CarcassSaleOutWindow.xaml View File

@ -0,0 +1,250 @@
<Window x:Class="B3DealerClient.Windows.CarcassSaleOutWindow_.CarcassSaleOutWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:B3DealerClient.Control"
Title="白条发货" Height="800" Width="1200" FontSize="17">
<Window.Resources>
<Style TargetType="TextBlock">
<Setter Property="Margin" Value="5,20"/>
<Setter Property="Width" Value="80"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
</Style>
<Style TargetType="TextBox">
<Setter Property="Width" Value="150"/>
<Setter Property="Height" Value="40"/>
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<Style TargetType="Border" BasedOn="{StaticResource DefaultBorder}"/>
</Window.Resources>
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="165"/>
<ColumnDefinition/>
<ColumnDefinition Width="320"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="100"/>
<RowDefinition Height="0.8*"/>
<RowDefinition/>
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<Border Grid.RowSpan="3" Margin="0,2">
<WrapPanel Orientation="Vertical">
<WrapPanel.Resources>
<Style TargetType="Button" BasedOn="{StaticResource DefaultButton}">
<Setter Property="Margin" Value="5"/>
<Setter Property="Width" Value="150"/>
<Setter Property="Height" Value="50"/>
</Style>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
</WrapPanel.Resources>
<Button Content="东台五烈"/>
<Button Content="东台五烈"/>
<Button Content="郭涛"/>
<Button Content="东台刘家宾"/>
<Button Content="浦东刘老板"/>
<Button Content="建湖钱大方"/>
<Button Content="柏庐小陈"/>
<Button>
<Button.Content>
<TextBlock>大丰高丽苑13328121551</TextBlock>
</Button.Content>
</Button>
<Button>
<Button.Content>
<TextBlock>胡传俊</TextBlock>
</Button.Content>
</Button>
</WrapPanel>
</Border>
<WrapPanel Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center">
<WrapPanel.Resources>
<Style TargetType="Button" BasedOn="{StaticResource DefaultButton}">
<Setter Property="Margin" Value="2,0"/>
<Setter Property="Width" Value="75"/>
<Setter Property="Height" Value="40"/>
</Style>
</WrapPanel.Resources>
<Button Content="上一页"/>
<Button Content="下一页"/>
</WrapPanel>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<local:WeightControl x:Name="weightControl" HorizontalAlignment="Left" Width="250" Margin="2,5,0,5"/>
<Grid Grid.Column="1" HorizontalAlignment="Center">
<Grid.Resources>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="120"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Text="客户:"/>
<TextBlock Grid.Column="1" Text="这里"/>
<TextBlock Grid.Column="2" Text="司机"/>
<TextBlock Grid.Column="3" Text="这里"/>
<TextBlock Grid.Row="1" Text="仓库:"/>
<TextBlock Grid.Row="1" Grid.Column="1" Text="这里"/>
</Grid>
</Grid>
<Border Grid.Row="1" Grid.Column="1" Margin="2">
<DataGrid Margin="5">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource DefaultDataGridRow}">
<!--<EventSetter Event="PreviewMouseDown" Handler="TangGridFocus"/>-->
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Selected}" Value="False" />
<Condition Binding="{Binding Finish}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0.0" Color="#9ACD32"/>
<GradientStop Offset="1.0" Color="White"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="Black"/>
</MultiDataTrigger>
<DataTrigger Binding="{Binding Selected}" Value="True">
<Setter Property="Background" Value="#1581ED"/>
<Setter Property="Foreground" Value="White"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding WeightID}" Header="单号" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding Order}" Header="存货名称" Width="1.0*"/>
<DataGridTextColumn Binding="{Binding Number ,StringFormat=\{0:yyyy-MM-dd\}}" Header="出库时间" Width="0.8*"/>
<DataGridTextColumn Binding="{Binding TotalWeight, StringFormat=\{0:0.######\}}" Header="主数量" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding TotalWeight, StringFormat=\{0:0.######\}}" Header="辅数量" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding Number ,StringFormat=\{0:0.######\}}" Header="已配主数量" Width="0.8*"/>
<DataGridTextColumn Binding="{Binding Already,StringFormat=\{0:0.######\}}" Header="已配辅数量" Width="0.8*"/>
</DataGrid.Columns>
</DataGrid>
</Border>
<Border Grid.Row="2" Grid.Column="1" Margin="2">
<DataGrid Margin="5">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource DefaultDataGridRow}">
<!--<EventSetter Event="PreviewMouseDown" Handler="TangGridFocus"/>-->
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Selected}" Value="False" />
<Condition Binding="{Binding Finish}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0.0" Color="#9ACD32"/>
<GradientStop Offset="1.0" Color="White"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="Black"/>
</MultiDataTrigger>
<DataTrigger Binding="{Binding Selected}" Value="True">
<Setter Property="Background" Value="#1581ED"/>
<Setter Property="Foreground" Value="White"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Order}" Header="存货名称" Width="1.0*"/>
<DataGridTextColumn Binding="{Binding Number ,StringFormat=\{0:HH:mm\}}" Header="称重时间" Width="0.8*"/>
<DataGridTextColumn Binding="{Binding TotalWeight, StringFormat=\{0:0.######\}}" Header="称重重量" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding TotalWeight, StringFormat=\{0:0.######\}}" Header="辅数量" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding Number ,StringFormat=\{0:0.######\}}" Header="扣重" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding Already,StringFormat=\{0:0.######\}}" Header="净重" Width="0.6*"/>
</DataGrid.Columns>
</DataGrid>
</Border>
<StackPanel Grid.Row="1" Grid.Column="2" HorizontalAlignment="Center">
<WrapPanel>
<TextBlock Text="发货日期"/>
<TextBox Text="2019/01/25"/>
</WrapPanel>
<WrapPanel>
<TextBlock Text="仓库"/>
<TextBox Text="白条库"/>
</WrapPanel>
<WrapPanel>
<TextBlock Text="扣钩重"/>
<TextBox Text="2.4"/>
</WrapPanel>
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="2">
<WrapPanel HorizontalAlignment="Center">
<TextBlock Text="称重头数"/>
<TextBox Text="4"/>
</WrapPanel>
<WrapPanel>
<WrapPanel.Resources>
<Style TargetType="Button" BasedOn="{StaticResource DefaultButton}">
<Setter Property="Width" Value="95"/>
<Setter Property="Height" Value="75"/>
<Setter Property="Margin" Value="5"/>
</Style>
</WrapPanel.Resources>
<Button Content="1"/>
<Button Content="2"/>
<Button Content="3"/>
<Button Content="4"/>
<Button Content="5"/>
<Button Content="6"/>
<Button Content="0" Width="190"/>
<Button Content="./点"/>
</WrapPanel>
</StackPanel>
<WrapPanel Grid.Row="3" Grid.Column="1" VerticalAlignment="Center">
<WrapPanel.Resources>
<Style TargetType="Button" BasedOn="{StaticResource DefaultButton}">
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="55"/>
</Style>
</WrapPanel.Resources>
<TextBlock Text="送货线路" VerticalAlignment="Center" Margin="20,0,10,0"/>
<Button Content="沙河一线"/>
</WrapPanel>
<WrapPanel Grid.Row="3" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right">
<WrapPanel.Resources>
<Style TargetType="Button" BasedOn="{StaticResource DefaultButton}">
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="55"/>
<Setter Property="Margin" Value="10,0"/>
</Style>
</WrapPanel.Resources>
<Button Content="删除选中"/>
<Button Content="称重记录"/>
<Button Content="配货完成"/>
</WrapPanel>
<Button Grid.Row="3" Grid.Column="2" Content="称重/读取" Width="120" Height="55"/>
</Grid>
</Window>

+ 27
- 0
B3DealerClient/Windows/CarcassSaleOutWindow_/CarcassSaleOutWindow.xaml.cs View File

@ -0,0 +1,27 @@
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.Shapes;
namespace B3DealerClient.Windows.CarcassSaleOutWindow_
{
/// <summary>
/// CarcassSaleOutWindow.xaml 的交互逻辑
/// </summary>
public partial class CarcassSaleOutWindow : Window
{
public CarcassSaleOutWindow()
{
InitializeComponent();
}
}
}

+ 173
- 0
B3DealerClient/Windows/FreshInStoreWindow_/FreshInStoreWindow.xaml View File

@ -0,0 +1,173 @@
<Window x:Class="B3DealerClient.Windows.FreshInStoreWindow_.FreshInStoreWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:B3DealerClient.Control"
Title="鲜品收货" Height="700" Width="1100" FontSize="17">
<Window.Resources>
<Style TargetType="TextBox">
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="35"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<Style TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,0,2,0"/>
</Style>
<Style TargetType="Button" BasedOn="{StaticResource DefaultButton}">
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="50"/>
<Setter Property="Margin" Value="20,0"/>
</Style>
<Style TargetType="Border" BasedOn="{StaticResource DefaultBorder}"/>
</Window.Resources>
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.8*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="180"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Margin="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.9*"/>
<ColumnDefinition/>
<ColumnDefinition Width="0.9*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition Height="60"/>
</Grid.RowDefinitions>
<TextBlock Text="装货日期"/>
<TextBox Grid.Column="1" Text="2019/01/25"/>
<TextBlock Grid.Column="2" Text="供应商"/>
<TextBox Grid.Column="3" Text="龙达肉食"/>
<TextBlock Grid.Row="1" Text="计划到货日期"/>
<TextBox Grid.Row="1" Grid.Column="1" Text="2019/01/25"/>
<TextBlock Grid.Row="1" Grid.Column="2" Text="仓库"/>
<TextBox Grid.Row="1" Grid.Column="3" Text="白条库"/>
<WrapPanel Grid.Row="2" Grid.ColumnSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Content="查询"/>
<Button Content="清除条件"/>
</WrapPanel>
</Grid>
</Border>
<Border Grid.Row="1" Margin="2">
<DataGrid Margin="5">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource DefaultDataGridRow}">
<!--<EventSetter Event="PreviewMouseDown" Handler="TangGridFocus"/>-->
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Selected}" Value="False" />
<Condition Binding="{Binding Finish}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0.0" Color="#9ACD32"/>
<GradientStop Offset="1.0" Color="White"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="Black"/>
</MultiDataTrigger>
<DataTrigger Binding="{Binding Selected}" Value="True">
<Setter Property="Background" Value="#1581ED"/>
<Setter Property="Foreground" Value="White"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding WeightID}" Header="单号" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding Order}" Header="供应商" Width="1.2*"/>
<DataGridTextColumn Binding="{Binding Number ,StringFormat=\{0:yyyy/MM/dd\}}" Header="装货日期" Width="1.0*"/>
<DataGridTextColumn Binding="{Binding Already,StringFormat=\{0:yyyy/MM/dd\}}" Header="预计到货日期" Width="1.0*"/>
<!--<DataGridTextColumn Binding="{Binding TotalWeight, StringFormat=\{0:0.######\}}" Header="重量" Width="1*"/>-->
</DataGrid.Columns>
</DataGrid>
</Border>
</Grid>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Margin="2">
<WrapPanel HorizontalAlignment="Center" Margin="0,10">
<TextBlock Text="供应商:"/>
<TextBlock Text="龙达肉食" MinWidth="120"/>
<TextBlock Text="仓库:"/>
<TextBlock Text="白条库" MinWidth="120"/>
</WrapPanel>
</Border>
<GroupBox Grid.Row="1" Header="装车明细" Margin="1">
<DataGrid>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource DefaultDataGridRow}">
<!--<EventSetter Event="PreviewMouseDown" Handler="TangGridFocus"/>-->
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Selected}" Value="False" />
<Condition Binding="{Binding Finish}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0.0" Color="#9ACD32"/>
<GradientStop Offset="1.0" Color="White"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="Black"/>
</MultiDataTrigger>
<DataTrigger Binding="{Binding Selected}" Value="True">
<Setter Property="Background" Value="#1581ED"/>
<Setter Property="Foreground" Value="White"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding WeightID}" Header="单号" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding Order}" Header="存货" Width="1.0*"/>
<DataGridTextColumn Binding="{Binding TotalWeight, StringFormat=\{0:0.######\}}" Header="重量" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding TotalWeight, StringFormat=\{0:0.######\}}" Header="件数" Width="0.6*"/>
<DataGridTextColumn Binding="{Binding Number ,StringFormat=\{0:0.######\}}" Header="已入库重量" Width="0.8*"/>
<DataGridTextColumn Binding="{Binding Already,StringFormat=\{0:0.######\}}" Header="已入库件数" Width="0.8*"/>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</Grid>
<WrapPanel Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right">
<Button Content="按装货入库"/>
<Button Content="入库完成"/>
</WrapPanel>
<WrapPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right">
<Button Content="按装货入库"/>
<TextBlock Text="件数录入"/>
<TextBox Text="2.5"/>
<Button Content="确认"/>
</WrapPanel>
</Grid>
</Window>

+ 27
- 0
B3DealerClient/Windows/FreshInStoreWindow_/FreshInStoreWindow.xaml.cs View File

@ -0,0 +1,27 @@
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.Shapes;
namespace B3DealerClient.Windows.FreshInStoreWindow_
{
/// <summary>
/// FreshInStoreWindow.xaml 的交互逻辑
/// </summary>
public partial class FreshInStoreWindow : Window
{
public FreshInStoreWindow()
{
InitializeComponent();
}
}
}

+ 8
- 0
B3DealerClient/Windows/FreshSaleOutWindow_/FreshSaleOutWindow.xaml View File

@ -0,0 +1,8 @@
<Window x:Class="B3DealerClient.Windows.FreshSaleOutWindow_.FreshSaleOutWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="FreshSaleOutWindow" Height="300" Width="300">
<Grid>
</Grid>
</Window>

+ 27
- 0
B3DealerClient/Windows/FreshSaleOutWindow_/FreshSaleOutWindow.xaml.cs View File

@ -0,0 +1,27 @@
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.Shapes;
namespace B3DealerClient.Windows.FreshSaleOutWindow_
{
/// <summary>
/// FreshSaleOutWindow.xaml 的交互逻辑
/// </summary>
public partial class FreshSaleOutWindow : Window
{
public FreshSaleOutWindow()
{
InitializeComponent();
}
}
}

BIN
B3DealerClient/app.ico View File

Before After

Loading…
Cancel
Save