日程时间调整页面,添加翻译,搜素逻辑
This commit is contained in:
commit
e91b536ba4
11 files changed
+135
-18
No files matched your search
@@ -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)//颜色
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user