Browse Source

步骤表问题修改

master
sc 2 months ago
parent
commit
d21d54da88
  1. 10
      View/TechnologicalProcessView.xaml
  2. 1
      ViewModel/MainWindowViewModel.cs
  3. 2
      Windows/ViewStep.xaml
  4. 66
      Windows/ViewStep.xaml.cs

10
View/TechnologicalProcessView.xaml

@ -133,6 +133,16 @@
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>
<DataGridTextColumn Header="{x:Static lang:Resources.Remark}" Binding="{Binding Remark}" Width="*" IsReadOnly="True">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="TextTrimming" Value="CharacterEllipsis"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
<Grid Width="600" Margin="0,40,0,0" HorizontalAlignment="Left" > <Grid Width="600" Margin="0,40,0,0" HorizontalAlignment="Left" >

1
ViewModel/MainWindowViewModel.cs

@ -2686,6 +2686,7 @@ namespace DyeingComputer.ViewModel
public string Parameter9 { get; set; } public string Parameter9 { get; set; }
public string Parameter10 { get; set; } public string Parameter10 { get; set; }
public string DYELOT { get; set; } public string DYELOT { get; set; }
public string Remark { get; set; }
} }
public ObservableCollection<T> ToObservableCollection<T>(DataTable dt) where T : class, new() public ObservableCollection<T> ToObservableCollection<T>(DataTable dt) where T : class, new()
{ {

2
Windows/ViewStep.xaml

@ -9,7 +9,7 @@
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
ResizeMode="NoResize" ResizeMode="NoResize"
Title="SUNLIGHT 800" Height="800" Width="600"> Title="SUNLIGHT 800" Height="800" Width="600">
<Grid FocusManager.FocusedElement="{Binding ElementName=box}" > <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="300"/> <RowDefinition Height="300"/>
<RowDefinition/> <RowDefinition/>

66
Windows/ViewStep.xaml.cs

@ -20,6 +20,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
using System.Xml.Linq; using System.Xml.Linq;
using TouchSocket.Core; using TouchSocket.Core;
using static DyeingComputer.ViewModel.MainWindowViewModel;
namespace DyeingComputer.Windows namespace DyeingComputer.Windows
{ {
@ -158,9 +159,12 @@ namespace DyeingComputer.Windows
{ {
try try
{ {
dat_D.BeginEdit(); if (dat_D!=null)
dat_D["Parameter1"] = Convert.ToDouble(P1.Text); {
dat_D.EndEdit(); dat_D.BeginEdit();
dat_D["Parameter1"] = Convert.ToDouble(P1.Text);
dat_D.EndEdit();
}
} }
catch (Exception) { } catch (Exception) { }
} }
@ -168,9 +172,12 @@ namespace DyeingComputer.Windows
{ {
try try
{ {
dat_D.BeginEdit(); if (dat_D != null)
dat_D["Parameter2"] = Convert.ToDouble(P2.Text); {
dat_D.EndEdit(); dat_D.BeginEdit();
dat_D["Parameter2"] = Convert.ToDouble(P2.Text);
dat_D.EndEdit();
}
} }
catch (Exception) { } catch (Exception) { }
} }
@ -178,9 +185,12 @@ namespace DyeingComputer.Windows
{ {
try try
{ {
dat_D.BeginEdit(); if (dat_D != null)
dat_D["Parameter3"] = Convert.ToDouble(P3.Text); {
dat_D.EndEdit(); dat_D.BeginEdit();
dat_D["Parameter3"] = Convert.ToDouble(P3.Text);
dat_D.EndEdit();
}
} }
catch (Exception) { } catch (Exception) { }
} }
@ -188,9 +198,12 @@ namespace DyeingComputer.Windows
{ {
try try
{ {
dat_D.BeginEdit(); if (dat_D != null)
dat_D["Parameter4"] = Convert.ToDouble(P4.Text); {
dat_D.EndEdit(); dat_D.BeginEdit();
dat_D["Parameter4"] = Convert.ToDouble(P4.Text);
dat_D.EndEdit();
}
} }
catch (Exception) { } catch (Exception) { }
} }
@ -198,9 +211,12 @@ namespace DyeingComputer.Windows
{ {
try try
{ {
dat_D.BeginEdit(); if (dat_D != null)
dat_D["Parameter5"] = Convert.ToDouble(P5.Text); {
dat_D.EndEdit(); dat_D.BeginEdit();
dat_D["Parameter5"] = Convert.ToDouble(P5.Text);
dat_D.EndEdit();
}
} }
catch (Exception) { } catch (Exception) { }
} }
@ -444,11 +460,11 @@ namespace DyeingComputer.Windows
int i = boxID.SelectedIndex; int i = boxID.SelectedIndex;
boxNAME.Text = id_dat.ElementAt(i); boxNAME.Text = id_dat.ElementAt(i);
Set(id_dat[i]); Set(id_dat[i]);
P1.Text.Remove(0); P1.Text ="0";
P2.Text.Remove(0); P2.Text = "0";
P3.Text.Remove(0); P3.Text = "0";
P4.Text.Remove(0); P4.Text = "0";
P5.Text.Remove(0); P5.Text = "0";
} }
} }
private void boxIDp_SelectionChanged(object sender, SelectionChangedEventArgs e) private void boxIDp_SelectionChanged(object sender, SelectionChangedEventArgs e)
@ -478,11 +494,11 @@ namespace DyeingComputer.Windows
dat_D.EndEdit(); dat_D.EndEdit();
} }
P1P.Text.Remove(0); P1P.Text = "0";
P2P.Text.Remove(0); P2P.Text = "0";
P3P.Text.Remove(0); P3P.Text = "0";
P4P.Text.Remove(0); P4P.Text = "0";
P5P.Text.Remove(0); P5P.Text = "0";
} }
private void YES_Click(object sender, RoutedEventArgs e)//确认 private void YES_Click(object sender, RoutedEventArgs e)//确认
{ {

Loading…
Cancel
Save