Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage
This commit is contained in:
commit
2c46319d3c
6 files changed
+120
-26
No files matched your search
+9
-1
@@ -1,6 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Xceed.Wpf.AvalonDock" publicKeyToken="3e4669d2f30244f4" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,63 @@
|
||||
using formula_manage.SQLModels;
|
||||
using formula_manage.Windows;
|
||||
using GalaSoft.MvvmLight;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace formula_manage.ViewModel
|
||||
{
|
||||
///<Summary>
|
||||
/// StuffViewModel
|
||||
///</Summary>
|
||||
public class StuffViewModel : ViewModelBase
|
||||
{
|
||||
private List<Product> products = new List<Product>();
|
||||
|
||||
/// <summary>
|
||||
/// 所有原料
|
||||
/// </summary>
|
||||
public List<Product> Product
|
||||
{
|
||||
get
|
||||
{
|
||||
return products;
|
||||
}
|
||||
set
|
||||
{
|
||||
products = value;
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// StuffViewModeldl
|
||||
/// </summary>
|
||||
public StuffViewModel()
|
||||
{
|
||||
//products = new ProductProvider().Select();
|
||||
DispatcherTimer timer = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick_Event
|
||||
{
|
||||
Interval = TimeSpan.FromSeconds(0.1)
|
||||
};
|
||||
timer.Tick += Tick_Event;
|
||||
timer.Start();
|
||||
}
|
||||
|
||||
void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件
|
||||
{
|
||||
if (Stuff.Button_sql == true)//获取按钮状态
|
||||
{
|
||||
// if (Stuff.Buttontype_sql == -1) Product = new ProductProvider().Select();
|
||||
// if (Stuff.Buttontype_sql == 0) Product = new ProductProvider().Selects0();
|
||||
// if (Stuff.Buttontype_sql == 1) Product = new ProductProvider().Selects1();
|
||||
// if (Stuff.Buttontype_sql == 2) Product = new ProductProvider().Selects2();
|
||||
// if (Stuff.Buttontype_sql == 3) Product = new ProductProvider().Selects3();
|
||||
Stuff.Button_sql = false;//清除按钮状态
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
-9
@@ -5,6 +5,8 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:formula_manage.Windows"
|
||||
xmlns:ConvertMoels="clr-namespace:formula_manage.ConvertMoels"
|
||||
xmlns:viewmodel="clr-namespace:formula_manage.ViewModel"
|
||||
DataContext="{Binding Source={StaticResource Locator},Path=Stuff}"
|
||||
mc:Ignorable="d"
|
||||
Title="Stuff" Height="720" Width="1100" BorderBrush="White" Background="#FFE0E0E0">
|
||||
<Window.Resources>
|
||||
@@ -17,7 +19,8 @@
|
||||
<DataGrid x:Name="DataGridStuff" MouseDoubleClick="DataGridStuff_MouseDoubleClick" SelectionMode="Single" AlternationCount="2" IsReadOnly="True"
|
||||
HorizontalAlignment="Left" Margin="15,15,0,150" d:ItemsSource="{d:SampleData ItemCount=200}" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
|
||||
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" CanUserReorderColumns="False">
|
||||
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" CanUserReorderColumns="False"
|
||||
ItemsSource="{Binding Product, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGrid.RowStyle >
|
||||
<Style TargetType="{x:Type DataGridRow}">
|
||||
<Style.Triggers>
|
||||
@@ -54,15 +57,15 @@
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Header="原料代码" Width="130" FontSize="15" MaxWidth="130" MinWidth="100" CanUserReorder="False"/>
|
||||
<DataGridTextColumn Header="原料名称" Width="200" FontSize="15" MaxWidth="200" MinWidth="200" CanUserReorder="False"/>
|
||||
<DataGridTextColumn Header="价格(¥/kg)" Width="100" FontSize="15" MaxWidth="100" MinWidth="100" CanUserReorder="False"/>
|
||||
<DataGridTextColumn Header="供应商" Width="150" FontSize="15" MaxWidth="150" MinWidth="150" CanUserReorder="False"/>
|
||||
<DataGridTextColumn Header="原料代码" Binding="{Binding ProductCode}" Width="130" FontSize="15" MaxWidth="130" MinWidth="100" CanUserReorder="False"/>
|
||||
<DataGridTextColumn Header="原料名称" Binding="{Binding ProductName}" Width="200" FontSize="15" MaxWidth="200" MinWidth="200" CanUserReorder="False"/>
|
||||
<DataGridTextColumn Header="价格(¥/kg)" Binding="{Binding Price}" Width="100" FontSize="15" MaxWidth="100" MinWidth="100" CanUserReorder="False"/>
|
||||
<DataGridTextColumn Header="供应商" Binding="{Binding SUPPLIER}" Width="150" FontSize="15" MaxWidth="150" MinWidth="150" CanUserReorder="False"/>
|
||||
<DataGridTextColumn Header="原料类型" Width="80" FontSize="15" MaxWidth="80" MinWidth="70" CanUserReorder="False">
|
||||
<!--事件名称:原料类型数字转文字显示,转换器ProductTypeSQLConvert-->
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="Text" Value="{Binding ProductType, Converter={StaticResource ProductTypeSQLConvert}}"/>
|
||||
<Setter Property="Text" Value="{Binding Path=ProductType, Converter={StaticResource ProductTypeSQLConvert}}"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
@@ -70,12 +73,12 @@
|
||||
<!--事件名称:色彩数字转色彩显示,转换器ColorSQLConvert-->
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="Background" Value="{Binding Color, Converter={StaticResource ColorSQLConvert}}"/>
|
||||
<Setter Property="Background" Value="{Binding Path=Color, Converter={StaticResource ColorSQLConvert}}"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Header="浓度(%)" Width="70" FontSize="15" MaxWidth="200" MinWidth="20" CanUserReorder="False"/>
|
||||
<DataGridTextColumn Header="比重(sg)" Width="70" FontSize="15" MaxWidth="200" MinWidth="20" CanUserReorder="False"/>
|
||||
<DataGridTextColumn Header="浓度(%)" Binding="{Binding Concentration}" Width="70" FontSize="15" MaxWidth="200" MinWidth="20" CanUserReorder="False"/>
|
||||
<DataGridTextColumn Header="比重(sg)" Binding="{Binding GRAVITY}" Width="70" FontSize="15" MaxWidth="200" MinWidth="20" CanUserReorder="False"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<!--搜索类型-->
|
||||
|
||||
@@ -12,7 +12,8 @@ using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
using GalaSoft.MvvmLight;
|
||||
using formula_manage.SQLModels;
|
||||
|
||||
namespace formula_manage.Windows
|
||||
{
|
||||
@@ -24,10 +25,10 @@ namespace formula_manage.Windows
|
||||
public Stuff()
|
||||
{
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||
InitializeComponent();
|
||||
|
||||
this.DataGridStuff.LoadingRow += new EventHandler<DataGridRowEventArgs>(this.DataGridEquipment_LoadingRow);//生成序列号
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -38,9 +39,11 @@ namespace formula_manage.Windows
|
||||
e.Row.Header = e.Row.GetIndex() + 1;
|
||||
}
|
||||
|
||||
public static Boolean Button_sql = true;
|
||||
public static int Buttontype_sql = -1;
|
||||
private void Radiobutton(object sender, EventArgs e)
|
||||
{
|
||||
/* System.Windows.Controls.RadioButton Radiobutton = (sender as System.Windows.Controls.RadioButton);
|
||||
System.Windows.Controls.RadioButton Radiobutton = (sender as System.Windows.Controls.RadioButton);
|
||||
string radiobutton = Radiobutton.Content.ToString();
|
||||
if (radiobutton == "全部原料") Buttontype_sql = -1;
|
||||
if (radiobutton == "染料") Buttontype_sql = 0;
|
||||
@@ -48,7 +51,7 @@ namespace formula_manage.Windows
|
||||
if (radiobutton == "粉体助剂") Buttontype_sql = 2;
|
||||
if (radiobutton == "液体染料") Buttontype_sql = 3;
|
||||
Button_sql = true;
|
||||
*/ }
|
||||
}
|
||||
|
||||
private void Button_Preservation(object sender, RoutedEventArgs e)//保存按钮事件
|
||||
{
|
||||
|
||||
+26
-11
@@ -54,9 +54,21 @@
|
||||
<SignManifests>false</SignManifests>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
|
||||
<HintPath>packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FirstFloor.ModernUI, Version=1.0.9.0, Culture=neutral, PublicKeyToken=bc9b0c37bf06c6a9, processorArchitecture=MSIL">
|
||||
<HintPath>packages\ModernUI.WPF.1.0.9\lib\net45\FirstFloor.ModernUI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
|
||||
<HintPath>packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.4.1.0, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
|
||||
<HintPath>packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
|
||||
<HintPath>packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ModernUI.Xceed.AvalonDock, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>packages\SamOatesGames.ModernUI.Xceed.Toolkit.1.0.1905191936\lib\net45\ModernUI.Xceed.AvalonDock.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -67,6 +79,9 @@
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
@@ -79,20 +94,20 @@
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="Xceed.Wpf.AvalonDock, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Extended.Wpf.Toolkit.3.5.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
|
||||
<Reference Include="Xceed.Wpf.AvalonDock, Version=4.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Extended.Wpf.Toolkit.4.5.1\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Extended.Wpf.Toolkit.3.5.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
|
||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=4.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Extended.Wpf.Toolkit.4.5.1\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Extended.Wpf.Toolkit.3.5.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
|
||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=4.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Extended.Wpf.Toolkit.4.5.1\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Extended.Wpf.Toolkit.3.5.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
|
||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=4.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Extended.Wpf.Toolkit.4.5.1\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.Toolkit, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Extended.Wpf.Toolkit.3.5.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
|
||||
<Reference Include="Xceed.Wpf.Toolkit, Version=4.5.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Extended.Wpf.Toolkit.4.5.1\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -113,6 +128,7 @@
|
||||
<Compile Include="SQLModels\STUFF_Product.cs" />
|
||||
<Compile Include="UserClass\IniFile.cs" />
|
||||
<Compile Include="UserClass\PressKey.cs" />
|
||||
<Compile Include="ViewModel\StuffViewModel.cs" />
|
||||
<Compile Include="View\Formula.xaml.cs">
|
||||
<DependentUpon>Formula.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -232,7 +248,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="UserControls\" />
|
||||
<Folder Include="ViewModel\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
+3
-1
@@ -1,6 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Extended.Wpf.Toolkit" version="3.5.0" targetFramework="net46" />
|
||||
<package id="CommonServiceLocator" version="2.0.2" targetFramework="net46" />
|
||||
<package id="Extended.Wpf.Toolkit" version="4.5.1" targetFramework="net46" />
|
||||
<package id="ModernUI.WPF" version="1.0.9" targetFramework="net46" />
|
||||
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net46" />
|
||||
<package id="SamOatesGames.ModernUI.Xceed.Toolkit" version="1.0.1905191936" targetFramework="net46" />
|
||||
</packages>
|
||||
Reference in new issue
Block a user