Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightCentralizedControlManagement
This commit is contained in:
commit
115449a736
3 files changed
+68
-4
No files matched your search
@@ -343,7 +343,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
Grid_data.ItemsSource = dat.DefaultView;
|
||||
|
||||
if (ID == null) ID = dat.Rows.Count.ToString();
|
||||
ViewStep viewstop = new ViewStep(null, null, null, null, null, null);
|
||||
ViewStep viewstop = new ViewStep(null, "0", "0", "0", "0", "0");
|
||||
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked);
|
||||
viewstop.data = ID;
|
||||
viewstop.ShowDialog();
|
||||
|
||||
@@ -131,6 +131,13 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.CellStyle>
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="{x:Static lang:Resources.edit}" Click="MenuItem_edit"/>
|
||||
<MenuItem Header="{x:Static lang:Resources.Insert}" Click="MenuItem_Insert"/>
|
||||
<MenuItem Header="{x:Static lang:Resources.Delete}" Click="MenuItem_Delete"/>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.Columns>
|
||||
<!--列信息绑定-->
|
||||
<DataGridTextColumn Binding="{Binding ProgramID}" Width="0" MinWidth="0" MaxWidth="0"/>
|
||||
|
||||
@@ -257,9 +257,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
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()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user