Browse Source

日程时间调整页面,添加翻译,搜素逻辑

master
sc 9 months ago
parent
commit
e91b536ba4
  1. 9
      Properties/Resources.Designer.cs
  2. 3
      Properties/Resources.en-US.resx
  3. 3
      Properties/Resources.resx
  4. 3
      Properties/Resources.zh-CN.resx
  5. 6
      Properties/Resources.zh-TW.resx
  6. 7
      SunlightCentralizedControlManagement_SCCM_.csproj
  7. 20
      View/ProductionPlanningEdit.xaml.cs
  8. 44
      View/ProductionPlanningView.xaml.cs
  9. 2
      ViewModel/MainWindowViewModel.cs
  10. 20
      WindowsView/SchedulingTime.xaml
  11. 36
      WindowsView/SchedulingTime.xaml.cs

9
Properties/Resources.Designer.cs

@ -591,6 +591,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
/// <summary>
/// 查找类似 Does Not Exist 的本地化字符串。
/// </summary>
public static string DoesNotExist {
get {
return ResourceManager.GetString("DoesNotExist", resourceCulture);
}
}
/// <summary>
/// 查找类似 Drainage 的本地化字符串。
/// </summary>

3
Properties/Resources.en-US.resx

@ -939,4 +939,7 @@
<data name="Color" xml:space="preserve">
<value>Color</value>
</data>
<data name="DoesNotExist" xml:space="preserve">
<value>Does Not Exist</value>
</data>
</root>

3
Properties/Resources.resx

@ -939,4 +939,7 @@
<data name="Color" xml:space="preserve">
<value>Color</value>
</data>
<data name="DoesNotExist" xml:space="preserve">
<value>Does Not Exist</value>
</data>
</root>

3
Properties/Resources.zh-CN.resx

@ -939,4 +939,7 @@
<data name="Color" xml:space="preserve">
<value>颜色</value>
</data>
<data name="DoesNotExist" xml:space="preserve">
<value>不存在</value>
</data>
</root>

6
Properties/Resources.zh-TW.resx

@ -936,4 +936,10 @@
<data name="Multi" xml:space="preserve">
<value>多机</value>
</data>
<data name="Color" xml:space="preserve">
<value>顏色</value>
</data>
<data name="DoesNotExist" xml:space="preserve">
<value>頁面不存在</value>
</data>
</root>

7
SunlightCentralizedControlManagement_SCCM_.csproj

@ -175,6 +175,9 @@
<Compile Include="WindowsView\MachineSelection.xaml.cs">
<DependentUpon>MachineSelection.xaml</DependentUpon>
</Compile>
<Compile Include="WindowsView\SchedulingTime.xaml.cs">
<DependentUpon>SchedulingTime.xaml</DependentUpon>
</Compile>
<Compile Include="WindowsView\ViewStep.xaml.cs">
<DependentUpon>ViewStep.xaml</DependentUpon>
</Compile>
@ -264,6 +267,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="WindowsView\SchedulingTime.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="WindowsView\ViewStep.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

20
View/ProductionPlanningEdit.xaml.cs

