diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 4acbb6d..012e3d5 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -267,6 +267,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties { } } + /// + /// 查找类似 Cancel 的本地化字符串。 + /// + public static string Cancel { + get { + return ResourceManager.GetString("Cancel", resourceCulture); + } + } + /// /// 查找类似 Client 的本地化字符串。 /// @@ -609,6 +618,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties { } } + /// + /// 查找类似 Details 的本地化字符串。 + /// + public static string Details { + get { + return ResourceManager.GetString("Details", resourceCulture); + } + } + /// /// 查找类似 Dide 的本地化字符串。 /// @@ -663,6 +681,24 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties { } } + /// + /// 查找类似 DispenseEndTime 的本地化字符串。 + /// + public static string DispenseEndTime { + get { + return ResourceManager.GetString("DispenseEndTime", resourceCulture); + } + } + + /// + /// 查找类似 DispenseGrams 的本地化字符串。 + /// + public static string DispenseGrams { + get { + return ResourceManager.GetString("DispenseGrams", resourceCulture); + } + } + /// /// 查找类似 Details were not sent 的本地化字符串。 /// @@ -942,6 +978,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties { } } + /// + /// 查找类似 Grams 的本地化字符串。 + /// + public static string Grams { + get { + return ResourceManager.GetString("Grams", resourceCulture); + } + } + /// /// 查找类似 Group 的本地化字符串。 /// @@ -1806,6 +1851,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties { } } + /// + /// 查找类似 ProductCode 的本地化字符串。 + /// + public static string ProductCode { + get { + return ResourceManager.GetString("ProductCode", resourceCulture); + } + } + /// /// 查找类似 ProductionPlanning 的本地化字符串。 /// @@ -1815,6 +1869,24 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties { } } + /// + /// 查找类似 ProductName 的本地化字符串。 + /// + public static string ProductName { + get { + return ResourceManager.GetString("ProductName", resourceCulture); + } + } + + /// + /// 查找类似 ProductType 的本地化字符串。 + /// + public static string ProductType { + get { + return ResourceManager.GetString("ProductType", resourceCulture); + } + } + /// /// 查找类似 ProgramGroup 的本地化字符串。 /// diff --git a/Properties/Resources.en-US.resx b/Properties/Resources.en-US.resx index a1e037d..4f988a6 100644 --- a/Properties/Resources.en-US.resx +++ b/Properties/Resources.en-US.resx @@ -990,4 +990,28 @@ The ticket already exists + + Details + + + ProductCode + + + ProductName + + + ProductType + + + Grams + + + Actual + + + EndTime + + + Cancel + \ No newline at end of file diff --git a/Properties/Resources.resx b/Properties/Resources.resx index 7fef75f..221bd27 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -990,4 +990,28 @@ The ticket already exists + + Details + + + ProductCode + + + ProductName + + + ProductType + + + Grams + + + DispenseGrams + + + DispenseEndTime + + + Cancel + \ No newline at end of file diff --git a/Properties/Resources.zh-CN.resx b/Properties/Resources.zh-CN.resx index b7c680a..9aaf8ae 100644 --- a/Properties/Resources.zh-CN.resx +++ b/Properties/Resources.zh-CN.resx @@ -990,4 +990,28 @@ 工单已经存在 + + 明细 + + + 原料代码 + + + 原料名称 + + + 原料类型 + + + 克重 + + + 实际 + + + 完成时间 + + + 取消 + \ No newline at end of file diff --git a/Properties/Resources.zh-TW.resx b/Properties/Resources.zh-TW.resx index f4b2bb1..47c7e8b 100644 --- a/Properties/Resources.zh-TW.resx +++ b/Properties/Resources.zh-TW.resx @@ -990,4 +990,28 @@ 工單已經存在 + + 詳細 + + + 原料代碼 + + + 原料名稱 + + + 原料類型 + + + 克重 + + + 實際 + + + 完成時間 + + + 取消 + \ No newline at end of file diff --git a/SunlightCentralizedControlManagement_SCCM_.csproj b/SunlightCentralizedControlManagement_SCCM_.csproj index ee69463..dad28ee 100644 --- a/SunlightCentralizedControlManagement_SCCM_.csproj +++ b/SunlightCentralizedControlManagement_SCCM_.csproj @@ -176,6 +176,9 @@ RoilingTextBlock.xaml + + DyelotView.xaml + Whole.xaml @@ -197,6 +200,9 @@ User.xaml + + UserMessage.xaml + ViewStep.xaml @@ -286,6 +292,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + Designer MSBuild:Compile @@ -314,6 +324,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/View/DyeingPlanView.xaml.cs b/View/DyeingPlanView.xaml.cs index 14e0f38..36ddbcf 100644 --- a/View/DyeingPlanView.xaml.cs +++ b/View/DyeingPlanView.xaml.cs @@ -411,17 +411,18 @@ namespace SunlightCentralizedControlManagement_SCCM_.View { //处理计划温度图表 TEMPTable.Clear(); - DataRow nrow = TEMPTable.NewRow(); + string TIMET = "00:00:00"; Double MSTT = 30.0; + Double TT; + Double TC; TEMPTable.Rows.Add(new object[] { TIMET, MSTT }); for (int i = 0; i < dat.Rows.Count; i++) { switch (dat.Rows[i][3].ToString())//步骤用时计算 { case "001": - Double TT = MSTT; - Double TC; + TT = MSTT; TC = (Double)dat.Rows[i][7]; if (TC > 9.9 || TC < 0.1) TC = 9.9;//计算限制 MSTT = (Double)dat.Rows[i][6]; @@ -440,10 +441,16 @@ namespace SunlightCentralizedControlManagement_SCCM_.View TEMPTable.Rows.Add(new object[] { TIMET, MSTT }); break; case "013": + TIMET = Convert.ToDateTime(TIMET).AddMinutes((Double)dat.Rows[i][8]* (Double)dat.Rows[i][9]).ToString("HH:mm:ss"); + TEMPTable.Rows.Add(new object[] { TIMET, MSTT }); break; case "015": + TIMET = Convert.ToDateTime(TIMET).AddMinutes((Double)dat.Rows[i][8]).ToString("HH:mm:ss"); + TEMPTable.Rows.Add(new object[] { TIMET, MSTT }); break; case "017": + TIMET = Convert.ToDateTime(TIMET).AddMinutes((Double)dat.Rows[i][8]).ToString("HH:mm:ss"); + TEMPTable.Rows.Add(new object[] { TIMET, MSTT }); break; case "020": TIMET = Convert.ToDateTime(TIMET).AddMinutes(5).ToString("HH:mm:ss"); @@ -462,6 +469,13 @@ namespace SunlightCentralizedControlManagement_SCCM_.View TEMPTable.Rows.Add(new object[] { TIMET, MSTT }); break; case "091": + TT = MSTT; + TC = (Double)dat.Rows[i][7]; + if (TC > 9.9 || TC < 0.1) TC = 9.9;//计算限制 + MSTT = (Double)dat.Rows[i][6]; + TT = Math.Abs(MSTT - TT) / TC * 60; + TIMET = Convert.ToDateTime(TIMET).AddSeconds(TT).ToString("HH:mm:ss"); + TEMPTable.Rows.Add(new object[] { TIMET, MSTT }); break; case "093": TIMET = Convert.ToDateTime(TIMET).AddMinutes((int)dat.Rows[i][6]).ToString("HH:mm:ss"); @@ -509,7 +523,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View conn_SC.Close(); DyelotsBulkedRecipe_.Fill(DyelotsBulkedRecipe); - DataTable ds = new DataTable();//载入信息 DYELOTS_data.Fill(ds); TEXTColorNumber.Text = ds.AsEnumerable().Select(row => row.Field("ColorNo")).First(); diff --git a/View/DyelotView.xaml b/View/DyelotView.xaml new file mode 100644 index 0000000..9777e8b --- /dev/null +++ b/View/DyelotView.xaml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/View/DyelotView.xaml.cs b/View/DyelotView.xaml.cs new file mode 100644 index 0000000..ae2b8ec --- /dev/null +++ b/View/DyelotView.xaml.cs @@ -0,0 +1,54 @@ +using DyeingComputer.UserClass; +using SunlightCentralizedControlManagement_SCCM_.UserClass; +using SunlightCentralizedControlManagement_SCCM_.ViewModel; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net; +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; +using System.Windows.Threading; +using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper; + +namespace SunlightCentralizedControlManagement_SCCM_.View +{ + /// + /// Whole.xaml 的交互逻辑 + /// + public partial class DyelotView : UserControl + { + private SQLiteHelper SQLiteHelpers = null; //定义数据库 + private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径 + + public DyelotView() + { + InitializeComponent(); + } + + private void UserControl_Loaded(object sender, RoutedEventArgs e) + { + } + + public void Dyelot(object dat) + { + SQLiteHelpers = new SQLiteHelper(DBAddress); + SQLiteHelpers.Open(); //打开数据库 + DataTable dat_c = SQLiteHelpers.ExecuteDataSet("select * from Dyelot where WorkOrder = '" + dat + "'", null).Tables[0];//缓存 + SQLiteHelpers.Close(); + + Grid_data.ItemsSource = dat_c.DefaultView; + } + + + } +} diff --git a/View/MonitorView.xaml.cs b/View/MonitorView.xaml.cs index 3a25a85..0e277a8 100644 --- a/View/MonitorView.xaml.cs +++ b/View/MonitorView.xaml.cs @@ -102,6 +102,9 @@ namespace SunlightCentralizedControlManagement_SCCM_.View machines_info = 2; log.Visibility = Visibility.Visible; Picture.Visibility = Visibility.Collapsed; + DyelotView dyelotView = new DyelotView(); + dyelotView.Dyelot(workOrder); + Picture.Content = dyelotView; }//单据 private void ListViewItem_Curve(object sender, MouseButtonEventArgs e) { diff --git a/View/ProductionPlanningView.xaml.cs b/View/ProductionPlanningView.xaml.cs index b65f124..40b4f8b 100644 --- a/View/ProductionPlanningView.xaml.cs +++ b/View/ProductionPlanningView.xaml.cs @@ -71,6 +71,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View minDate = DateTime.Now.Date; maxDate = minDate.AddDays(1); //添加表右键功能 + ganttTaskContextMenuItems.Add(new ContextMenuItem(DyelotClicked, Properties.Resources.Dyelot + "...")); ganttTaskContextMenuItems.Add(new ContextMenuItem(ViewClicked, Properties.Resources.View + "...")); ganttTaskContextMenuItems.Add(new ContextMenuItem(DelayedClicked, Properties.Resources.State + "...")); ganttTaskContextMenuItems.Add(new ContextMenuItem(EditClicked, Properties.Resources.edit + "...")); @@ -124,6 +125,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View Name = Properties.Resources.ProcessName + ": " + dataRows[j].Field("ProgramName"), Background = colorBackground, Status = colorStatus, + WorkOrder = dataRows[j].Field("WorkOrder").ToString(), ID = Properties.Resources.WorkOrder + ": " + dataRows[j].Field("WorkOrder").ToString(), Dyelot = Properties.Resources.Dyelot + ": " + dataRows[j].Field("Dyelot"), Remark = Properties.Resources.Remark + ": " + dataRows[j].Field("Remark"), @@ -145,11 +147,13 @@ namespace SunlightCentralizedControlManagement_SCCM_.View { Picture.Content = null; Picture.Width = 600; - Picture.Content = new ProductionPlanningEdit(ganttTask.ID,false); + Picture.Content = new ProductionPlanningEdit(ganttTask.WorkOrder,false); } - private void AdvanceClicked(GanttTask ganttTask) + private void DyelotClicked(GanttTask ganttTask)//领料单查看 { - + UserMessage userMessage = new UserMessage(); + userMessage.Dyelots(ganttTask.WorkOrder); + userMessage.ShowDialog(); } private void DelayedClicked(GanttTask ganttTask) { @@ -162,7 +166,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 SQLiteHelpers.Open(); //打开数据库 DataTable WorkOrder_dt = SQLiteHelpers.ExecuteDataSet( - "select * from WorkOrder where WorkOrder='" + ganttTask.ID + "'Order by StartTime", null).Tables[0]; //读取表写入缓存 + "select * from WorkOrder where WorkOrder='" + ganttTask.WorkOrder + "'Order by StartTime", null).Tables[0]; //读取表写入缓存 SQLiteHelpers.Close(); if (DateTime.Now > DateTime.Parse(WorkOrder_dt.Select().First().Field("EndTime").ToString())) @@ -176,7 +180,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View { Picture.Content = null; Picture.Width = 600; - Picture.Content = new ProductionPlanningEdit(ganttTask.ID, true); + Picture.Content = new ProductionPlanningEdit(ganttTask.WorkOrder, true); } else { @@ -195,7 +199,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.View ///执行删除 SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 SQLiteHelpers.Open(); //打开数据库 - SQLiteHelpers.Delete("WorkOrder", "WorkOrder='" + ganttTask.ID + "'", null); + SQLiteHelpers.Delete("WorkOrder", "WorkOrder='" + ganttTask.WorkOrder + "'", null); + SQLiteHelpers.Delete("WorkOrderSteps", "WorkOrder='" + ganttTask.WorkOrder + "'", null); SQLiteHelpers.Close(); GanttChartNEW(); } diff --git a/WindowsView/UserMessage.xaml b/WindowsView/UserMessage.xaml new file mode 100644 index 0000000..88a4d6a --- /dev/null +++ b/WindowsView/UserMessage.xaml @@ -0,0 +1,15 @@ + + +