@@ -10,8 +10,6 @@ using BPA.Helper; | |||
using BPASmartClient.CustomResource.Pages.Enums; | |||
using BPASmartClient.CustomResource.Pages.Model; | |||
using BPASmartClient.CustomResource.Pages.View; | |||
using BPASmartClient.SmallBatchingSystem.Models; | |||
using BPASmartClient.SmallBatchingSystem.Services; | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
@@ -0,0 +1,20 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
public class BaseModel : ObservableObject | |||
{ | |||
public int Index { get; set; } = -1; | |||
public RelayCommand AddCommand { get; set; } | |||
public RelayCommand CancelCommand { get; set; } | |||
public RelayCommand SaveCommand { get; set; } | |||
public RelayCommand<object> RemoveCommand { get; set; } | |||
public RelayCommand<object> DetailsCommand { get; set; } | |||
} | |||
} |
@@ -4,7 +4,7 @@ using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.SmallBatchingSystem.Models | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
public class CommunicationPar | |||
{ | |||
@@ -5,7 +5,7 @@ using System.Text; | |||
using System.Threading.Tasks; | |||
using System.Collections.ObjectModel; | |||
namespace BPASmartClient.SmallBatchingSystem.Models | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
public class ConfigInfoModel | |||
{ | |||
@@ -6,7 +6,7 @@ using System.Threading.Tasks; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using System.Collections.ObjectModel; | |||
namespace BPASmartClient.SmallBatchingSystem.Models | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
/// <summary> | |||
/// 出料口信息 | |||
@@ -4,7 +4,7 @@ using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.SmallBatchingSystem.Models | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
public class PLCModel | |||
{ | |||
@@ -4,7 +4,7 @@ using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.SmallBatchingSystem.Models | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
public class PlcDataModel | |||
{ | |||
@@ -5,7 +5,7 @@ using System.Text; | |||
using System.Threading.Tasks; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using System.Collections.ObjectModel; | |||
namespace BPASmartClient.SmallBatchingSystem.Models | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
public class RecipeInfo : ObservableObject | |||
{ | |||
@@ -5,7 +5,7 @@ using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.SmallBatchingSystem.Models | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
public class RecipeRawMaterialInfo : ObservableObject | |||
{ | |||
@@ -20,5 +20,12 @@ namespace BPASmartClient.SmallBatchingSystem.Models | |||
/// </summary> | |||
public int SiloWeight { get { return _mSiloWeight; } set { _mSiloWeight = value; OnPropertyChanged(); } } | |||
private int _mSiloWeight; | |||
/// <summary> | |||
/// 选中索引 | |||
/// </summary> | |||
public int SelectIndex { get { return _mSelectIndex; } set { _mSelectIndex = value; OnPropertyChanged(); } } | |||
private int _mSelectIndex; | |||
} | |||
} |
@@ -5,7 +5,7 @@ using System.Text; | |||
using System.Threading.Tasks; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
namespace BPASmartClient.SmallBatchingSystem.Models | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
/// <summary> | |||
/// 原料仓信息 | |||
@@ -1,5 +1,5 @@ | |||
using BPA.Helper; | |||
using BPASmartClient.SmallBatchingSystem.Models; | |||
using BPASmartClient.SmallBatchingSystem; | |||
using System; | |||
using System.Collections.Concurrent; | |||
using System.Collections.Generic; | |||
@@ -9,7 +9,7 @@ using System.Text; | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.SmallBatchingSystem.Services | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
public class Control | |||
{ | |||
@@ -6,9 +6,9 @@ using System.Threading; | |||
using System.Threading.Tasks; | |||
using BPA.Helper; | |||
using BPASmartClient.Modbus; | |||
using BPASmartClient.SmallBatchingSystem.Models; | |||
using BPASmartClient.SmallBatchingSystem; | |||
namespace BPASmartClient.SmallBatchingSystem.Services | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
public class PlcServer | |||
{ | |||
@@ -9,7 +9,7 @@ using System.Text; | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.SmallBatchingSystem.Services | |||
namespace BPASmartClient.SmallBatchingSystem | |||
{ | |||
/// <summary> | |||
/// 料仓服务线程 | |||
@@ -5,18 +5,17 @@ using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using BPA.Helper; | |||
using BPASmartClient.SmallBatchingSystem.Models; | |||
using BPASmartClient.SmallBatchingSystem.Views; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
{ | |||
public class NewOutletViewModel : ObservableObject | |||
public class NewOutletViewModel : BaseModel | |||
{ | |||
int index = -1; | |||
public NewOutletViewModel() | |||
{ | |||
Json<ConfigInfoModel>.Data.SiloInfoModels.ToList()?.ForEach(item => { SileName.Add(item.SiloName); }); | |||
ActionManage.GetInstance.Register(new Action<object>((o) => | |||
{ | |||
if (o != null && o is OutletInfoModel tempOutletInfo) | |||
@@ -25,22 +24,23 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
OutletLoc = tempOutletInfo.OutletLoc; | |||
tempOutletInfo.SiloInfos?.ToList()?.ForEach((item => | |||
{ | |||
SiloInfos.Add(new RawMaterialInfo() { RawMaterialName = item }); | |||
int tempIndex = Array.FindIndex(SileName.ToArray(), p => p.Contains(item)); | |||
SiloInfos.Add(new RawMaterialInfo() { RawMaterialName = item, SelectIndex = tempIndex }); | |||
})); | |||
index = Array.FindIndex(Json<ConfigInfoModel>.Data.OutletInfoModels.ToArray(), p => p.OutletName == tempOutletInfo.OutletName); | |||
Index = Array.FindIndex(Json<ConfigInfoModel>.Data.OutletInfoModels.ToArray(), p => p.OutletName == tempOutletInfo.OutletName); | |||
} | |||
}), "OpenNewOutlet", true); | |||
AddRawMaterialCommand = new RelayCommand(() => { SiloInfos.Add(new RawMaterialInfo()); }); | |||
AddCommand = new RelayCommand(() => { SiloInfos.Add(new RawMaterialInfo()); }); | |||
CancelCommand = new RelayCommand(() => { ActionManage.GetInstance.Send("NewOutletViewClose"); }); | |||
SaveCommand = new RelayCommand(() => | |||
{ | |||
ObservableCollection<string> SileNames = new ObservableCollection<string>(); | |||
SiloInfos.ToList()?.ForEach(item => { SileNames.Add(item.RawMaterialName); }); | |||
if (index >= 0 && index < Json<ConfigInfoModel>.Data.OutletInfoModels.Count) | |||
if (Index >= 0 && Index < Json<ConfigInfoModel>.Data.OutletInfoModels.Count) | |||
{ | |||
Json<ConfigInfoModel>.Data.OutletInfoModels.ElementAt(index).OutletName = OutletName; | |||
Json<ConfigInfoModel>.Data.OutletInfoModels.ElementAt(index).OutletLoc = OutletLoc; | |||
Json<ConfigInfoModel>.Data.OutletInfoModels.ElementAt(index).SiloInfos = SileNames; | |||
Json<ConfigInfoModel>.Data.OutletInfoModels.ElementAt(Index).OutletName = OutletName; | |||
Json<ConfigInfoModel>.Data.OutletInfoModels.ElementAt(Index).OutletLoc = OutletLoc; | |||
Json<ConfigInfoModel>.Data.OutletInfoModels.ElementAt(Index).SiloInfos = SileNames; | |||
} | |||
else | |||
{ | |||
@@ -62,18 +62,8 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
} | |||
}); | |||
Json<ConfigInfoModel>.Data.SiloInfoModels.ToList()?.ForEach(item => { SileName.Add(item.SiloName); }); | |||
} | |||
public RelayCommand AddRawMaterialCommand { get; set; } | |||
public RelayCommand CancelCommand { get; set; } | |||
public RelayCommand SaveCommand { get; set; } | |||
public RelayCommand<object> RemoveCommand { get; set; } | |||
public string OutletName { get { return _mOutletName; } set { _mOutletName = value; OnPropertyChanged(); } } | |||
private string _mOutletName; | |||
@@ -91,5 +81,8 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
public string RawMaterialName { get { return _mRawMaterialName; } set { _mRawMaterialName = value; OnPropertyChanged(); } } | |||
private string _mRawMaterialName; | |||
public int SelectIndex { get { return _mSelectIndex; } set { _mSelectIndex = value; OnPropertyChanged(); } } | |||
private int _mSelectIndex; | |||
} | |||
} |
@@ -7,25 +7,49 @@ using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
using System.Collections.ObjectModel; | |||
using BPA.Helper; | |||
using BPASmartClient.SmallBatchingSystem.Models; | |||
namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
{ | |||
public class NewRecipeViewModel : ObservableObject | |||
public class NewRecipeViewModel : BaseModel | |||
{ | |||
//int Index = -1; | |||
public NewRecipeViewModel() | |||
{ | |||
AddRawMaterialCommand = new RelayCommand(() => { SiloInfos.Add(new RecipeRawMaterialInfo()); }); | |||
CnacelCommand = new RelayCommand(() => { ActionManage.GetInstance.Send("NewRecipeViewModelClose"); }); | |||
Json<ConfigInfoModel>.Data.SiloInfoModels.ToList()?.ForEach(item => { SileName.Add(item.SiloName); }); | |||
ActionManage.GetInstance.Register(new Action<object>((o) => | |||
{ | |||
if (o != null && o is RecipeInfo tempRecipeInfo) | |||
{ | |||
RecipeName = tempRecipeInfo.RecipeName; | |||
tempRecipeInfo.SiloInfoModels.ToList()?.ForEach(item => | |||
{ | |||
int tempIndex = Array.FindIndex(SileName.ToArray(), p => p.Contains(item.SiloName)); | |||
SiloInfos.Add(new RecipeRawMaterialInfo() { SiloName = item.SiloName, SiloWeight = item.SiloWeight, SelectIndex = tempIndex }); | |||
}); | |||
Index = Array.FindIndex(Json<ConfigInfoModel>.Data.Recipes.ToArray(), p => p.RecipeName == tempRecipeInfo.RecipeName); | |||
} | |||
}), "OpenNewRecipe", true); | |||
AddCommand = new RelayCommand(() => { SiloInfos.Add(new RecipeRawMaterialInfo()); }); | |||
CancelCommand = new RelayCommand(() => { ActionManage.GetInstance.Send("NewRecipeViewModelClose"); }); | |||
SaveCommand = new RelayCommand(() => | |||
{ | |||
//ObservableCollection<RecipeRawMaterialInfo> SileNames = new ObservableCollection<string>(); | |||
//SiloInfos.ToList()?.ForEach(item => { SileNames.Add(item.RawMaterialName); }); | |||
Json<ConfigInfoModel>.Data.Recipes.Add(new RecipeInfo() | |||
if (Index >= 0 && Index < Json<ConfigInfoModel>.Data.OutletInfoModels.Count) | |||
{ | |||
RecipeName = RecipeName, | |||
SiloInfoModels = SiloInfos | |||
}); | |||
Json<ConfigInfoModel>.Data.Recipes.ElementAt(Index).RecipeName = RecipeName; | |||
Json<ConfigInfoModel>.Data.Recipes.ElementAt(Index).SiloInfoModels.Clear(); | |||
SiloInfos.ToList()?.ForEach(item => | |||
{ | |||
Json<ConfigInfoModel>.Data.Recipes.ElementAt(Index).SiloInfoModels.Add(item); | |||
}); | |||
} | |||
else | |||
{ | |||
Json<ConfigInfoModel>.Data.Recipes.Add(new RecipeInfo() | |||
{ | |||
RecipeName = RecipeName, | |||
SiloInfoModels = SiloInfos | |||
}); | |||
} | |||
ActionManage.GetInstance.Send("NewRecipeViewModelClose"); | |||
}); | |||
@@ -37,20 +61,18 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
if (res != null) SiloInfos.Remove(res); | |||
} | |||
}); | |||
Json<ConfigInfoModel>.Data.SiloInfoModels.ToList()?.ForEach(item => { SileName.Add(item.SiloName); }); | |||
} | |||
public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } } | |||
private string _mRecipeName; | |||
public RelayCommand AddRawMaterialCommand { get; set; } | |||
//public RelayCommand AddCommand { get; set; } | |||
public RelayCommand CnacelCommand { get; set; } | |||
//public RelayCommand CnacelCommand { get; set; } | |||
public RelayCommand SaveCommand { get; set; } | |||
//public RelayCommand SaveCommand { get; set; } | |||
public RelayCommand<object> RemoveCommand { get; set; } | |||
//public RelayCommand<object> RemoveCommand { get; set; } | |||
public ObservableCollection<RecipeRawMaterialInfo> SiloInfos { get; set; } = new ObservableCollection<RecipeRawMaterialInfo>(); | |||
@@ -4,31 +4,51 @@ using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using BPASmartClient.SmallBatchingSystem.Models; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
using BPA.Helper; | |||
namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
{ | |||
public class NewSiloViewModel : ObservableObject | |||
public class NewSiloViewModel : BaseModel | |||
{ | |||
public NewSiloViewModel() | |||
{ | |||
CancelCommand = new RelayCommand(() => { ActionManage.GetInstance.Send("Cancel"); }); | |||
OkCommand = new RelayCommand(() => { ActionManage.GetInstance.Send("OK"); }); | |||
CancelCommand = new RelayCommand(() => { ActionManage.GetInstance.Send("SiloClose"); }); | |||
SaveCommand = new RelayCommand(() => | |||
{ | |||
if (Index >= 0 && Index < Json<ConfigInfoModel>.Data.SiloInfoModels.Count) | |||
{ | |||
Json<ConfigInfoModel>.Data.SiloInfoModels.ElementAt(Index).SiloName = SiloInfoModelObj.SiloName; | |||
Json<ConfigInfoModel>.Data.SiloInfoModels.ElementAt(Index).SiloLoc = SiloInfoModelObj.SiloLoc; | |||
} | |||
else | |||
{ | |||
Json<ConfigInfoModel>.Data.SiloInfoModels.Add(new SiloInfoModel() | |||
{ | |||
SiloLoc = SiloInfoModelObj.SiloLoc, | |||
SiloName = SiloInfoModelObj.SiloName, | |||
}); | |||
} | |||
ActionManage.GetInstance.Send("SiloClose"); | |||
}); | |||
ActionManage.GetInstance.Register(new Action<object>((o) => | |||
{ | |||
if (o != null && o is SiloInfoModel tempSilo) | |||
{ | |||
SiloInfoModelObj.SiloLoc = tempSilo.SiloLoc; | |||
SiloInfoModelObj.SiloName = tempSilo.SiloName; | |||
Index = Array.FindIndex(Json<ConfigInfoModel>.Data.SiloInfoModels.ToArray(), p => p.SiloName == tempSilo.SiloName); | |||
} | |||
}), "OpenNewSilo", true); | |||
} | |||
public SiloInfoModel SiloInfoModelObj { get { return _mSiloInfoModelObj; } set { _mSiloInfoModelObj = value; OnPropertyChanged(); } } | |||
private SiloInfoModel _mSiloInfoModelObj; | |||
private SiloInfoModel _mSiloInfoModelObj = new SiloInfoModel(); | |||
public string ErrorInfo { get { return _mErrorInfo; } set { _mErrorInfo = value; OnPropertyChanged(); } } | |||
private string _mErrorInfo; | |||
public RelayCommand CancelCommand { get; set; } | |||
public RelayCommand OkCommand { get; set; } | |||
} | |||
} |
@@ -5,18 +5,17 @@ using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using BPA.Helper; | |||
using BPASmartClient.SmallBatchingSystem.Models; | |||
using BPASmartClient.SmallBatchingSystem.Views; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
{ | |||
public class OutletManagementViewModel : ObservableObject | |||
public class OutletManagementViewModel : BaseModel | |||
{ | |||
public OutletManagementViewModel() | |||
{ | |||
AddSiloCommand = new RelayCommand(() => | |||
AddCommand = new RelayCommand(() => | |||
{ | |||
NewOutletView newOutletView = new NewOutletView(); | |||
newOutletView.ShowDialog(); | |||
@@ -47,14 +46,6 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
}); | |||
} | |||
public RelayCommand AddSiloCommand { get; set; } | |||
public RelayCommand SaveCommand { get; set; } | |||
public RelayCommand<object> RemoveCommand { get; set; } | |||
public RelayCommand<object> DetailsCommand { get; set; } | |||
public ObservableCollection<OutletInfoModel> OutletInfoModels { get; set; } | |||
@@ -5,10 +5,8 @@ using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using BPA.Helper; | |||
using BPASmartClient.SmallBatchingSystem.Models; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
using BPASmartClient.SmallBatchingSystem.Services; | |||
namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
{ | |||
@@ -5,18 +5,17 @@ using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using BPA.Helper; | |||
using BPASmartClient.SmallBatchingSystem.Models; | |||
using BPASmartClient.SmallBatchingSystem.Views; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
{ | |||
public class RecipeViewModel : ObservableObject | |||
public class RecipeViewModel : BaseModel | |||
{ | |||
public RecipeViewModel() | |||
{ | |||
NewRecipeCommand = new RelayCommand(() => | |||
AddCommand = new RelayCommand(() => | |||
{ | |||
NewRecipeView newOutletView = new NewRecipeView(); | |||
newOutletView.ShowDialog(); | |||
@@ -40,33 +39,13 @@ namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
if (res != null) | |||
{ | |||
NewRecipeView newOutletView = new NewRecipeView(); | |||
newOutletView.outName.Text = o.ToString(); | |||
//res.SiloInfoModels?.ToList()?.ForEach(item => { NewRecipeViewModel.SiloInfoModels.Add(item); }); | |||
//int index = Array.FindIndex(Json<ConfigInfoModel>.Data.Recipes.ToArray(), p => p.RecipeName == o.ToString()); | |||
//if (index >= 0 && index < Json<ConfigInfoModel>.Data.Recipes.Count) | |||
//{ | |||
// NewRecipeViewModel.SiloInfoModels = Json<ConfigInfoModel>.Data.Recipes.ElementAt(index).SiloInfoModels; | |||
//} | |||
ActionManage.GetInstance.Send("OpenNewRecipe", res); | |||
newOutletView.ShowDialog(); | |||
//int index = Array.FindIndex(Json<ConfigInfoModel>.Data.Recipes.ToArray(), p => p.RecipeName == o.ToString()); | |||
//if (index >= 0 && index < Json<ConfigInfoModel>.Data.Recipes.Count) | |||
//{ | |||
// NewRecipeViewModel.SiloInfoModels = Json<ConfigInfoModel>.Data.Recipes.ElementAt(index).SiloInfoModels; | |||
//} | |||
} | |||
} | |||
}); | |||
} | |||
public RelayCommand NewRecipeCommand { get; set; } | |||
public RelayCommand SaveCommand { get; set; } | |||
public RelayCommand<object> RemoveCommand { get; set; } | |||
public RelayCommand<object> DetailsCommand { get; set; } | |||
public ObservableCollection<RecipeInfo> RecipeInfoModels { get; set; } | |||
} | |||
} |
@@ -6,31 +6,45 @@ using System.Threading.Tasks; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
using BPASmartClient.SmallBatchingSystem.Views; | |||
using BPASmartClient.SmallBatchingSystem.Models; | |||
using System.Collections.ObjectModel; | |||
using BPA.Helper; | |||
namespace BPASmartClient.SmallBatchingSystem.ViewModels | |||
{ | |||
public class SiloManagementViewModel : ObservableObject | |||
public class SiloManagementViewModel : BaseModel | |||
{ | |||
public SiloManagementViewModel() | |||
{ | |||
AddSilo = new RelayCommand(() => | |||
AddCommand = new RelayCommand(() => | |||
{ | |||
NewSiloView newSiloView = new NewSiloView(); | |||
if (newSiloView.ShowDialog() == true) | |||
newSiloView.ShowDialog(); | |||
}); | |||
SaveCommand = new RelayCommand(() => { Json<ConfigInfoModel>.Save(); }); | |||
SiloInfoModels = Json<ConfigInfoModel>.Data.SiloInfoModels; | |||
RemoveCommand = new RelayCommand<object>((o) => | |||
{ | |||
if (!string.IsNullOrEmpty(o?.ToString())) | |||
{ | |||
//if (newSiloView.Tag!=null && newSiloView.Tag is ) | |||
var res = Json<ConfigInfoModel>.Data.SiloInfoModels.FirstOrDefault(p => p.SiloName == o.ToString()); | |||
if (res != null) Json<ConfigInfoModel>.Data.SiloInfoModels.Remove(res); | |||
} | |||
}); | |||
SaveData = new RelayCommand(() => { Json<ConfigInfoModel>.Save(); }); | |||
SiloInfoModels = Json<ConfigInfoModel>.Data.SiloInfoModels; | |||
} | |||
public RelayCommand AddSilo { get; set; } | |||
public RelayCommand SaveData { get; set; } | |||
DetailsCommand = new RelayCommand<object>((o) => | |||
{ | |||
if (!string.IsNullOrEmpty(o?.ToString())) | |||
{ | |||
var res = Json<ConfigInfoModel>.Data.SiloInfoModels.FirstOrDefault(p => p.SiloName == o.ToString()); | |||
if (res != null) | |||
{ | |||
NewSiloView newSiloView = new NewSiloView(); | |||
ActionManage.GetInstance.Send("OpenNewSilo", res); | |||
newSiloView.ShowDialog(); | |||
} | |||
} | |||
}); | |||
} | |||
public ObservableCollection<SiloInfoModel> SiloInfoModels { get; set; } | |||
@@ -182,7 +182,7 @@ | |||
Width="90" | |||
Height="30" | |||
Margin="5,0,5,0" | |||
Command="{Binding AddRawMaterialCommand}" | |||
Command="{Binding AddCommand}" | |||
Content="添加原料" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
@@ -251,51 +251,52 @@ | |||
<ItemsControl ItemsSource="{Binding SiloInfos}"> | |||
<ItemsControl.ItemTemplate> | |||
<DataTemplate> | |||
<RadioButton GroupName="all"> | |||
<!--<RadioButton Content="{Binding RawMaterialName}" Name="rb" GroupName="all"> | |||
<RadioButton.Template> | |||
<ControlTemplate TargetType="RadioButton"> | |||
<Grid Name="gr" Height="30"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition Width="0.68*" /> | |||
</Grid.ColumnDefinitions> | |||
<ComboBox | |||
Name="cb" | |||
Grid.Column="0" | |||
VerticalAlignment="Center" | |||
BorderBrush="#FF074B92" | |||
BorderThickness="1" | |||
FontFamily="楷体" | |||
Height="{Binding ElementName=gr,Path=ActualHeight}" | |||
FontSize="20" | |||
Foreground="#FF2AB2E7" | |||
IsEditable="False" | |||
ItemsSource="{Binding DataContext.SileName, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||
Style="{StaticResource ComboBoxStyle}" | |||
Text="{Binding RawMaterialName}" /> | |||
<Button | |||
Grid.Column="1" | |||
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||
CommandParameter="{Binding RawMaterialName}" | |||
Content="删除" | |||
FontSize="16" | |||
Style="{StaticResource ControlButtonStyle}" /> | |||
<!--<Button | |||
<ControlTemplate TargetType="RadioButton">--> | |||
<Grid Name="gr" Height="30"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition Width="0.68*" /> | |||
</Grid.ColumnDefinitions> | |||
<ComboBox | |||
Name="cb" | |||
Grid.Column="0" | |||
Height="{Binding ElementName=gr, Path=ActualHeight}" | |||
VerticalAlignment="Center" | |||
BorderBrush="#FF074B92" | |||
BorderThickness="1" | |||
FontFamily="楷体" | |||
FontSize="20" | |||
Foreground="#FF2AB2E7" | |||
IsEditable="False" | |||
ItemsSource="{Binding DataContext.SileName, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||
SelectedIndex="{Binding SelectIndex}" | |||
Style="{StaticResource ComboBoxStyle}" | |||
Text="{Binding RawMaterialName}" /> | |||
<Button | |||
Grid.Column="1" | |||
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||
CommandParameter="{Binding RawMaterialName}" | |||
Content="删除" | |||
FontSize="16" | |||
Style="{StaticResource ControlButtonStyle}" /> | |||
<!--<Button | |||
Grid.Column="1" | |||
Width="80" | |||
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||
CommandParameter="{Binding RawMaterialName}" | |||
Content="删除" />--> | |||
</Grid> | |||
</Grid> | |||
</ControlTemplate> | |||
<!--</ControlTemplate> | |||
</RadioButton.Template> | |||
</RadioButton> | |||
</RadioButton>--> | |||
</DataTemplate> | |||
</ItemsControl.ItemTemplate> | |||
</ItemsControl> | |||
@@ -1,5 +1,4 @@ | |||
using BPA.Helper; | |||
using BPASmartClient.SmallBatchingSystem.Models; | |||
using BPASmartClient.SmallBatchingSystem.ViewModels; | |||
using System; | |||
using System.Collections.Generic; | |||
@@ -102,6 +102,20 @@ | |||
<Setter Property="FontWeight" Value="SemiBold" /> | |||
</Style> | |||
<Style x:Key="InputTextboxStyle" TargetType="TextBox"> | |||
<Setter Property="Margin" Value="5,0,0,0" /> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
<Setter Property="HorizontalAlignment" Value="Left" /> | |||
<Setter Property="Width" Value="150" /> | |||
<Setter Property="Height" Value="40" /> | |||
<Setter Property="CaretBrush" Value="{StaticResource TitleBorderColor}" /> | |||
<Setter Property="Foreground" Value="{StaticResource TitleBorderColor}" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="FontSize" Value="14" /> | |||
<Setter Property="Background" Value="Transparent" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
</Style> | |||
</Window.Resources> | |||
<Grid> | |||
@@ -152,7 +166,7 @@ | |||
Width="90" | |||
Height="30" | |||
Margin="5,0,5,0" | |||
Command="{Binding AddRawMaterialCommand}" | |||
Command="{Binding AddCommand}" | |||
Content="添加原料" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
@@ -161,7 +175,7 @@ | |||
Width="90" | |||
Height="30" | |||
Margin="5,0,5,0" | |||
Command="{Binding CnacelCommand}" | |||
Command="{Binding CancelCommand}" | |||
Content="取消" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
@@ -231,7 +245,7 @@ | |||
<RadioButton GroupName="all"> | |||
<RadioButton.Template> | |||
<ControlTemplate TargetType="RadioButton"> | |||
<Grid Name="gr" Height="40"> | |||
<Grid Name="gr" Height="30"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
@@ -241,7 +255,7 @@ | |||
<ComboBox | |||
Name="cb" | |||
Grid.Column="0" | |||
Margin="3,1" | |||
Height="{Binding ElementName=gr, Path=ActualHeight}" | |||
VerticalAlignment="Center" | |||
BorderBrush="#FF074B92" | |||
BorderThickness="1" | |||
@@ -250,23 +264,37 @@ | |||
Foreground="#FF2AB2E7" | |||
IsEditable="False" | |||
ItemsSource="{Binding DataContext.SileName, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||
SelectedIndex="0" | |||
SelectedIndex="{Binding SelectIndex}" | |||
Style="{StaticResource ComboBoxStyle}" | |||
Text="{Binding SiloName}" /> | |||
<TextBox | |||
Grid.Column="1" | |||
Height="35" | |||
Margin="5,0,0,0" | |||
FontSize="20" | |||
Style="{StaticResource TextBoxStyle}" | |||
Text="{Binding SiloWeight}" /> | |||
<Grid Grid.Column="1"> | |||
<TextBox | |||
Height="{Binding ElementName=gr, Path=ActualHeight}" | |||
FontSize="20" | |||
Style="{StaticResource InputTextboxStyle}" | |||
Text="{Binding SiloWeight}" /> | |||
<Border | |||
BorderBrush="#FF074B92" | |||
BorderThickness="1,0,1,1" | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<Button | |||
Grid.Column="2" | |||
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||
CommandParameter="{Binding SiloName}" | |||
Content="删除" /> | |||
Content="删除" | |||
FontSize="16" | |||
Style="{StaticResource ControlButtonStyle}" /> | |||
<!--<Button | |||
Grid.Column="2" | |||
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||
CommandParameter="{Binding SiloName}" | |||
Content="删除" />--> | |||
</Grid> | |||
@@ -1,5 +1,4 @@ | |||
using BPA.Helper; | |||
using BPASmartClient.SmallBatchingSystem.Models; | |||
using BPASmartClient.SmallBatchingSystem.ViewModels; | |||
using System; | |||
using System.Collections.Generic; | |||
@@ -123,7 +123,6 @@ | |||
Width="150" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Click="Button_Click" | |||
Command="{Binding CancelCommand}" | |||
Content="取消" | |||
FontSize="20" | |||
@@ -135,8 +134,7 @@ | |||
Width="150" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Click="Button_Click_1" | |||
Command="{Binding OkCommand}" | |||
Command="{Binding SaveCommand}" | |||
Content="保存" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
@@ -12,7 +12,6 @@ using System.Windows.Media; | |||
using System.Windows.Media.Imaging; | |||
using System.Windows.Shapes; | |||
using BPA.Helper; | |||
using BPASmartClient.SmallBatchingSystem.Models; | |||
namespace BPASmartClient.SmallBatchingSystem.Views | |||
{ | |||
@@ -24,6 +23,7 @@ namespace BPASmartClient.SmallBatchingSystem.Views | |||
public NewSiloView() | |||
{ | |||
InitializeComponent(); | |||
ActionManage.GetInstance.Register(new Action(() => { this.Close(); }), "SiloClose", true); | |||
} | |||
private void Button_Click(object sender, RoutedEventArgs e) | |||
@@ -161,7 +161,7 @@ | |||
Width="150" | |||
Height="40" | |||
Margin="10,0,10,0" | |||
Command="{Binding AddSiloCommand}" | |||
Command="{Binding AddCommand}" | |||
Content="添加出料口" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
@@ -176,199 +176,6 @@ | |||
</StackPanel> | |||
<Grid Grid.Row="1"> | |||
<!--<ListBox | |||
Margin="5" | |||
VerticalAlignment="Top" | |||
Background="Transparent" | |||
BorderThickness="0" | |||
ItemsSource="{Binding OutletInfoModels}" | |||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | |||
<ListBox.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
<WrapPanel Orientation="Horizontal" /> | |||
</ItemsPanelTemplate> | |||
</ListBox.ItemsPanel> | |||
<ListBox.ItemTemplate> | |||
<DataTemplate> | |||
<Grid | |||
Name="tt" | |||
Height="220" | |||
Margin="5"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="30" /> | |||
<RowDefinition Height="20" /> | |||
<RowDefinition Height="128" /> | |||
<RowDefinition Height="2" /> | |||
<RowDefinition Height="40" /> | |||
</Grid.RowDefinitions> | |||
<Image | |||
Grid.RowSpan="5" | |||
Source="/BPASmartClient.CustomResource;component/Image/配方背景/竖背景框.png" | |||
Stretch="Fill" /> | |||
<StackPanel Grid.Row="0" Orientation="Horizontal"> | |||
<TextBlock | |||
Margin="2,5,0,0" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Top" | |||
FontSize="18" | |||
Foreground="#FF2AB2E7" | |||
Text="出料口名称:" /> | |||
<TextBlock | |||
Margin="2,5,0,0" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Top" | |||
FontSize="18" | |||
Foreground="#FF2AB2E7" | |||
Text="{Binding OutletName}" /> | |||
</StackPanel> | |||
<StackPanel Grid.Row="1" Orientation="Horizontal"> | |||
<TextBlock | |||
Margin="2,5,0,0" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Top" | |||
FontSize="18" | |||
Foreground="#FF2AB2E7" | |||
Text="出料口位置:" /> | |||
<TextBlock | |||
Margin="2,5,0,0" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Top" | |||
FontSize="18" | |||
Foreground="#FF2AB2E7" | |||
Text="{Binding OutletLoc}" /> | |||
</StackPanel> | |||
--> | |||
<!--<TextBlock | |||
Grid.Row="0" | |||
Margin="2,5,0,0" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Top" | |||
FontSize="18" | |||
Foreground="#FF2AB2E7" | |||
Text="{Binding OutletName}" />--> | |||
<!-- | |||
<TextBlock | |||
Grid.Row="1" | |||
Margin="5,0,0,0" | |||
VerticalAlignment="Top" | |||
Foreground="#FF2AB2E7" | |||
Text="料仓信息:" /> | |||
<ScrollViewer | |||
Grid.Row="2" | |||
VerticalAlignment="Top" | |||
Background="Transparent" | |||
HorizontalScrollBarVisibility="Hidden" | |||
VerticalScrollBarVisibility="Hidden"> | |||
<Grid> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="auto" /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
<ItemsControl ItemsSource="{Binding SiloInfoModels}"> | |||
<ItemsControl.ItemTemplate> | |||
<DataTemplate> | |||
<Grid Width="150"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition Width="0.1*" /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock | |||
Margin="5,0,0,0" | |||
HorizontalAlignment="Right" | |||
VerticalAlignment="Center" | |||
Foreground="#aa2AB2E7" | |||
Text="{Binding SiloName}" /> | |||
<TextBlock | |||
Grid.Column="1" | |||
Margin="1,0,0,0" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Foreground="#aa2AB2E7" | |||
Text=":" /> | |||
<TextBlock | |||
Grid.Column="2" | |||
Margin="5,0,0,0" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Center" | |||
Foreground="#aa2AB2E7" | |||
Text="{Binding SiloWeight}" /> | |||
</Grid> | |||
</DataTemplate> | |||
</ItemsControl.ItemTemplate> | |||
</ItemsControl> | |||
</Grid> | |||
</ScrollViewer> | |||
<Image | |||
Grid.Row="3" | |||
Width="{Binding ElementName=tt, Path=ActualWidth}" | |||
Height="2" | |||
VerticalAlignment="Bottom" | |||
Source="/BPASmartClient.CustomResource;component/Image/直线.png" | |||
Stretch="Fill" /> | |||
<Grid | |||
Name="gr" | |||
Grid.Row="4" | |||
Height="30" | |||
Margin="0,0,0,10" | |||
VerticalAlignment="Bottom" | |||
Background="Transparent"> | |||
<pry:IcoButton | |||
Width="{Binding ElementName=gr, Path=ActualWidth}" | |||
Height="{Binding ElementName=gr, Path=ActualHeight}" | |||
Margin="4,4,3,0" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Background="#11F53F62" | |||
BorderThickness="0" | |||
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}" | |||
CommandParameter="{Binding OutletName}" | |||
Content="删除" | |||
EnterBackground="#22F53F62" | |||
FontStyle="Normal" | |||
Foreground="#FFF53F62" | |||
IcoText="" | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
<pry:IcoButton | |||
Grid.Column="1" | |||
Width="{Binding ElementName=gr, Path=ActualWidth}" | |||
Height="{Binding ElementName=gr, Path=ActualHeight}" | |||
Margin="3,4,4,0" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Background="#112AB2E7" | |||
BorderThickness="0" | |||
Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}" | |||
CommandParameter="{Binding OutletName}" | |||
Content="编辑" | |||
EnterBackground="#222AB2E7" | |||
Foreground="#FF2AB2E7" | |||
IcoText="" | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
</Grid> | |||
</Grid> | |||
</DataTemplate> | |||
</ListBox.ItemTemplate> | |||
</ListBox>--> | |||
<ListView | |||
Margin="10" | |||
Background="Transparent" | |||
@@ -431,7 +238,11 @@ | |||
Text="{Binding OutletLoc}" /> | |||
</StackPanel> | |||
<Grid Height="30" Margin="0 0 0 10" Name="gr" Grid.Row="2"> | |||
<Grid | |||
Name="gr" | |||
Grid.Row="2" | |||
Height="30" | |||
Margin="0,0,0,10"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
@@ -472,28 +283,6 @@ | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
</Grid> | |||
<!--<Button | |||
Grid.Row="1" | |||
Grid.Column="0" | |||
Grid.ColumnSpan="2" | |||
Foreground="#00BEFA" | |||
Width="130" | |||
Height="30" | |||
Margin="0,0,0,10" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Bottom" | |||
Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}" | |||
CommandParameter="{Binding IpAddress}" | |||
Content="修改原料名称" | |||
IsEnabled="{Binding IsEnable}"> | |||
<Button.Background> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/系统名称.png" /> | |||
</Button.Background> | |||
</Button>--> | |||
</Grid> | |||
</Border> | |||
@@ -1,4 +1,5 @@ | |||
using System; | |||
using BPA.Helper; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
@@ -23,6 +24,12 @@ namespace BPASmartClient.SmallBatchingSystem.Views | |||
public OutletManagementView() | |||
{ | |||
InitializeComponent(); | |||
this.Unloaded += OutletManagementView_Unloaded; | |||
} | |||
private void OutletManagementView_Unloaded(object sender, RoutedEventArgs e) | |||
{ | |||
Json<ConfigInfoModel>.Save(); | |||
} | |||
} | |||
} |
@@ -161,7 +161,7 @@ | |||
Width="150" | |||
Height="40" | |||
Margin="10,0,10,0" | |||
Command="{Binding NewRecipeCommand}" | |||
Command="{Binding AddCommand}" | |||
Content="新建配方" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
@@ -1,4 +1,5 @@ | |||
using System; | |||
using BPA.Helper; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
@@ -23,6 +24,12 @@ namespace BPASmartClient.SmallBatchingSystem.Views | |||
public RecipeView() | |||
{ | |||
InitializeComponent(); | |||
this.Unloaded += RecipeView_Unloaded; | |||
} | |||
private void RecipeView_Unloaded(object sender, RoutedEventArgs e) | |||
{ | |||
Json<ConfigInfoModel>.Save(); | |||
} | |||
} | |||
} |
@@ -6,6 +6,7 @@ | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:BPASmartClient.SmallBatchingSystem.Views" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||
xmlns:vm="clr-namespace:BPASmartClient.SmallBatchingSystem.ViewModels" | |||
d:DesignHeight="450" | |||
d:DesignWidth="800" | |||
@@ -160,7 +161,7 @@ | |||
Width="150" | |||
Height="40" | |||
Margin="10,0,10,0" | |||
Command="{Binding AddSilo}" | |||
Command="{Binding AddCommand}" | |||
Content="添加料仓" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
@@ -168,7 +169,7 @@ | |||
Width="150" | |||
Height="40" | |||
Margin="10,0,10,0" | |||
Command="{Binding SaveData}" | |||
Command="{Binding SaveCommand}" | |||
Content="保存参数" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
@@ -237,7 +238,54 @@ | |||
Text="{Binding SiloLoc}" /> | |||
</StackPanel> | |||
<Button | |||
<Grid | |||
Name="gr" | |||
Grid.Row="2" | |||
Height="30" | |||
Margin="0,0,0,10"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
<pry:IcoButton | |||
Width="{Binding ElementName=gr, Path=ActualWidth}" | |||
Height="{Binding ElementName=gr, Path=ActualHeight}" | |||
Margin="4,4,3,0" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Background="#11F53F62" | |||
BorderThickness="0" | |||
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}" | |||
CommandParameter="{Binding SiloName}" | |||
Content="删除" | |||
EnterBackground="#22F53F62" | |||
FontStyle="Normal" | |||
Foreground="#FFF53F62" | |||
IcoText="" | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
<pry:IcoButton | |||
Grid.Column="1" | |||
Width="{Binding ElementName=gr, Path=ActualWidth}" | |||
Height="{Binding ElementName=gr, Path=ActualHeight}" | |||
Margin="3,4,4,0" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Background="#112AB2E7" | |||
BorderThickness="0" | |||
Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}" | |||
CommandParameter="{Binding SiloName}" | |||
Content="编辑" | |||
EnterBackground="#222AB2E7" | |||
Foreground="#FF2AB2E7" | |||
IcoText="" | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
</Grid> | |||
<!--<Button | |||
Grid.Row="2" | |||
Width="130" | |||
Height="30" | |||
@@ -248,7 +296,7 @@ | |||
Content="修改原料名称" | |||
FontSize="16" | |||
IsEnabled="{Binding IsEnable}" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
Style="{StaticResource ImageButtonStyle}" />--> | |||
</Grid> | |||
</Border> | |||
@@ -1,4 +1,5 @@ | |||
using System; | |||
using BPA.Helper; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
@@ -23,6 +24,12 @@ namespace BPASmartClient.SmallBatchingSystem.Views | |||
public SiloManagementView() | |||
{ | |||
InitializeComponent(); | |||
this.Unloaded += SiloManagementView_Unloaded; | |||
} | |||
private void SiloManagementView_Unloaded(object sender, RoutedEventArgs e) | |||
{ | |||
Json<ConfigInfoModel>.Save(); | |||
} | |||
} | |||
} |