@ -37,6 +37,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
DataTable ProgramName = new DataTable();
DataTable WorkOrder =new DataTable();
DataTable dat = new DataTable();
public string WorkOrder_n;
public ProductionPlanningEdit(string workOrder, bool save)
{
InitializeComponent();
@ -45,7 +46,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
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];
WorkOrder = SQLiteHelpers.ExecuteDataSet("select * from Workorder where Workorder='" + workOrder + "' order by EndTime desc", null).Tables[0];
// dat = SQLiteHelpers.ExecuteDataSet("select * from WorkorderSteps order by Step asc", null).Tables[0];
}
SQLiteHelpers.Close(); //关闭连接
@ -53,6 +54,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
if (!string.IsNullOrEmpty(workOrder))
{
//WorkOrder.Select().First().Field<object>("WorkOrder").ToString();
WorkOrder_n=workOrder;
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();
@ -102,7 +104,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
comboBoxDyelot.IsEnabled = false;
}
private void Button_Click(object sender, RoutedEventArgs e)
private void Button_Click(object sender, RoutedEventArgs e)//保存按钮
{
if (string.IsNullOrEmpty(comboBoxMachine.Text))
{
@ -123,6 +125,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
string sTime;
string StartTime_;
string WorkOrder_ = comboBoxMachine.Text + "_" + DateTime.Now.ToString("yyMMddHHmmss");
if (!string.IsNullOrEmpty(WorkOrder_n)) WorkOrder_ = WorkOrder_n;
string ProgramName_ = comboBoxProgram.Text;
string ProgramID_ =null;
for (int j = 0; j < pArray.Length; j++)
@ -215,6 +218,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
string sTime;
string StartTime_;
string WorkOrder_ = sArray[i] + "_" + DateTime.Now.ToString("yyMMddHHmmss")+i;
if (!string.IsNullOrEmpty(WorkOrder_n)) WorkOrder_ = WorkOrder_n;
string ProgramName_ = comboBoxProgram.Text;
string ProgramID_ = null;
for (int j = 0; j < pArray.Length; j++)
@ -355,16 +359,20 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
{
dat.Rows.Add(drT.ItemArray);
}
//dat = temp.Copy();
}
}//以工艺名组合工艺细节
if (!string.IsNullOrEmpty(WorkOrder_n))
{
dat = SQLiteHelpers.ExecuteDataSet(
"select * from WorkorderSteps where WorkOrder='" + WorkOrder_n + "' order by Step asc", null).Tables[0]; //读取计划表写入缓存
}//插入工单不为空时载入细节信息
SQLiteHelpers.Close(); //关闭连接
DatSteps(dat);
Grid_data.ItemsSource = dat.DefaultView;
Grid_data.ItemsSource = dat.DefaultView;//显示
}
catch (Exception) { }
}
}
}//工艺修改事件
private void color_color_MouseDoubleClick(object sender, MouseButtonEventArgs e)//颜色
{

44
View/ProductionPlanningView.xaml.cs

@ -72,8 +72,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
maxDate = minDate.AddDays(1);
//添加表右键功能
ganttTaskContextMenuItems.Add(new ContextMenuItem(ViewClicked, Properties.Resources.View + "..."));
ganttTaskContextMenuItems.Add(new ContextMenuItem(ViewClicked, Properties.Resources.Advance + "..."));
ganttTaskContextMenuItems.Add(new ContextMenuItem(ViewClicked, Properties.Resources.Delayed + "..."));
ganttTaskContextMenuItems.Add(new ContextMenuItem(AdvanceClicked, Properties.Resources.Advance + "..."));
ganttTaskContextMenuItems.Add(new ContextMenuItem(DelayedClicked, Properties.Resources.Delayed + "..."));
ganttTaskContextMenuItems.Add(new ContextMenuItem(EditClicked, Properties.Resources.edit + "..."));
ganttTaskContextMenuItems.Add(new ContextMenuItem(DeleteClicked, Properties.Resources.Delete + "..."));
GanttChart.GanttTaskContextMenuItems = ganttTaskContextMenuItems;
@ -138,6 +138,14 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
Picture.Content = null;
Picture.Width = 600;
Picture.Content = new ProductionPlanningEdit(ganttTask.ID,false);
}
private void AdvanceClicked(GanttTask ganttTask)
{
}
private void DelayedClicked(GanttTask ganttTask)
{
}
private void EditClicked(GanttTask ganttTask)
{
@ -193,27 +201,43 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
}
private void WorkOrderNumder_Click(object sender, RoutedEventArgs e)
{
Picture.Width = 0;
// Select_WorkOrderNumder.Text;
}
Picture.Content = null;
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
int con = SQLiteHelpers.ExecuteDataSet(
"select * from WorkOrder where WorkOrder='" + Select_WorkOrderNumder.Text +
"'Order by StartTime", null).Tables[0].Rows.Count;
SQLiteHelpers.Close();
if (con > 0)
{
Picture.Content = null;
Picture.Width = 600;
Picture.Content = new ProductionPlanningEdit(Select_WorkOrderNumder.Text, true);
}
else
{
MessageBox.Show(Properties.Resources.WorkOrderNumder+ Select_WorkOrderNumder.Text + Properties.Resources.DoesNotExist);
}
}//搜索并打开
private void ListViewItem_Before(object sender, MouseButtonEventArgs e)//前一天
{
Picture.Width = 0;
Picture.Content = null;
Sdatepicker.Text = DateTime.Parse(Sdatepicker.Text).AddDays(-1).ToString("yyyy/MM/dd HH:mm:ss");
}
private void ListViewItem_Today(object sender, MouseButtonEventArgs e)//今天
{
Picture.Width = 0;
Sdatepicker.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
Picture.Content = null;
Sdatepicker.Text = DateTime.Now.ToString("yyyy/MM/dd");
}
private void ListViewItem_DayAfter(object sender, MouseButtonEventArgs e)//后一天
{
Picture.Width = 0;
Picture.Content = null;
Sdatepicker.Text = DateTime.Parse(Sdatepicker.Text).AddDays(1).ToString("yyyy/MM/dd HH:mm:ss");
}
private void Sdatepicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)//时间控件
{
Picture.Width = 0;
Picture.Content = null;
minDate = DateTime.Parse(sender.ToString());
maxDate = DateTime.Parse(sender.ToString()).AddDays(1);
GanttChartNEW();

2
ViewModel/MainWindowViewModel.cs

@ -139,7 +139,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
});
WorkOrderSQL.Update("WorkOrder", new Dictionary<string, object> { { "State", 112 } },
"WorkOrder ='" + WorkOrderstepdata.Select()[k].Field<object>("WorkOrder").ToString() + "'", null);
}
//下传工单总览
DataTable WorkOrderdata = WorkOrderSQL.ExecuteDataSet("select * from WorkOrder where State='100'", null).Tables[0]; //读取表写入缓存
@ -169,7 +168,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
}
}
WorkOrderSQL.Close();
}
void DisTimer_50MS(object sender, EventArgs e)//Tick_Event周期执行事件50MS
{

20
WindowsView/SchedulingTime.xaml

@ -0,0 +1,20 @@
<Window x:Class="SunlightCentralizedControlManagement_SCCM_.WindowsView.SchedulingTime"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SunlightCentralizedControlManagement_SCCM_.WindowsView"
xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
Title="SchedulingTime" Height="450" Width="800">
<Grid>
<Button Content="{x:Static lang:Resources.YES}" HorizontalAlignment="Right" Height="35" Margin="0,0,50,10"
VerticalAlignment="Bottom" Width="80" Click="Button_Click"/>
<Button Content="{x:Static lang:Resources.Quit}" HorizontalAlignment="Right" Height="35" Margin="0,0,150,10"
VerticalAlignment="Bottom" Width="80" Click="Button_Quit"/>
</Grid>
</Window>

36
WindowsView/SchedulingTime.xaml.cs

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
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.Shapes;
namespace SunlightCentralizedControlManagement_SCCM_.WindowsView
{
/// <summary>
/// SchedulingTime.xaml 的交互逻辑
/// </summary>
public partial class SchedulingTime : Window
{
public SchedulingTime()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
}
private void Button_Quit(object sender, RoutedEventArgs e)
{
}
}
}
Loading…
Cancel
Save