工艺编辑检查

This commit is contained in:
sc committed 2025-01-12 01:09:54 +08:00
commit 8210f4aeda
5 files changed
+60 -6

No files matched your search

+18
View File
@@ -654,6 +654,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
/// <summary>
/// 查找类似 Editing historical crafts is prohibited 的本地化字符串。
/// </summary>
public static string EHCIP {
get {
return ResourceManager.GetString("EHCIP", resourceCulture);
}
}
/// <summary>
/// 查找类似 End of program 的本地化字符串。
/// </summary>
@@ -717,6 +726,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
/// <summary>
/// 查找类似 Editing non-pending work order is prohibited 的本地化字符串。
/// </summary>
public static string ENWOIP {
get {
return ResourceManager.GetString("ENWOIP", resourceCulture);
}
}
/// <summary>
/// 查找类似 Simulation 的本地化字符串。
/// </summary>
+6
View File
@@ -942,4 +942,10 @@
<data name="DoesNotExist" xml:space="preserve">
<value>Does Not Exist</value>
</data>
<data name="EHCIP" xml:space="preserve">
<value>Editing historical crafts is prohibited</value>
</data>
<data name="ENWOIP" xml:space="preserve">
<value>Editing non-pending work order is prohibited</value>
</data>
</root>
+6
View File
@@ -942,4 +942,10 @@
<data name="DoesNotExist" xml:space="preserve">
<value>Does Not Exist</value>
</data>
<data name="EHCIP" xml:space="preserve">
<value>Editing historical crafts is prohibited</value>
</data>
<data name="ENWOIP" xml:space="preserve">
<value>Editing non-pending work order is prohibited</value>
</data>
</root>
+6
View File
@@ -942,4 +942,10 @@
<data name="DoesNotExist" xml:space="preserve">
<value>不存在</value>
</data>
<data name="EHCIP" xml:space="preserve">
<value>禁止编辑历史工艺</value>
</data>
<data name="ENWOIP" xml:space="preserve">
<value>禁止编辑非等待中的工单</value>
</data>
</root>
+24 -6
View File
@@ -84,8 +84,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
private ObservableCollection<ContextMenuItem> ganttTaskContextMenuItems = new ObservableCollection<ContextMenuItem>();
public void GanttChartNEW()
{
string iiii = "select * from WorkOrder where StartTime>'" + DateTime.Parse(Sdatepicker.Text).ToString("yyyy/MM/dd HH:mm:ss")
+ "'or EndTime>'" + DateTime.Parse(Sdatepicker.Text).ToString("yyyy/MM/dd HH:mm:ss") + "'Order by StartTime";
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
WorkOrder = SQLiteHelpers.ExecuteDataSet(
@@ -149,10 +147,30 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
}
private void EditClicked(GanttTask ganttTask)
{
Picture.Content = null;
Picture.Width = 600;
Picture.Content = new ProductionPlanningEdit(ganttTask.ID, true);
}
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
DataTable WorkOrder_dt = SQLiteHelpers.ExecuteDataSet(
"select * from WorkOrder where WorkOrder='" + ganttTask.ID + "'Order by StartTime", null).Tables[0]; //读取表写入缓存
SQLiteHelpers.Close();
if (DateTime.Now > DateTime.Parse(WorkOrder_dt.Select().First().Field<object>("EndTime").ToString()))
{
MessageBox.Show(Properties.Resources.EHCIP);//禁止编辑历史工艺
}
else
{
if (WorkOrder_dt.Select().First().Field<object>("State").ToString() == "101")
{
Picture.Content = null;
Picture.Width = 600;
Picture.Content = new ProductionPlanningEdit(ganttTask.ID, true);
}
else
{
MessageBox.Show(Properties.Resources.ENWOIP);//禁止编辑非等待中的工单
}
}
}//编辑
private void DeleteClicked(GanttTask ganttTask)//删除
{
if (System.Windows.Forms.MessageBox.Show(Properties.Resources.Confirm + Properties.Resources.Delete + ganttTask.Name, "Delete ",