|
|
@ -256,10 +256,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View |
|
|
|
viewstop.data = ID; |
|
|
|
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(edit_ButtonClicked); |
|
|
|
viewstop.ShowDialog(); |
|
|
|
}//编辑
|
|
|
|
string Numder = null; |
|
|
|
string ID = null; |
|
|
|
string P1 = "0", P2 = "0", P3 = "0", P4 = "0", P5 = "0"; |
|
|
|
}//编辑
|
|
|
|
private void edit_ButtonClicked(object sender, AddressUpdateEventArgs e)//编辑返回结果
|
|
|
|
{ |
|
|
|
|
|
|
@ -360,6 +357,66 @@ namespace SunlightCentralizedControlManagement_SCCM_.View |
|
|
|
MainWindowViewModel.TechnologicalProcess_bool = true; |
|
|
|
} |
|
|
|
}//删除
|
|
|
|
string Numder = null; |
|
|
|
string ID = null; |
|
|
|
string P1, P2, P3, P4, P5; |
|
|
|
|
|
|
|
private void MenuItem_edit(object sender, RoutedEventArgs e)//右键编辑
|
|
|
|
{ |
|
|
|
int rownum = Gridstep.SelectedIndex;//获取鼠标选中行并定义变量
|
|
|
|
if (rownum != -1)//判断鼠标定位是否有效
|
|
|
|
{ |
|
|
|
ID = (Gridstep.Columns[2].GetCellContent(Gridstep.Items[rownum]) as TextBlock).Text;//定位第0列,
|
|
|
|
Numder = (Gridstep.Columns[3].GetCellContent(Gridstep.Items[rownum]) as TextBlock).Text;//定位第1列,
|
|
|
|
P1 = (Gridstep.Columns[6].GetCellContent(Gridstep.Items[rownum]) as TextBlock).Text;//定位第6列,
|
|
|
|
P2 = (Gridstep.Columns[7].GetCellContent(Gridstep.Items[rownum]) as TextBlock).Text;//定位第7列,
|
|
|
|
P3 = (Gridstep.Columns[8].GetCellContent(Gridstep.Items[rownum]) as TextBlock).Text;//定位第8列,
|
|
|
|
P4 = (Gridstep.Columns[9].GetCellContent(Gridstep.Items[rownum]) as TextBlock).Text;//定位第9列,
|
|
|
|
P5 = (Gridstep.Columns[10].GetCellContent(Gridstep.Items[rownum]) as TextBlock).Text;//定位第10列,
|
|
|
|
if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; } |
|
|
|
ViewStep viewstop = new ViewStep(Numder, P1, P2, P3, P4, P5); |
|
|
|
viewstop.data = ID; |
|
|
|
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(edit_ButtonClicked); |
|
|
|
viewstop.ShowDialog(); |
|
|
|
} |
|
|
|
} |
|
|
|
private void MenuItem_Insert(object sender, RoutedEventArgs e)//右键插入
|
|
|
|
{ |
|
|
|
int rownum = Gridstep.SelectedIndex;//获取鼠标选中行并定义变量
|
|
|
|
if (rownum != -1)//判断鼠标定位是否有效
|
|
|
|
{ |
|
|
|
ID = (Gridstep.Columns[2].GetCellContent(Gridstep.Items[rownum]) as TextBlock).Text;//定位列,
|
|
|
|
|
|
|
|
ViewStep viewstop = new ViewStep(null, "0", "0", "0", "0", "0"); |
|
|
|
viewstop.data = ID; |
|
|
|
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Insert_ButtonClicked); |
|
|
|
viewstop.ShowDialog(); |
|
|
|
} |
|
|
|
} |
|
|
|
private void MenuItem_Delete(object sender, RoutedEventArgs e)//右键删除
|
|
|
|
{ |
|
|
|
int rownum = Gridstep.SelectedIndex;//获取鼠标选中行并定义变量
|
|
|
|
if (rownum != -1)//判断鼠标定位是否有效
|
|
|
|
{ |
|
|
|
ID = (Gridstep.Columns[2].GetCellContent(Gridstep.Items[rownum]) as TextBlock).Text;//定位第0列,
|
|
|
|
if (!string.IsNullOrEmpty(machine)) |
|
|
|
{ |
|
|
|
Dictionary<string, object> dat_821 = new Dictionary<string, object>(); |
|
|
|
dat_821.Clear(); |
|
|
|
dat_821.Add("INSTRUCTION", "DELETE"); |
|
|
|
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", "ID='" + index + "'") + dat_821.ToJsonString() |
|
|
|
}); |
|
|
|
|
|
|
|
MainWindowViewModel.TechnologicalProcess_bool = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void CountDown() |
|
|
|
{ |
|
|
|