|
@ -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转存储数值
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|