排产增加读取中间库信息
This commit is contained in:
commit
1eb54327db
3 files changed
+54
-7
No files matched your search
@@ -10,7 +10,7 @@
|
|||||||
d:DesignHeight="900" d:DesignWidth="1100">
|
d:DesignHeight="900" d:DesignWidth="1100">
|
||||||
<Grid Background="White" Cursor="">
|
<Grid Background="White" Cursor="">
|
||||||
<ComboBox HorizontalAlignment="Left" Height="30" Margin="140,30,10,0" x:Name="comboBoxWorkOrder" VerticalAlignment="Top" Width="270"
|
<ComboBox HorizontalAlignment="Left" Height="30" Margin="140,30,10,0" x:Name="comboBoxWorkOrder" VerticalAlignment="Top" Width="270"
|
||||||
FontSize="15" IsEditable="True" BorderBrush="#FF673AB7" DropDownClosed="comboBoxMachine_DropDownClosed" KeyDown="comboBoxWorkOrder_KeyDown"/>
|
FontSize="15" IsEditable="True" BorderBrush="#FF673AB7" KeyDown="comboBoxWorkOrder_KeyDown"/>
|
||||||
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,30,280,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.orders}"
|
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,30,280,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.orders}"
|
||||||
VerticalAlignment="Top" Width="120" FontSize="25"/>
|
VerticalAlignment="Top" Width="120" FontSize="25"/>
|
||||||
<ComboBox HorizontalAlignment="Left" Height="30" Margin="140,80,10,0" x:Name="comboBoxDyelot" VerticalAlignment="Top" Width="270"
|
<ComboBox HorizontalAlignment="Left" Height="30" Margin="140,80,10,0" x:Name="comboBoxDyelot" VerticalAlignment="Top" Width="270"
|
||||||
@@ -23,7 +23,9 @@
|
|||||||
VerticalAlignment="Top" Width="120" FontSize="25"/>
|
VerticalAlignment="Top" Width="120" FontSize="25"/>
|
||||||
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,180,280,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.ColorNumber}"
|
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,180,280,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.ColorNumber}"
|
||||||
VerticalAlignment="Top" Width="120" FontSize="25"/>
|
VerticalAlignment="Top" Width="120" FontSize="25"/>
|
||||||
<TextBox HorizontalAlignment="Left" Height="30" Margin="140,180,10,0" x:Name="TEXTColorNumber" VerticalAlignment="Top" Width="270"
|
<TextBlock HorizontalAlignment="Left" Height="40" Margin="360,180,280,0" x:Name="color" TextWrapping="Wrap"
|
||||||
|
VerticalAlignment="Top" Width="50" Background="#FF336FA8" MouseDown="color_color_MouseDoubleClick"/>
|
||||||
|
<TextBox HorizontalAlignment="Left" Height="30" Margin="140,180,10,0" x:Name="TEXTColorNumber" VerticalAlignment="Top" Width="200"
|
||||||
FontSize="15" BorderBrush="#FF673AB7" />
|
FontSize="15" BorderBrush="#FF673AB7" />
|
||||||
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,230,280,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.ColorName}"
|
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,230,280,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.ColorName}"
|
||||||
VerticalAlignment="Top" Width="120" FontSize="25"/>
|
VerticalAlignment="Top" Width="120" FontSize="25"/>
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using nGantt.GanttChart;
|
using nGantt.GanttChart;
|
||||||
|
using ScottPlot.Palettes;
|
||||||
using SunlightCentralizedControlManagement_SCCM_.UserClass;
|
using SunlightCentralizedControlManagement_SCCM_.UserClass;
|
||||||
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
|
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
|
||||||
using SunlightCentralizedControlManagement_SCCM_.WindowsView;
|
using SunlightCentralizedControlManagement_SCCM_.WindowsView;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
@@ -99,12 +101,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
}
|
}
|
||||||
string[] pArray = Regex.Split(comboBoxProgram.Text, @"\+", RegexOptions.IgnoreCase);
|
string[] pArray = Regex.Split(comboBoxProgram.Text, @"\+", RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
|
|
||||||
//单机器信息写入
|
//单机器信息写入
|
||||||
string sTime;
|
string sTime;
|
||||||
string StartTime_;
|
string StartTime_;
|
||||||
string WorkOrder_ = comboBoxMachine.Text + "_" + DateTime.Now.ToString("yyMMddHHmmss");
|
string WorkOrder_ = comboBoxMachine.Text + "_" + DateTime.Now.ToString("yyMMddHHmmss");
|
||||||
if (!string.IsNullOrEmpty(WorkOrder_n)) WorkOrder_ = WorkOrder_n;
|
if (!string.IsNullOrEmpty(comboBoxWorkOrder.Text)) WorkOrder_ = comboBoxWorkOrder.Text;
|
||||||
string ProgramName_ = comboBoxProgram.Text;
|
string ProgramName_ = comboBoxProgram.Text;
|
||||||
string ProgramID_ = null;
|
string ProgramID_ = null;
|
||||||
for (int j = 0; j < pArray.Length; j++)
|
for (int j = 0; j < pArray.Length; j++)
|
||||||
@@ -459,13 +460,41 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
Picture.Content = new View.CurveTemp(TEMPTable);
|
Picture.Content = new View.CurveTemp(TEMPTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void comboBoxWorkOrder_KeyDown(object sender, KeyEventArgs e)//工单输入
|
private async void comboBoxWorkOrder_KeyDown(object sender, KeyEventArgs e)//工单输入
|
||||||
{
|
{
|
||||||
if (e.Key == Key.Enter)
|
if (e.Key == Key.Enter)
|
||||||
{
|
{
|
||||||
|
string Connstr_SC;
|
||||||
|
string DYELOTS_sql = "SELECT count(*) FROM [dbo].[DYELOTS] WHERE OrderNo = '" + comboBoxWorkOrder.Text + "'";//单号查询语句
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//do what you want
|
if (MainWindowViewModel.SQMOD == "Windows Authentication")
|
||||||
|
{
|
||||||
|
Connstr_SC = "server=" + MainWindowViewModel.SQLIP + ";database=" + MainWindowViewModel.SQLNAME + ";Trusted_Connection=SSPI";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Connstr_SC = "server=" + MainWindowViewModel.SQLIP + ";database=" + MainWindowViewModel.SQLNAME + ";User ID=" + MainWindowViewModel.SQLUSER + ";Password=" + MainWindowViewModel.SQLPASWORD;
|
||||||
|
}
|
||||||
|
SqlConnection conn_SC = new SqlConnection(Connstr_SC);
|
||||||
|
await conn_SC.OpenAsync(); //连接数据库
|
||||||
|
SqlDataAdapter DYELOTS_data = new SqlDataAdapter(DYELOTS_sql, Connstr_SC); //查询
|
||||||
|
conn_SC.Close();
|
||||||
|
|
||||||
|
DataTable ds = new DataTable();
|
||||||
|
DYELOTS_data.Fill(ds);
|
||||||
|
comboBoxDyelot.Text = ds.AsEnumerable().Select(row => row.Field<string>("Dyelot")).First();
|
||||||
|
comboBoxMachine.Text = ds.AsEnumerable().Select(row => row.Field<string>("Machine")).First();
|
||||||
|
TEXTColorNumber.Text = ds.AsEnumerable().Select(row => row.Field<string>("ColorNo")).First();
|
||||||
|
TEXTColorName.Text = ds.AsEnumerable().Select(row => row.Field<string>("ColorName")).First();
|
||||||
|
TEXTClient.Text = ds.AsEnumerable().Select(row => row.Field<string>("CustomerName")).First();
|
||||||
|
TEXTClothSpecies.Text = ds.AsEnumerable().Select(row => row.Field<string>("FabricName")).First();
|
||||||
|
TEXTClothWeight.Text = ds.AsEnumerable().Select(row => row.Field<string>("TotalWeight")).First();
|
||||||
|
TEXTBathRatio.Text = ds.AsEnumerable().Select(row => row.Field<string>("LiquidRatio")).First();
|
||||||
|
TEXTTotal.Text = ds.AsEnumerable().Select(row => row.Field<string>("TotalVolume")).First();
|
||||||
|
TEXTUSER.Text = ds.AsEnumerable().Select(row => row.Field<string>("UserAccount")).First();
|
||||||
|
comboBoxProgram.Text = ds.AsEnumerable().Select(row => row.Field<string>("Program")).First();
|
||||||
|
color_= color.Background.ToString();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -500,5 +529,21 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
TEXTTotal.SelectionStart, e.Text));
|
TEXTTotal.SelectionStart, e.Text));
|
||||||
TEXTTotal.Text = TEXTTotal.Text.Trim();
|
TEXTTotal.Text = TEXTTotal.Text.Trim();
|
||||||
}
|
}
|
||||||
|
private void color_color_MouseDoubleClick(object sender, MouseButtonEventArgs e)//颜色
|
||||||
|
{
|
||||||
|
System.Windows.Forms.ColorDialog colorDialog = new System.Windows.Forms.ColorDialog();//使用调色盘控件ColorDialog
|
||||||
|
if (colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)//打开调色盘
|
||||||
|
{
|
||||||
|
|
||||||
|
System.Drawing.Color DColor = colorDialog.Color;////获取选中色彩信息
|
||||||
|
//System.Windows.Media.Color MColor = new System.Windows.Media.Color();//转换
|
||||||
|
System.Windows.Media.Color MColor = System.Windows.Media.Color.FromArgb(DColor.A, DColor.R, DColor.G, DColor.B);//转换并配置ARGB参数
|
||||||
|
color.Background = new SolidColorBrush(MColor);//ARGB参数输出至Color的背景色
|
||||||
|
//string colorCode = string.Format("{0:X2}", DColor.B) + string.Format("{0:X2}", DColor.G) + string.Format("{0:X2}", DColor.R);//反向十六进制RGB
|
||||||
|
//string colorCode = string.Format("{0:X2}", DColor.R) + string.Format("{0:X2}", DColor.G) + string.Format("{0:X2}", DColor.B);//正向十六进制RGB
|
||||||
|
//ColorCode_SQL = Convert.ToInt32(colorCode, 16);//十六进制RGB转存储数值
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
MainWindowViewModel.SQLNAME = TEXT_SQLNAME.Text;
|
MainWindowViewModel.SQLNAME = TEXT_SQLNAME.Text;
|
||||||
MainWindowViewModel.SQMOD = TEXT_SQMOD.Text;
|
MainWindowViewModel.SQMOD = TEXT_SQMOD.Text;
|
||||||
MainWindowViewModel.SQLUSER = TEXT_SQLUSER.Text;
|
MainWindowViewModel.SQLUSER = TEXT_SQLUSER.Text;
|
||||||
MainWindowViewModel.SQLNAME = TEXT_SQLNAME.Text;
|
MainWindowViewModel.SQLPASWORD = TEXT_SQLPASWORD.Text;
|
||||||
MainWindowViewModel.SQL_LINK();//更新设定
|
MainWindowViewModel.SQL_LINK();//更新设定
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user