Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer
This commit is contained in:
commit
f693681841
2 files changed
+43
-7
No files matched your search
@@ -60,7 +60,7 @@
|
|||||||
<!--列信息绑定-->
|
<!--列信息绑定-->
|
||||||
<DataGridTextColumn Binding="{Binding ProgramID}" Width="0" MinWidth="0" MaxWidth="0"/>
|
<DataGridTextColumn Binding="{Binding ProgramID}" Width="0" MinWidth="0" MaxWidth="0"/>
|
||||||
<DataGridTextColumn Binding="{Binding Program}" Width="0" MinWidth="0" MaxWidth="0"/>
|
<DataGridTextColumn Binding="{Binding Program}" Width="0" MinWidth="0" MaxWidth="0"/>
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.Step}" Binding="{Binding RelativeSource={RelativeSource AncestorType=DataGridRow}, Converter={StaticResource RowToIndexConverter}}" Width="60" IsReadOnly="True"/>
|
<DataGridTextColumn Header="{x:Static lang:Resources.Step}" Binding="{Binding Step}" Width="60" IsReadOnly="True"/>
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.Code}" Width="100" Binding="{Binding StepID}" IsReadOnly="True"/>
|
<DataGridTextColumn Header="{x:Static lang:Resources.Code}" Width="100" Binding="{Binding StepID}" IsReadOnly="True"/>
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.Directives}" Width="300" Binding="{Binding StepName}" IsReadOnly="True"/>
|
<DataGridTextColumn Header="{x:Static lang:Resources.Directives}" Width="300" Binding="{Binding StepName}" IsReadOnly="True"/>
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.ParameterSet}" Width="*" Binding="{Binding ParameterName}" IsReadOnly="True"/>
|
<DataGridTextColumn Header="{x:Static lang:Resources.ParameterSet}" Width="*" Binding="{Binding ParameterName}" IsReadOnly="True"/>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using formula_manage.UserClass;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
using System.Diagnostics.Eventing.Reader;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -54,13 +55,12 @@ namespace DyeingComputer.View
|
|||||||
|
|
||||||
if (sql != null) sql.Clear(); //清空缓存
|
if (sql != null) sql.Clear(); //清空缓存
|
||||||
sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取计划表写入缓存
|
sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取计划表写入缓存
|
||||||
|
|
||||||
//sql.Tables[0].Rows.Add(datatable_t);
|
//sql.Tables[0].Rows.Add(datatable_t);
|
||||||
DataRow dr = sql.Tables[0].NewRow();//添加表数据
|
DataRow dr = sql.Tables[0].NewRow();//添加表数据
|
||||||
dr["ProgramID"] = ProgramID;
|
dr["ProgramID"] = ProgramID;
|
||||||
dr["Program"] = ProgramNAME;
|
dr["Program"] = ProgramNAME;
|
||||||
sql.Tables[0].Rows.Add(dr);
|
sql.Tables[0].Rows.Add(dr);
|
||||||
|
Dat();
|
||||||
if (sql != null) Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
|
if (sql != null) Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
|
||||||
SQLiteHelpers.Close(); //关闭连接
|
SQLiteHelpers.Close(); //关闭连接
|
||||||
|
|
||||||
@@ -68,6 +68,18 @@ namespace DyeingComputer.View
|
|||||||
//System.GC.Collect();
|
//System.GC.Collect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dat()//行号刷新
|
||||||
|
{
|
||||||
|
int a = sql.Tables[0].Rows.Count;
|
||||||
|
for(int i = 0; i <a; i++)
|
||||||
|
{
|
||||||
|
DataRow dr = sql.Tables[0].Rows[i];
|
||||||
|
dr.BeginEdit();
|
||||||
|
dr["Step"] = i+1;
|
||||||
|
dr.EndEdit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
string Numder = null;
|
string Numder = null;
|
||||||
string ID = null;
|
string ID = null;
|
||||||
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)//表格选择事件
|
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)//表格选择事件
|
||||||
@@ -75,8 +87,8 @@ namespace DyeingComputer.View
|
|||||||
int rownum = Grid.SelectedIndex;//获取鼠标选中行并定义变量
|
int rownum = Grid.SelectedIndex;//获取鼠标选中行并定义变量
|
||||||
if (rownum != -1)//判断鼠标定位是否有效
|
if (rownum != -1)//判断鼠标定位是否有效
|
||||||
{
|
{
|
||||||
ID = (Grid.Columns[0].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第0列,
|
ID = (Grid.Columns[2].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第0列,
|
||||||
Numder = (Grid.Columns[1].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第1列,
|
Numder = (Grid.Columns[3].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第1列,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,17 +100,41 @@ namespace DyeingComputer.View
|
|||||||
{
|
{
|
||||||
this.Visibility = Visibility.Collapsed;//隐藏控件
|
this.Visibility = Visibility.Collapsed;//隐藏控件
|
||||||
}
|
}
|
||||||
private void ProgramgroupView_del_Click(object sender, RoutedEventArgs e)//
|
private void ProgramgroupView_del_Click(object sender, RoutedEventArgs e)//删除行
|
||||||
{
|
{
|
||||||
|
int d = 0;
|
||||||
|
int a = sql.Tables[0].Rows.Count;
|
||||||
|
|
||||||
|
if (ID != null) { d = StrToInt.To16Convert10(ID); } else { return; }
|
||||||
|
if (a != d)//如果删除不是最后一行执行
|
||||||
|
{
|
||||||
|
sql.Tables[0].Rows.RemoveAt(d - 1);
|
||||||
|
|
||||||
|
Dat();
|
||||||
|
Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
|
||||||
}
|
}
|
||||||
private void ProgramgroupView_Insert_Click(object sender, RoutedEventArgs e)//
|
}
|
||||||
|
private void ProgramgroupView_Insert_Click(object sender, RoutedEventArgs e)//插入行
|
||||||
{
|
{
|
||||||
|
int d=0;
|
||||||
|
if (ID != null) { d = StrToInt.To16Convert10(ID); } else { return; }
|
||||||
|
DataRow dr = sql.Tables[0].NewRow();//添加表数据
|
||||||
|
dr["ProgramID"] = ProgramID;
|
||||||
|
dr["Program"] = ProgramNAME;
|
||||||
|
sql.Tables[0].Rows.InsertAt(dr,d-1);
|
||||||
|
ID = null;
|
||||||
|
|
||||||
|
Dat();
|
||||||
|
Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
|
||||||
}
|
}
|
||||||
private void ProgramgroupView_Save_Click(object sender, RoutedEventArgs e)//
|
private void ProgramgroupView_Save_Click(object sender, RoutedEventArgs e)//
|
||||||
{
|
{
|
||||||
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
|
|
||||||
|
SQLiteHelpers.Delete("ProgramSteps", "ProgramID = '"+ ProgramID + "'", null);
|
||||||
|
|
||||||
|
|
||||||
|
SQLiteHelpers.Close(); //关闭连接
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user