diff --git a/ConvertMoels/RowToIndexConverter.cs b/ConvertMoels/RowToIndexConverter.cs new file mode 100644 index 0000000..4522d8f --- /dev/null +++ b/ConvertMoels/RowToIndexConverter.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; +using System.Windows.Data; + +namespace DyeingComputer.ConvertMoels +{ + /// + /// 序号转换器 + /// 获取DataGrid的行号 , 转换为对应的序号 + /// + internal class RowToIndexConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + DataGridRow row = value as DataGridRow; + if (row != null) + return row.GetIndex() + 1; + else + return -1; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/DyeingComputer.csproj b/DyeingComputer.csproj index c5ea206..40233cc 100644 --- a/DyeingComputer.csproj +++ b/DyeingComputer.csproj @@ -64,6 +64,7 @@ + True diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index f342bc2..61b9b94 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -213,6 +213,15 @@ namespace DyeingComputer.Properties { } } + /// + /// 查找类似 Insert 的本地化字符串。 + /// + public static string Insert { + get { + return ResourceManager.GetString("Insert", resourceCulture); + } + } + /// /// 查找类似 LineUp 的本地化字符串。 /// @@ -303,6 +312,15 @@ namespace DyeingComputer.Properties { } } + /// + /// 查找类似 Recover 的本地化字符串。 + /// + public static string Recover { + get { + return ResourceManager.GetString("Recover", resourceCulture); + } + } + /// /// 查找类似 Redye 的本地化字符串。 /// @@ -330,6 +348,15 @@ namespace DyeingComputer.Properties { } } + /// + /// 查找类似 Save 的本地化字符串。 + /// + public static string Save { + get { + return ResourceManager.GetString("Save", resourceCulture); + } + } + /// /// 查找类似 StartTime 的本地化字符串。 /// diff --git a/Properties/Resources.en-US.resx b/Properties/Resources.en-US.resx index 7dcd64f..5534ca0 100644 --- a/Properties/Resources.en-US.resx +++ b/Properties/Resources.en-US.resx @@ -237,4 +237,13 @@ Code + + Recover + + + Insert + + + Save + \ No newline at end of file diff --git a/Properties/Resources.resx b/Properties/Resources.resx index 323762b..dd45444 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -237,4 +237,13 @@ ID + + Insert + + + Recover + + + Save + \ No newline at end of file diff --git a/Properties/Resources.zh-CN.resx b/Properties/Resources.zh-CN.resx index 0b483ca..de6bd3a 100644 --- a/Properties/Resources.zh-CN.resx +++ b/Properties/Resources.zh-CN.resx @@ -237,4 +237,13 @@ 代码 + + 恢复 + + + 插入 + + + 保存 + \ No newline at end of file diff --git a/Properties/Resources.zh-TW.resx b/Properties/Resources.zh-TW.resx index a386d1a..e4ef165 100644 --- a/Properties/Resources.zh-TW.resx +++ b/Properties/Resources.zh-TW.resx @@ -237,4 +237,13 @@ 代碼 + + 恢復 + + + 插入 + + + 儲存 + \ No newline at end of file diff --git a/View/ProgramgroupView.xaml b/View/ProgramgroupView.xaml index daaa384..002349d 100644 --- a/View/ProgramgroupView.xaml +++ b/View/ProgramgroupView.xaml @@ -50,8 +50,6 @@ - - diff --git a/View/ProgramgroupView.xaml.cs b/View/ProgramgroupView.xaml.cs index 14cf731..26be57b 100644 --- a/View/ProgramgroupView.xaml.cs +++ b/View/ProgramgroupView.xaml.cs @@ -59,7 +59,6 @@ namespace DyeingComputer.View if (Programgroup_ID == null) return; container.Content = new ProgramstepsView(); - } private void ProgramgroupView_new_Click(object sender, RoutedEventArgs e)//新建按钮 @@ -167,8 +166,9 @@ namespace DyeingComputer.View Programgroup_ID = null; } - string Programgroup_Numder = null; - string Programgroup_ID = null; + public static string Programgroup_Numder { get; set; } + public static string Programgroup_ID { get; set; } + private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)//表格选择事件 { int rownum = Grid.SelectedIndex;//获取鼠标选中行并定义变量 diff --git a/View/ProgramstepsView .xaml b/View/ProgramstepsView .xaml index ca7613a..af70d1d 100644 --- a/View/ProgramstepsView .xaml +++ b/View/ProgramstepsView .xaml @@ -5,16 +5,21 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:DyeingComputer.View" xmlns:lang="clr-namespace:DyeingComputer.Properties" + xmlns:ConvertMoels="clr-namespace:DyeingComputer.ConvertMoels" mc:Ignorable="d" d:DesignHeight="630" d:DesignWidth="1280" HorizontalAlignment="Left"> + + + -