Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage
This commit is contained in:
commit
b2e0d05648
5 files changed
+145
-1
No files matched your search
+1
-1
@@ -56,7 +56,7 @@
|
||||
<TextBox x:Name="USER" HorizontalAlignment="Right" Height="30" Margin="0,0,155,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="100" FontSize="14"
|
||||
Background="{x:Null}" BorderBrush="{x:Null}" SelectionBrush="{x:Null}" IsReadOnly="True" IsUndoEnabled="False" MaxLines="1" IsEnabled="False" Grid.Column="1"/>
|
||||
<Button Content="新工单" HorizontalAlignment="Left" Margin="335,35,0,0" Height="30" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" FontSize="20" Click="Button_NewOrder" Focusable ="False" Grid.Column="1"/>
|
||||
<Button Content="归属订单" HorizontalAlignment="Left" Margin="300,70,0,0" Height="30" VerticalAlignment="Top" Width="105" Background="#FFF9F9F9" FontSize="20" Focusable ="False" Click="Button_Technology" Grid.Column="1"/>
|
||||
<Button Content="归属订单" HorizontalAlignment="Left" Margin="300,70,0,0" Height="30" VerticalAlignment="Top" Width="105" Background="#FFF9F9F9" FontSize="20" Focusable ="False" Click="Button_Order" Grid.Column="1"/>
|
||||
<Button Content="预设工艺" HorizontalAlignment="Left" Margin="300,105,0,0" Height="30" VerticalAlignment="Top" Width="105" Background="#FFF9F9F9" FontSize="20" Focusable ="False" Click="Button_Technology" Grid.Column="1"/>
|
||||
<TextBlock HorizontalAlignment="Left" Height="35" Margin="5,35,0,0" TextWrapping="Wrap" Text="领料单号:" VerticalAlignment="Top" Width="90" FontSize="20" Background="WhiteSmoke"/>
|
||||
<TextBlock HorizontalAlignment="Left" Height="35" Margin="5,70,0,0" TextWrapping="Wrap" Text="流转订单:" VerticalAlignment="Top" Width="90" FontSize="20"/>
|
||||
|
||||
@@ -543,6 +543,11 @@ namespace formula_manage
|
||||
if (P > 1) Procedures_P.Text = (P - 1).ToString();
|
||||
}
|
||||
|
||||
private void Button_Order(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Deputy.Content = new View.ViewOrder(); //打开工艺选择
|
||||
}
|
||||
|
||||
private void Button_Technology(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Deputy.Content = new View.ViewProcess(); //打开工艺选择
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<UserControl x:Class="formula_manage.View.ViewOrder"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:formula_manage.View"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="150" d:DesignWidth="405">
|
||||
<Grid>
|
||||
<DataGrid x:Name="Order" AlternationCount="2" IsReadOnly="True"
|
||||
HeadersVisibility ="Column" Margin="0,0,0,0" 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"
|
||||
CanUserSortColumns="False" Background="White" SelectionMode="Single">
|
||||
<DataGrid.RowStyle >
|
||||
<Style TargetType="{x:Type DataGridRow}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
||||
<Setter Property="Background" Value="#FFFFFFFF" />
|
||||
</Trigger>
|
||||
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
||||
<Setter Property="Background" Value="#FFF5F5F5" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="False">
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="MinWidth" Value="20"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Background" Value="#FFC0C0C0"/>
|
||||
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
|
||||
<Setter Property="Foreground" Value="#000000"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.CellStyle>
|
||||
<DataGrid.Columns>
|
||||
<!--列信息绑定-->
|
||||
<DataGridTextColumn Header="订单号" Binding="{Binding OrdeNO}" Width="100" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="工艺名称" Binding="{Binding ProcessNAME}" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="工艺代码" Binding="{Binding ProcessCODE}" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False" Visibility="Collapsed" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="品名" Binding="{Binding colour}" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="客户" Binding="{Binding customer}" Width="200" FontSize="15" MaxWidth="200" MinWidth="80" CanUserReorder="False" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="下单时间" Binding="{Binding OrdeTime}" Width="200" FontSize="15" MaxWidth="200" MinWidth="80" CanUserReorder="False" Visibility="Collapsed" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="备注" Binding="{Binding REMARK}" Width="800" FontSize="15" MinWidth="80" CanUserReorder="False" IsReadOnly="True"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,78 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace formula_manage.View
|
||||
{
|
||||
/// <summary>
|
||||
/// ViewProcess.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ViewOrder: UserControl
|
||||
{
|
||||
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini"; //配置文件路径
|
||||
|
||||
string TEXT_SQLIP;
|
||||
string TEXT_SQLNAME;
|
||||
string TEXT_SQMOD;
|
||||
string TEXT_SQLUSER;
|
||||
string TEXT_SQLPASWOR;
|
||||
string Connstr_SC;
|
||||
|
||||
public ViewOrder()
|
||||
{
|
||||
InitializeComponent();
|
||||
sql_();
|
||||
}
|
||||
|
||||
private async void sql_()
|
||||
{
|
||||
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);//生效配置读取
|
||||
TEXT_SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
|
||||
TEXT_SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2");
|
||||
TEXT_SQMOD = Configini.IniReadvalue("SQL_SERVER", "SQL3");
|
||||
TEXT_SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL4");
|
||||
TEXT_SQLPASWOR = Configini.IniReadvalue("SQL_SERVER", "SQL5");
|
||||
if (TEXT_SQMOD == "0") //判断连接方式
|
||||
{
|
||||
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";Trusted_Connection=SSPI";
|
||||
}
|
||||
else
|
||||
{
|
||||
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";User ID=" + TEXT_SQLUSER + ";Password=" + TEXT_SQLPASWOR;
|
||||
}
|
||||
string MAC_sql = "SELECT OrdeNO ,ProcessNAME ,ProcessCODE ,colour ,customer ,OrdeTime ,REMARK FROM [Dispensing].[dbo].[ORDER]";//查询语句
|
||||
|
||||
SqlConnection conn_SC = new SqlConnection(Connstr_SC); //实例化
|
||||
try
|
||||
{
|
||||
await conn_SC.OpenAsync(); //打开数据连接
|
||||
SqlDataAdapter Stuff_data = new SqlDataAdapter(MAC_sql, Connstr_SC); //查询
|
||||
|
||||
DataTable dataTable = new DataTable(); //建立缓存
|
||||
Stuff_data.Fill(dataTable); //查询结果存入缓存
|
||||
conn_SC.Close(); //关闭连接
|
||||
|
||||
Order.ItemsSource = dataTable.DefaultView; //数据加入表格
|
||||
//Order.DisplayMemberPath = "Name";
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
System.Windows.MessageBox.Show("请求信息失败,检查连接");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -216,6 +216,9 @@
|
||||
<Compile Include="View\Formula.xaml.cs">
|
||||
<DependentUpon>Formula.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\ViewOrder.xaml.cs">
|
||||
<DependentUpon>ViewOrder.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\ViewProcess.xaml.cs">
|
||||
<DependentUpon>ViewProcess.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -274,6 +277,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="View\ViewOrder.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="View\ViewProcess.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
Reference in new issue
Block a user