Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer
This commit is contained in:
commit
94e359988a
5 files changed
+64
-18
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace formula_manage.UserClass
|
namespace DyeingComputer.UserClass
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 字符串转数字
|
/// 字符串转数字
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
d:DesignHeight="630" d:DesignWidth="1280" HorizontalAlignment="Left">
|
d:DesignHeight="630" d:DesignWidth="1280" HorizontalAlignment="Left">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Rectangle Margin="0,0,0,0" Fill="#FFCCCCCC" VerticalAlignment="Top" Height="40"/>
|
<Rectangle Margin="0,0,0,0" Fill="#FFCCCCCC" VerticalAlignment="Top" Height="40"/>
|
||||||
<Button Content="{x:Static lang:Resources.edit}" x:Name="ProgramgroupView_lock" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="200,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="ProgramgroupView_lock_Click"/>
|
<Button Content="{x:Static lang:Resources.edit}" x:Name="ProgramgroupView_edit" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="200,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="ProgramgroupView_edit_Click"/>
|
||||||
<Button Content="{x:Static lang:Resources.New}" x:Name="ProgramgroupView_new" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="0,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="ProgramgroupView_new_Click"/>
|
<Button Content="{x:Static lang:Resources.New}" x:Name="ProgramgroupView_new" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="0,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="ProgramgroupView_new_Click"/>
|
||||||
<Button Content="{x:Static lang:Resources.Delete}" x:Name="ProgramgroupView_del" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="800,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="ProgramgroupView_del_Click"/>
|
<Button Content="{x:Static lang:Resources.Delete}" x:Name="ProgramgroupView_del" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="800,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="ProgramgroupView_del_Click"/>
|
||||||
<Button Content="{x:Static lang:Resources.Rename}" x:Name="ProgramgroupView_Rename" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="400,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="ProgramgroupView_Rename_Click"/>
|
<Button Content="{x:Static lang:Resources.Rename}" x:Name="ProgramgroupView_Rename" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="400,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="ProgramgroupView_Rename_Click"/>
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using DyeingComputer.Windows;
|
using DyeingComputer.UserClass;
|
||||||
|
using DyeingComputer.Windows;
|
||||||
|
using formula_manage.UserClass;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
@@ -12,6 +14,7 @@ using System.Windows.Data;
|
|||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Animation;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
@@ -47,16 +50,13 @@ namespace DyeingComputer.View
|
|||||||
|
|
||||||
SQLiteHelpers.Close(); //关闭连接
|
SQLiteHelpers.Close(); //关闭连接
|
||||||
|
|
||||||
|
Programgroup_Numder = null;
|
||||||
|
Programgroup_ID = null;
|
||||||
//sql.Clear(); //清除缓存
|
//sql.Clear(); //清除缓存
|
||||||
//System.GC.Collect();
|
//System.GC.Collect();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
private void ProgramgroupView_edit_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ProgramgroupView_lock_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -64,20 +64,23 @@ namespace DyeingComputer.View
|
|||||||
private void ProgramgroupView_new_Click(object sender, RoutedEventArgs e)//新建按钮
|
private void ProgramgroupView_new_Click(object sender, RoutedEventArgs e)//新建按钮
|
||||||
{
|
{
|
||||||
InputBox frm = new InputBox();
|
InputBox frm = new InputBox();
|
||||||
frm.Accept += new EventHandler(InputBox_accept);
|
frm.Accept += new EventHandler(InputBox_new_accept);
|
||||||
frm.ShowDialog();
|
frm.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputBox_accept(object sender, EventArgs e)//新建按钮窗口返回
|
void InputBox_new_accept(object sender, EventArgs e)//新建按钮窗口返回
|
||||||
{
|
{
|
||||||
//事件的接收者通过一个简单的类型转换得到InputBox的引用
|
//事件的接收者通过一个简单的类型转换得到InputBox的引用
|
||||||
InputBox frm = (InputBox)sender;
|
InputBox frm = (InputBox)sender;
|
||||||
//接收到InputBox的TextBox值
|
//接收到InputBox的TextBox值
|
||||||
string VALUE = frm.InputValue;
|
string VALUE = frm.InputValue;
|
||||||
|
|
||||||
|
string ID = (StrToInt.To16Convert10( DateTime.Now.ToString("yy"))+ StrToInt.To16Convert10(DateTime.Now.ToString("MM"))+StrToInt.To16Convert10(DateTime.Now.ToString("dd"))).ToString()+
|
||||||
|
DateTime.Now.ToString("HH")+DateTime.Now.ToString("mm")+DateTime.Now.ToString("ss"); //id为时间合
|
||||||
|
|
||||||
Dictionary<string, object> Program_new = new Dictionary<string, object>();//缓存函数
|
Dictionary<string, object> Program_new = new Dictionary<string, object>();//缓存函数
|
||||||
Program_new.Add("ProgramName", VALUE);
|
Program_new.Add("ProgramName", VALUE);
|
||||||
Program_new.Add("ProgramID", DateTime.Now.ToString("yyMMddHHmmss"));
|
Program_new.Add("ProgramID", ID);
|
||||||
Program_new.Add("Step", "0");
|
Program_new.Add("Step", "0");
|
||||||
Program_new.Add("Time", "0:00");
|
Program_new.Add("Time", "0:00");
|
||||||
Program_new.Add("Notes", null);
|
Program_new.Add("Notes", null);
|
||||||
@@ -90,19 +93,60 @@ namespace DyeingComputer.View
|
|||||||
Programgroup_sql();
|
Programgroup_sql();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ProgramgroupView_del_Click(object sender, RoutedEventArgs e)
|
private void ProgramgroupView_del_Click(object sender, RoutedEventArgs e)//删除
|
||||||
{
|
{
|
||||||
|
///弹窗提示确认删除
|
||||||
|
if (System.Windows.Forms.MessageBox.Show(Properties.Resources.Confirm + Properties.Resources.Delete + Programgroup_Numder, "Delete ",
|
||||||
|
System.Windows.Forms.MessageBoxButtons.OKCancel, System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK)
|
||||||
|
{
|
||||||
|
///执行删除
|
||||||
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
|
SQLiteHelpers.Delete("ProgramName", "ProgramID='" + Programgroup_ID + "'", null);
|
||||||
|
SQLiteHelpers.Close();
|
||||||
|
Programgroup_sql();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ProgramgroupView_Rename_Click(object sender, RoutedEventArgs e)
|
private void ProgramgroupView_Rename_Click(object sender, RoutedEventArgs e)//重命名按钮
|
||||||
{
|
{
|
||||||
|
InputBox frm = new InputBox();
|
||||||
|
frm.Accept += new EventHandler(InputBox_Rename_accept);
|
||||||
|
frm.ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
void InputBox_Rename_accept(object sender, EventArgs e)//重命名按钮窗口返回
|
||||||
|
{
|
||||||
|
//事件的接收者通过一个简单的类型转换得到InputBox的引用
|
||||||
|
InputBox frm = (InputBox)sender;
|
||||||
|
//接收到InputBox的TextBox值
|
||||||
|
string VALUE = frm.InputValue;
|
||||||
|
Dictionary<string, object> Program_Rename = new Dictionary<string, object>();//缓存函数
|
||||||
|
Program_Rename.Add("ProgramName", VALUE);
|
||||||
|
|
||||||
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
|
SQLiteHelpers.Update("ProgramName", Program_Rename, "ProgramID='"+ Programgroup_ID + "'",null);
|
||||||
|
SQLiteHelpers.Close(); //关闭连接
|
||||||
|
|
||||||
|
Programgroup_sql();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ProgramgroupView_Remark_Click(object sender, RoutedEventArgs e)
|
private void ProgramgroupView_Remark_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string Programgroup_Numder;
|
||||||
|
string Programgroup_ID;
|
||||||
|
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)//表格选择事件
|
||||||
|
{
|
||||||
|
int rownum = Grid.SelectedIndex;//获取鼠标选中行并定义变量
|
||||||
|
if (rownum != -1)//判断鼠标定位是否有效
|
||||||
|
{
|
||||||
|
Programgroup_ID = (Grid.Columns[0].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第0列,
|
||||||
|
Programgroup_Numder = (Grid.Columns[1].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第1列,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,9 +23,7 @@
|
|||||||
<Button Content="{x:Static lang:Resources.Delete}" x:Name="WorkOrderView_del" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="400,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="WorkOrderView_del_Click"/>
|
<Button Content="{x:Static lang:Resources.Delete}" x:Name="WorkOrderView_del" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="400,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="WorkOrderView_del_Click"/>
|
||||||
<Button Content="{x:Static lang:Resources.Redye}" x:Name="WorkOrderView_redy" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="600,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="WorkOrderView_redy_Click"/>
|
<Button Content="{x:Static lang:Resources.Redye}" x:Name="WorkOrderView_redy" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="600,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="WorkOrderView_redy_Click"/>
|
||||||
|
|
||||||
<DataGrid x:Name="Grid" AlternationCount="2" IsReadOnly="True"
|
<DataGrid x:Name="Grid" AlternationCount="2" IsReadOnly="True" SelectionChanged="Grid_SelectionChanged"
|
||||||
|
|
||||||
SelectionChanged="Grid_SelectionChanged"
|
|
||||||
Margin="0,340,0,0" d:ItemsSource="{d:SampleData ItemCount=20}" AutoGenerateColumns="False" MinColumnWidth="30"
|
Margin="0,340,0,0" d:ItemsSource="{d:SampleData ItemCount=20}" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
|
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
|
||||||
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" AllowDrop="False"
|
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" AllowDrop="False"
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ namespace DyeingComputer.View
|
|||||||
|
|
||||||
SQLiteHelpers.Close(); //关闭连接
|
SQLiteHelpers.Close(); //关闭连接
|
||||||
|
|
||||||
|
WorkOrder_Numder = null;
|
||||||
|
Process_Name = null;
|
||||||
|
Process_id = null;
|
||||||
|
_lock = null;
|
||||||
//sql.Clear(); //清除缓存
|
//sql.Clear(); //清除缓存
|
||||||
//System.GC.Collect();
|
//System.GC.Collect();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user