首次上传
This commit is contained in:
+122
@@ -0,0 +1,122 @@
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Common.OperationCenter;
|
||||
using MECF.Framework.UI.Client.ClientBase;
|
||||
using OpenSEMI.ClientBase;
|
||||
using OpenSEMI.Ctrlib.Controls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace MECF.Framework.UI.Client.TrayThickness
|
||||
{
|
||||
public class TrayDataViewManager
|
||||
{
|
||||
TrayCoatingThickness TrayData;
|
||||
TrayDataViewSqlHelp trayDataHelp = new TrayDataViewSqlHelp();
|
||||
private string TrayID;
|
||||
public TrayDataViewManager(TrayCoatingThickness trayData, string trayID)
|
||||
{
|
||||
TrayData = trayData;
|
||||
TrayID = trayID;
|
||||
}
|
||||
public void UpTrayCoatingThickness()
|
||||
{
|
||||
TrayCoatingThickness _trayCoatingThickness = trayDataHelp.GetTrayCoatingThickness(TrayID);
|
||||
TrayData.Tray.Update(_trayCoatingThickness.Tray);
|
||||
TrayData.TrayInner.Update(_trayCoatingThickness.TrayInner);
|
||||
TrayData.RingInner.Update(_trayCoatingThickness.RingInner);
|
||||
TrayData.RingOuter.Update(_trayCoatingThickness.RingOuter);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 界面数据设置到数据库
|
||||
/// </summary>
|
||||
public bool SET(out string reason)
|
||||
{
|
||||
reason = "";
|
||||
|
||||
// 校验托盘组件数据
|
||||
if (!TrayData.Validate(out reason))
|
||||
return false;
|
||||
|
||||
List<CoatingData> coatingDataList = new List<CoatingData>()
|
||||
{
|
||||
TrayData.Tray,
|
||||
TrayData.TrayInner,
|
||||
TrayData.RingInner,
|
||||
TrayData.RingOuter
|
||||
};
|
||||
|
||||
//检查单个环对象是否存在空数据
|
||||
foreach (var item in coatingDataList)
|
||||
{
|
||||
|
||||
if (item.GetType().GetProperties()
|
||||
.Where(pi => pi.PropertyType == typeof(string))
|
||||
.Select(pi => (string)pi.GetValue(item))
|
||||
.Any(string.IsNullOrEmpty))
|
||||
{
|
||||
reason = $"Please check empty value";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var ret = trayDataHelp.UpTrayNumberData(TrayData, TrayID, coatingDataList);
|
||||
if (!ret)
|
||||
reason = "Failed to write tray Info. to database.";
|
||||
|
||||
if(ret)
|
||||
{
|
||||
foreach (CoatingData coatingData in coatingDataList)
|
||||
{
|
||||
string name = coatingData.SerialNumber;
|
||||
string coating = coatingData.Current;
|
||||
string coatingMax = coatingData.MAX;
|
||||
|
||||
InvokeClient.Instance.Service.DoOperation("GEM_UpdateCoating",
|
||||
name,coating, coatingMax);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户输入数据时,去数据库查询更新到界面
|
||||
/// </summary>
|
||||
/// <param name="part"></param>
|
||||
public void LoadCoatingData(string part)
|
||||
{
|
||||
|
||||
switch (part)
|
||||
{
|
||||
case "Tray":
|
||||
ForUpCoatingData(TrayData.Tray.SerialNumber, TrayData.Tray);
|
||||
break;
|
||||
case "TrayInner":
|
||||
ForUpCoatingData(TrayData.TrayInner.SerialNumber, TrayData.TrayInner);
|
||||
break;
|
||||
case "RingInner":
|
||||
ForUpCoatingData(TrayData.RingInner.SerialNumber, TrayData.RingInner);
|
||||
break;
|
||||
case "RingOuter":
|
||||
ForUpCoatingData(TrayData.RingOuter.SerialNumber, TrayData.RingOuter);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void ForUpCoatingData(string number, CoatingData data)
|
||||
{
|
||||
var coatingData = trayDataHelp.GetCoatingData(number, out var isExistedInDb);
|
||||
if (isExistedInDb)
|
||||
{
|
||||
data.Update(coatingData);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
using MECF.Framework.Common.DataCenter;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
|
||||
namespace MECF.Framework.UI.Client.TrayThickness
|
||||
{
|
||||
/// <summary>
|
||||
/// TrayDataViewSqlHelp
|
||||
/// 1:查询整个Tray对象数据
|
||||
/// 2:插入或者更新整个Tray对象数据
|
||||
/// </summary>
|
||||
public class TrayDataViewSqlHelp
|
||||
{
|
||||
private string tray_number, tray_inner_number, ring_inner_number, ring_outer_number;
|
||||
/// <summary>
|
||||
/// 获取Truy对象整体的数据
|
||||
/// </summary>
|
||||
/// <param name="_trayGuid"></param>
|
||||
/// <returns></returns>
|
||||
public TrayCoatingThickness GetTrayCoatingThickness(string _trayGuid)
|
||||
{
|
||||
//这是一次查询一个对象
|
||||
TrayCoatingThickness trayCoatingThickness = new TrayCoatingThickness();
|
||||
try
|
||||
{
|
||||
//根据TrayID获取对应内外编号
|
||||
string cmdID = $"select * from tray_thickness_data where tray_guid = '{_trayGuid}'";
|
||||
DataTable DataTable = QueryDataClient.Instance.Service.QueryData(cmdID);
|
||||
if (DataTable != null && DataTable.Rows.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
tray_number = DataTable.Rows[0]["tray_number"].ToString();
|
||||
tray_inner_number = DataTable.Rows[0]["tray_inner_number"].ToString();
|
||||
ring_inner_number = DataTable.Rows[0]["ring_inner_number"].ToString();
|
||||
ring_outer_number = DataTable.Rows[0]["ring_outer_number"].ToString();
|
||||
|
||||
trayCoatingThickness.Tray = GetCoatingData(tray_number, out _);
|
||||
trayCoatingThickness.TrayInner = GetCoatingData(tray_inner_number, out _);
|
||||
trayCoatingThickness.RingInner = GetCoatingData(ring_inner_number, out _);
|
||||
trayCoatingThickness.RingOuter = GetCoatingData(ring_outer_number, out _);
|
||||
|
||||
}
|
||||
|
||||
|
||||
return trayCoatingThickness;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return trayCoatingThickness;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取单个环的数据
|
||||
/// </summary>
|
||||
/// <param name="sn"></param>
|
||||
/// <param name="isExistedInDb"></param>
|
||||
/// <returns></returns>
|
||||
public CoatingData GetCoatingData(string sn, out bool isExistedInDb)
|
||||
{
|
||||
var cmd = $"select * from tray_thickness_main where tray_number = '{sn}' ORDER BY create_time DESC LIMIT 1";
|
||||
var dt = QueryDataClient.Instance.Service.QueryData(cmd);
|
||||
|
||||
if (dt is { Rows.Count: > 0 })
|
||||
{
|
||||
var coatingData = new CoatingData()
|
||||
{
|
||||
SerialNumber = dt.Rows[0]["tray_number"].ToString(),
|
||||
MAX = dt.Rows[0]["tray_max_thickness"].ToString(),
|
||||
PmOwned = dt.Rows[0]["pm_number"].ToString(),
|
||||
Current = dt.Rows[0]["tray_coating_thickness"].ToString()
|
||||
};
|
||||
isExistedInDb = true;
|
||||
return coatingData;
|
||||
|
||||
}
|
||||
isExistedInDb = false;
|
||||
return new CoatingData();
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存用户输入的数据到数据库
|
||||
/// </summary>
|
||||
/// <param name="trayCoatingThickness"></param>
|
||||
/// <param name="trayUid"></param>
|
||||
public bool UpTrayNumberData(TrayCoatingThickness trayCoatingThickness, string trayUid, List<CoatingData> coatingData)
|
||||
{
|
||||
List<string> cmdList = new List<string>();
|
||||
|
||||
string cmdID = $"select * from tray_thickness_data where tray_guid = '{trayUid}'";
|
||||
var dt = QueryDataClient.Instance.Service.QueryData(cmdID);
|
||||
if (dt is { Rows.Count: > 0 })
|
||||
cmdList.Add(Cmd_update(trayCoatingThickness, trayUid));
|
||||
else
|
||||
cmdList.Add(Cmd_data_insert(trayCoatingThickness, trayUid));
|
||||
foreach (var item in coatingData)
|
||||
{
|
||||
cmdList.Add(Cmd_main_insert(item));
|
||||
}
|
||||
bool result= QueryDataClient.Instance.Service.ExcuteTransAction(cmdList);
|
||||
return result;
|
||||
}
|
||||
|
||||
public bool GetPartSnByTrayUid(string trayUid, out List<CoatingData> coatingData)
|
||||
{
|
||||
coatingData = new List<CoatingData>();
|
||||
var sql =
|
||||
$"select tray_number, tray_inner_number, ring_inner_number, ring_outer_number from tray_thickness_data WHERE tray_guid = '{trayUid}' limit 1";
|
||||
var dt = QueryDataClient.Instance.Service.QueryData(sql);
|
||||
if (dt is { Rows.Count: > 0 })
|
||||
{
|
||||
//partSnList.Add();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tray中对象编号插入Sql语句拼接
|
||||
/// </summary>
|
||||
/// <param name="trayCoatingThickness"></param>
|
||||
/// <param name="trayID"></param>
|
||||
/// <returns></returns>
|
||||
private string Cmd_data_insert(TrayCoatingThickness trayCoatingThickness,string trayID)
|
||||
{
|
||||
string cmd_data_insert =
|
||||
"insert into tray_thickness_data" +
|
||||
"(tray_guid,tray_number, tray_inner_number, ring_inner_number, ring_outer_number)" +
|
||||
$"values ('{trayID}'," +
|
||||
$"'{trayCoatingThickness.Tray.SerialNumber}'," +
|
||||
$"'{trayCoatingThickness.TrayInner.SerialNumber}'," +
|
||||
$"'{trayCoatingThickness.RingInner.SerialNumber}'," +
|
||||
$"'{trayCoatingThickness.RingOuter.SerialNumber}')";
|
||||
return cmd_data_insert;
|
||||
}
|
||||
/// <summary>
|
||||
/// Tray中对象编号更新Sql语句拼接
|
||||
/// </summary>
|
||||
/// <param name="trayCoatingThickness"></param>
|
||||
/// <param name="trayID"></param>
|
||||
/// <returns></returns>
|
||||
private string Cmd_update(TrayCoatingThickness trayCoatingThickness, string trayID)
|
||||
{
|
||||
string cmd_update =
|
||||
$"update tray_thickness_data set " +
|
||||
$"tray_number = '{trayCoatingThickness.Tray.SerialNumber}', " +
|
||||
$"tray_inner_number= '{trayCoatingThickness.TrayInner.SerialNumber}'," +
|
||||
$"ring_inner_number= '{trayCoatingThickness.RingInner.SerialNumber}'," +
|
||||
$"ring_outer_number= '{trayCoatingThickness.RingOuter.SerialNumber}'" +
|
||||
$"where tray_guid = '{trayID}'";
|
||||
return cmd_update;
|
||||
}
|
||||
/// <summary>
|
||||
/// 每个环对应的数据插入Sql语句拼接
|
||||
/// </summary>
|
||||
/// <param name="coatingData"></param>
|
||||
/// <returns></returns>
|
||||
private string Cmd_main_insert(CoatingData coatingData)
|
||||
{
|
||||
return "insert into tray_thickness_main" +
|
||||
"(tray_guid,tray_number,pm_number, tray_coating_thickness, tray_max_thickness,tray_label,create_time)" +
|
||||
$"values ('{Guid.NewGuid()}'," +
|
||||
$"'{coatingData.SerialNumber}'," +
|
||||
$"'{coatingData.PmOwned}'," +
|
||||
$"'{coatingData.Current}'," +
|
||||
$"'{coatingData.MAX}'," +
|
||||
$"'{coatingData.Caption}'," +
|
||||
$"'{coatingData.CreatTime}')";
|
||||
}
|
||||
}
|
||||
}
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
<Window x:Class="MECF.Framework.UI.Client.TrayThickness.WinTrayThicknessDataView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||
xmlns:micro="clr-namespace:Caliburn.Micro"
|
||||
xmlns:cal="http://www.caliburn.org"
|
||||
xmlns:local="clr-namespace:MECF.Framework.UI.Client.TrayThickness"
|
||||
mc:Ignorable="d"
|
||||
Height="220" Width="800" >
|
||||
<Window.Resources>
|
||||
|
||||
<Style TargetType="TextBlock" >
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="Margin" Value="3"/>
|
||||
<Setter Property="FontFamily" Value="Arial Black"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="{DynamicResource Table_BG_Title}" />
|
||||
<Setter Property="BorderBrush" Value="Gray"/>
|
||||
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
||||
</Style>
|
||||
|
||||
|
||||
</Window.Resources>
|
||||
|
||||
|
||||
<Grid >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="0"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="0"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="0"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="3"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--界面标题-->
|
||||
<Border CornerRadius="0,0,0,0" Grid.ColumnSpan="6" Background="#FF243664" >
|
||||
<TextBlock Text="Tray Coating Thickness" FontSize="15" Foreground="White" HorizontalAlignment="Center" Padding="8,0,0,0"/>
|
||||
</Border >
|
||||
|
||||
<!--首行标签-->
|
||||
<Border Grid.Row="1" Padding="5,1,0,1" BorderThickness="1,0,1,1" >
|
||||
<TextBlock Text="Component" />
|
||||
</Border>
|
||||
<Border Grid.Row="1" Grid.Column="1" Padding="5,1,0,1" BorderThickness="0,0,1,1" >
|
||||
<TextBlock Text="SN"/>
|
||||
</Border>
|
||||
<Border Grid.Row="1" Grid.Column="2" Padding="5,1,0,1" BorderThickness="0,0,1,1" >
|
||||
<TextBlock Text="Coating"/>
|
||||
</Border>
|
||||
<Border Grid.Row="1" Grid.Column="3" Padding="5,1,0,1" BorderThickness="0,0,1,1" >
|
||||
<TextBlock Text="MAX"/>
|
||||
</Border>
|
||||
<Border Grid.Row="1" Grid.Column="4" Padding="5,1,0,1" BorderThickness="0,0,1,1" >
|
||||
<TextBlock Text="PM"/>
|
||||
</Border>
|
||||
|
||||
|
||||
<!--对象行-->
|
||||
<Border Grid.Row="2" Padding="5,1,0,1" BorderThickness="1,0,1,1" >
|
||||
<TextBlock Text="{Binding TrayData.Tray.Caption}"/>
|
||||
</Border>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding TrayData.Tray.SerialNumber}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="LostFocus">
|
||||
<micro:ActionMessage MethodName="LoadCoatingData">
|
||||
<micro:Parameter Value="Tray" />
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</TextBox>
|
||||
<TextBox Grid.Row="2" Grid.Column="2" Text="{Binding TrayData.Tray.Current}" TextChanged="TextBox_TextChanged" />
|
||||
<TextBox Grid.Row="2" Grid.Column="3" Text="{Binding TrayData.Tray.MAX}" TextChanged="TextBox_TextChanged"/>
|
||||
<ComboBox SelectedItem="{Binding PmOwned}" Grid.Row="2" Grid.Column="4" ItemsSource="{Binding PmsList}" />
|
||||
|
||||
|
||||
|
||||
<Border Grid.Row="4" Padding="5,1,0,1" BorderThickness="1,1,1,1" >
|
||||
<TextBlock Text="{Binding TrayData.TrayInner.Caption}"/>
|
||||
</Border>
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding TrayData.TrayInner.SerialNumber}" >
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="LostFocus">
|
||||
<micro:ActionMessage MethodName="LoadCoatingData">
|
||||
<micro:Parameter Value="TrayInner" />
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</TextBox>
|
||||
<TextBox Grid.Row="4" Grid.Column="2" Text="{Binding TrayData.TrayInner.Current}" TextChanged="TextBox_TextChanged"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="3" Text="{Binding TrayData.TrayInner.MAX}" TextChanged="TextBox_TextChanged"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="4" Text="{Binding PmOwned}" IsReadOnly="True" Background="LightGray"/>
|
||||
|
||||
<Border Grid.Row="6" Padding="5,1,0,1" BorderThickness="1,1,1,1" >
|
||||
<TextBlock Text="{Binding TrayData.RingInner.Caption}"/>
|
||||
</Border>
|
||||
<TextBox Grid.Row="6" Grid.Column="1" Text="{Binding TrayData.RingInner.SerialNumber}" >
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="LostFocus">
|
||||
<micro:ActionMessage MethodName="LoadCoatingData">
|
||||
<micro:Parameter Value="RingInner" />
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</TextBox>
|
||||
<TextBox Grid.Row="6" Grid.Column="2" Text="{Binding TrayData.RingInner.Current}" TextChanged="TextBox_TextChanged"/>
|
||||
<TextBox Grid.Row="6" Grid.Column="3" Text="{Binding TrayData.RingInner.MAX}" TextChanged="TextBox_TextChanged"/>
|
||||
<TextBox Grid.Row="6" Grid.Column="4" Text="{Binding PmOwned}" IsReadOnly="True" Background="LightGray"/>
|
||||
|
||||
<Border Grid.Row="8" Padding="5,1,0,1" BorderThickness="1,1,1,1" >
|
||||
<TextBlock Text="{Binding TrayData.RingOuter.Caption}"/>
|
||||
</Border>
|
||||
<TextBox Grid.Row="8" Grid.Column="1" Text="{Binding TrayData.RingOuter.SerialNumber}" >
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="LostFocus">
|
||||
<micro:ActionMessage MethodName="LoadCoatingData">
|
||||
<micro:Parameter Value="RingOuter" />
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</TextBox>
|
||||
<TextBox Grid.Row="8" Grid.Column="2" Text="{Binding TrayData.RingOuter.Current}" TextChanged="TextBox_TextChanged"/>
|
||||
<TextBox Grid.Row="8" Grid.Column="3" Text="{Binding TrayData.RingOuter.MAX}" TextChanged="TextBox_TextChanged"/>
|
||||
<TextBox Grid.Row="8" Grid.Column="4" Text="{Binding PmOwned}" IsReadOnly="True" Background="LightGray"/>
|
||||
|
||||
|
||||
<Grid Grid.Row="1" Grid.Column="5" Grid.RowSpan="8">
|
||||
<Button
|
||||
|
||||
Content="SET"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="SET">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
<!--</Viewbox>-->
|
||||
</Window>
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace MECF.Framework.UI.Client.TrayThickness
|
||||
{
|
||||
/// <summary>
|
||||
/// WinTrayThicknessDataView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class WinTrayThicknessDataView : Window
|
||||
{
|
||||
public WinTrayThicknessDataView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
TextBox textBox = sender as TextBox;
|
||||
double input;
|
||||
if (!double.TryParse(textBox.Text, out input))
|
||||
textBox.Foreground= Brushes.Red;
|
||||
else if (input < 0 || input > 9999999)
|
||||
textBox.Foreground = Brushes.Red;
|
||||
else
|
||||
textBox.Foreground = Brushes.Black;
|
||||
}
|
||||
}
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Common.OperationCenter;
|
||||
using MECF.Framework.Common.SubstrateTrackings;
|
||||
using MECF.Framework.UI.Client.ClientBase;
|
||||
using OpenSEMI.ClientBase;
|
||||
using OpenSEMI.Ctrlib.Controls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Forms.VisualStyles;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace MECF.Framework.UI.Client.TrayThickness
|
||||
{
|
||||
public class WinTrayThicknessDataViewModel : UiViewModelBase
|
||||
{
|
||||
TrayDataViewManager trayDataViewManager;
|
||||
|
||||
private ModuleName MoudleName;
|
||||
|
||||
private int Sloat;
|
||||
|
||||
public TrayCoatingThickness TrayData { get; set; }
|
||||
|
||||
public List<string> PmsList { get; set; } = new List<string>() { "PM1", "PM2" };
|
||||
|
||||
private string pmOwned;
|
||||
public string PmOwned
|
||||
{
|
||||
get { return pmOwned; }
|
||||
set
|
||||
{
|
||||
pmOwned = value;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
public WinTrayThicknessDataViewModel(string _trayGuid, ModuleName moudleName, int sloat)
|
||||
{
|
||||
MoudleName = moudleName;
|
||||
Sloat = sloat;
|
||||
TrayData = new TrayCoatingThickness(_trayGuid);
|
||||
trayDataViewManager = new TrayDataViewManager(TrayData, _trayGuid);
|
||||
UpTrayCoatingThickness();
|
||||
}
|
||||
public void UpTrayCoatingThickness()//打开时,初始化界面数据
|
||||
{
|
||||
trayDataViewManager.UpTrayCoatingThickness();
|
||||
|
||||
PmOwned = TrayData.Tray.PmOwned;
|
||||
}
|
||||
public void SET()//设置到数据库
|
||||
{
|
||||
if (PmOwned is not null && PmOwned.Contains("PM"))
|
||||
{
|
||||
TrayData.Tray.PmOwned = PmOwned;
|
||||
TrayData.TrayInner.PmOwned = PmOwned;
|
||||
TrayData.RingInner.PmOwned = PmOwned;
|
||||
TrayData.RingOuter.PmOwned = PmOwned;
|
||||
}
|
||||
if (trayDataViewManager.SET(out var reason))
|
||||
{
|
||||
InvokeClient.Instance.Service.DoOperation("UpdatTrayBelongTo", MoudleName, Sloat, TrayData.Tray.PmOwned);
|
||||
DialogBox.ShowInfo("MinorCycle Info. created successfully!");
|
||||
TryClose();
|
||||
}
|
||||
else
|
||||
{
|
||||
DialogBox.ShowError(reason);
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadCoatingData(string part)//人工输入名称后,查询数据
|
||||
{
|
||||
trayDataViewManager.LoadCoatingData(part);
|
||||
PmOwned = TrayData.Tray.PmOwned;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user