添加自定义通知页面,添加领料单查看,修改温度图表逻辑
This commit is contained in:
commit
a2bb445e1d
13 files changed
+382
-10
No files matched your search
@@ -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<string>("ColorNo")).First();
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<UserControl x:Class="SunlightCentralizedControlManagement_SCCM_.View.DyelotView"
|
||||
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:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties"
|
||||
xmlns:local="clr-namespace:SunlightCentralizedControlManagement_SCCM_.View"
|
||||
mc:Ignorable="d" Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<DataGrid x:Name="Grid_data" AlternationCount="2" IsReadOnly="True" d:ItemsSource="{d:SampleData ItemCount=99}"
|
||||
Background="White" HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9"
|
||||
GridLinesVisibility="All" ColumnHeaderHeight="40"
|
||||
Grid.ColumnSpan="2" CanUserResizeRows="False" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||
CanUserAddRows="False" CanUserDeleteRows="False" HeadersVisibility ="Column" SelectionMode="Single"
|
||||
Margin="0,0,0,0" BorderBrush="#FFC9C9C9" FontSize="16" BorderThickness="5,5,5,5" >
|
||||
<DataGrid.RowStyle >
|
||||
<Style TargetType="{x:Type DataGridRow}">
|
||||
<Setter Property="Height" Value="25" />
|
||||
<Setter Property="FontSize" Value="15" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
||||
<Setter Property="Background" Value="#FFFFFFFF" />
|
||||
</Trigger>
|
||||
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
||||
<Setter Property="Background" Value="#FFF0F0F0" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="False"/>
|
||||
</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="Black"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.CellStyle>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<!--列信息绑定-->
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Step}" Binding="{Binding Step}" Width="80" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.ProductCode}" Width="150" Binding="{Binding ProductCode}" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.ProductName}" Width="150" Binding="{Binding ProductName}" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.ProductType}" Width="100" Binding="{Binding ProductType}" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.State}" Width="80" Binding="{Binding State}" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Grams}" Width="150" Binding="{Binding Grams}" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.DispenseGrams}" Width="150" Binding="{Binding DispenseGrams}" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.DispenseEndTime}" Width="200" Binding="{Binding DispenseEndTime}" IsReadOnly="True"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// Whole.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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<string>("ProgramName"),
|
||||
Background = colorBackground,
|
||||
Status = colorStatus,
|
||||
WorkOrder = dataRows[j].Field<string>("WorkOrder").ToString(),
|
||||
ID = Properties.Resources.WorkOrder + ": " + dataRows[j].Field<string>("WorkOrder").ToString(),
|
||||
Dyelot = Properties.Resources.Dyelot + ": " + dataRows[j].Field<string>("Dyelot"),
|
||||
Remark = Properties.Resources.Remark + ": " + dataRows[j].Field<string>("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<object>("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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user