总览信息发布
This commit is contained in:
commit
0c6bc3105f
5 files changed
+163
-49
No files matched your search
+30
-12
@@ -105,8 +105,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
dat_821.Add("INSTRUCTION", "CONTINUE");
|
||||
DataRow drEmployee = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First();
|
||||
int index = Convert.ToInt16(drEmployee.Field<object>("ID"));
|
||||
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString { ID = index,
|
||||
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index) + dat_821.ToJsonString() });
|
||||
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString
|
||||
{
|
||||
ID = index,
|
||||
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index) + dat_821.ToJsonString()
|
||||
});
|
||||
}
|
||||
|
||||
Insert.IsEnabled = false;
|
||||
@@ -126,8 +129,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
dat_821.Add("INSTRUCTION", "PAUSE");
|
||||
DataRow drEmployee = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First();
|
||||
int index = Convert.ToInt16(drEmployee.Field<object>("ID"));
|
||||
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString { ID = index,
|
||||
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index) + dat_821.ToJsonString() });
|
||||
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString
|
||||
{
|
||||
ID = index,
|
||||
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index) + dat_821.ToJsonString()
|
||||
});
|
||||
}
|
||||
Insert.IsEnabled = true;
|
||||
edit.IsEnabled = true;
|
||||
@@ -145,8 +151,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
dat_821.Add("INSTRUCTION", "STOP");
|
||||
DataRow drEmployee = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First();
|
||||
int index = Convert.ToInt16(drEmployee.Field<object>("ID"));
|
||||
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString { ID = index,
|
||||
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index) + dat_821.ToJsonString() });
|
||||
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString
|
||||
{
|
||||
ID = index,
|
||||
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index) + dat_821.ToJsonString()
|
||||
});
|
||||
}
|
||||
}//停止
|
||||
private void ListViewItem_edit(object sender, MouseButtonEventArgs e)
|
||||
@@ -178,8 +187,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
|
||||
DataRow drEmployee = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First();
|
||||
int index = Convert.ToInt16(drEmployee.Field<object>("ID"));
|
||||
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString { ID = index,
|
||||
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index) + dat_821.ToJsonString() });
|
||||
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString
|
||||
{
|
||||
ID = index,
|
||||
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index) + dat_821.ToJsonString()
|
||||
});
|
||||
|
||||
MainWindowViewModel.TechnologicalProcess_bool = true;
|
||||
}
|
||||
@@ -232,8 +244,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
|
||||
DataRow drEmployee = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First();
|
||||
int index = Convert.ToInt16(drEmployee.Field<object>("ID"));
|
||||
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString { ID = index,
|
||||
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index) + dat_821.ToJsonString() });
|
||||
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString
|
||||
{
|
||||
ID = index,
|
||||
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index) + dat_821.ToJsonString()
|
||||
});
|
||||
}
|
||||
private void ListViewItem_Delete(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
@@ -245,8 +260,11 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
dat_821.Add("ID", ID);
|
||||
DataRow drEmployee = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First();
|
||||
int index = Convert.ToInt16(drEmployee.Field<object>("ID"));
|
||||
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString { ID = index,
|
||||
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index) + dat_821.ToJsonString() });
|
||||
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString
|
||||
{
|
||||
ID = index,
|
||||
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", index) + dat_821.ToJsonString()
|
||||
});
|
||||
|
||||
MainWindowViewModel.TechnologicalProcess_bool = true;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
xmlns:local="clr-namespace:SunlightCentralizedControlManagement_SCCM_.View"
|
||||
xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
mc:Ignorable="d"
|
||||
mc:Ignorable="d" Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="900" d:DesignWidth="550">
|
||||
<Grid Background="White" Cursor="">
|
||||
<ComboBox HorizontalAlignment="Left" Height="30" Margin="150,30,0,0" x:Name="comboBoxMachine" VerticalAlignment="Top" Width="270"
|
||||
@@ -82,7 +82,7 @@
|
||||
</DataGrid>
|
||||
|
||||
|
||||
<Button Content="{x:Static lang:Resources.Save}" HorizontalAlignment="Left" Height="35" Margin="450,0,0,10" VerticalAlignment="Bottom" Width="80" Click="Button_Click"/>
|
||||
<Button x:Name="Save" Content="{x:Static lang:Resources.Save}" HorizontalAlignment="Left" Height="35" Margin="450,0,0,10" VerticalAlignment="Bottom" Width="80" Click="Button_Click"/>
|
||||
<Button HorizontalAlignment="Left" Height="35" Margin="0,0,50,10" VerticalAlignment="Bottom" Width="60" Click="Button_Quit" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{x:Null}">
|
||||
<materialDesign:PackIcon Kind="ArrowRight" Foreground="#FF00204E" HorizontalAlignment="Center" VerticalAlignment="Center" Width="50" Height="35" />
|
||||
</Button>
|
||||
|
||||
@@ -35,18 +35,45 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径
|
||||
DataTable ProgramName = new DataTable();
|
||||
DataTable WorkOrder =new DataTable();
|
||||
DataTable dat = new DataTable();
|
||||
public ProductionPlanningEdit()
|
||||
public ProductionPlanningEdit(string workOrder, bool save)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
ProgramName = SQLiteHelpers.ExecuteDataSet("select * from ProgramName order by ProgramID desc", null).Tables[0]; //读取计划表写入缓存
|
||||
if (!string.IsNullOrEmpty(workOrder))
|
||||
{
|
||||
WorkOrder = SQLiteHelpers.ExecuteDataSet("select * from Workorder order by EndTime desc", null).Tables[0];
|
||||
// dat = SQLiteHelpers.ExecuteDataSet("select * from WorkorderSteps order by Step asc", null).Tables[0];
|
||||
}
|
||||
SQLiteHelpers.Close(); //关闭连接
|
||||
|
||||
comboBoxMachine.ItemsSource = MainWindowViewModel.Machines.AsEnumerable().Select(rowdata => rowdata.Field<string>("name")).ToList();//转换机台
|
||||
comboBoxProgram.ItemsSource = ProgramName.AsEnumerable().Select(rowdata => rowdata.Field<string>("ProgramName")).ToList();//转换工艺代码
|
||||
if (!string.IsNullOrEmpty(workOrder))
|
||||
{
|
||||
//WorkOrder.Select().First().Field<object>("WorkOrder").ToString();
|
||||
comboBoxMachine.Text = WorkOrder.Select().First().Field<object>("Machines").ToString();
|
||||
comboBoxProgram.Text = WorkOrder.Select().First().Field<object>("ProgramName").ToString();
|
||||
comboBoxDyelot.Text = WorkOrder.Select().First().Field<object>("Dyelot").ToString();
|
||||
}
|
||||
if (save)//允许编辑
|
||||
{
|
||||
comboBoxMachine.ItemsSource = MainWindowViewModel.Machines.AsEnumerable().Select(rowdata => rowdata.Field<string>("name")).ToList();//转换机台
|
||||
comboBoxProgram.ItemsSource = ProgramName.AsEnumerable().Select(rowdata => rowdata.Field<string>("ProgramName")).ToList();//转换工艺代码
|
||||
}
|
||||
else
|
||||
{
|
||||
Save.IsEnabled = false;
|
||||
comboBoxMachine.IsEnabled = false;
|
||||
comboBoxProgram.IsEnabled = false;
|
||||
comboBoxDyelot.IsEnabled = false;
|
||||
Grid_data.IsEnabled = false;
|
||||
}
|
||||
}
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
private void comboBoxMachine_DropDownClosed(object sender, EventArgs e)//机台选择
|
||||
{
|
||||
@@ -163,8 +190,12 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
//SQLiteHelpers.Open(); //打开数据库
|
||||
SQLiteHelpers.InsertData("WorkOrder", WorkOrder_new);// 执行插入
|
||||
DataTable data_t = dat.Clone();
|
||||
data_t.Columns.Add(new DataColumn() { ColumnName = "WorkOrder", DataType = typeof(String), DefaultValue = WorkOrder_ });
|
||||
data_t.Columns.Add(new DataColumn() { ColumnName = "Dyelot", DataType = typeof(String), DefaultValue = Dyelot_ });
|
||||
try
|
||||
{
|
||||
data_t.Columns.Add(new DataColumn() { ColumnName = "WorkOrder", DataType = typeof(String), DefaultValue = WorkOrder_ });
|
||||
data_t.Columns.Add(new DataColumn() { ColumnName = "Dyelot", DataType = typeof(String), DefaultValue = Dyelot_ });
|
||||
}
|
||||
catch (Exception) { }
|
||||
int a = dat.Rows.Count;
|
||||
for (int x = 0; x < a; x++)
|
||||
{
|
||||
@@ -251,8 +282,12 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
//SQLiteHelpers.Open(); //打开数据库
|
||||
SQLiteHelpers.InsertData("WorkOrder", WorkOrder_new);// 执行插入
|
||||
DataTable data_t = dat.Clone();
|
||||
data_t.Columns.Add(new DataColumn() { ColumnName = "WorkOrder", DataType = typeof(String), DefaultValue = WorkOrder_ });
|
||||
data_t.Columns.Add(new DataColumn() { ColumnName = "Dyelot", DataType = typeof(String), DefaultValue = Dyelot_ });
|
||||
try
|
||||
{
|
||||
data_t.Columns.Add(new DataColumn() { ColumnName = "WorkOrder", DataType = typeof(String), DefaultValue = WorkOrder_ });
|
||||
data_t.Columns.Add(new DataColumn() { ColumnName = "Dyelot", DataType = typeof(String), DefaultValue = Dyelot_ });
|
||||
}
|
||||
catch (Exception) { }
|
||||
int a = dat.Rows.Count;
|
||||
for (int x = 0; x < a ; x++)
|
||||
{
|
||||
@@ -316,9 +351,9 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
DataTable temp = SQLiteHelpers.ExecuteDataSet(
|
||||
"select * from ProgramSteps where Program='" + sArray[i] + "' order by Step asc", null).Tables[0]; //读取计划表写入缓存
|
||||
if (dat.Columns.Count == 0) dat = temp.Clone();
|
||||
foreach (DataRow dr in temp.Rows)
|
||||
foreach (DataRow drT in temp.Rows)
|
||||
{
|
||||
dat.Rows.Add(dr.ItemArray);
|
||||
dat.Rows.Add(drT.ItemArray);
|
||||
}
|
||||
//dat = temp.Copy();
|
||||
}
|
||||
@@ -352,7 +387,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
string ProgramNAME;
|
||||
string Numder = null;
|
||||
string ID = null;
|
||||
string P1, P2, P3, P4, P5;
|
||||
string P1, P2, P3, P4, P5;
|
||||
|
||||
private void Grid_data_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
int rownum = Grid_data.SelectedIndex;//获取鼠标选中行并定义变量
|
||||
|
||||
@@ -133,11 +133,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
}//创建日程图
|
||||
private void ViewClicked(GanttTask ganttTask)
|
||||
{
|
||||
MessageBox.Show("New clicked for task " + ganttTask.Name);
|
||||
Picture.Content = null;
|
||||
Picture.Width = 600;
|
||||
Picture.Content = new ProductionPlanningEdit(ganttTask.ID,false);
|
||||
}
|
||||
private void EditClicked(GanttTask ganttTask)
|
||||
{
|
||||
MessageBox.Show("Edit clicked for task " + ganttTask.Name);
|
||||
Picture.Content = null;
|
||||
Picture.Width = 600;
|
||||
Picture.Content = new ProductionPlanningEdit(ganttTask.ID, true);
|
||||
}
|
||||
private void DeleteClicked(GanttTask ganttTask)//删除
|
||||
{
|
||||
@@ -181,8 +185,9 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
}
|
||||
private void ListViewItem_New(object sender, System.Windows.Input.MouseButtonEventArgs e)//新建事件
|
||||
{
|
||||
Picture.Content = null;
|
||||
Picture.Width = 600;
|
||||
Picture.Content = new ProductionPlanningEdit();
|
||||
Picture.Content = new ProductionPlanningEdit(null, true);
|
||||
}
|
||||
private void WorkOrderNumder_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user