|
|
@ -47,8 +47,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View |
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
|
comboBoxMachine.ItemsSource = MainWindowViewModel.Machines.AsEnumerable().Select(rowdata => rowdata.Field<string>("name")).ToList();//转换机台
|
|
|
|
comboBoxProgram.ItemsSource = ProgramName.AsEnumerable().Select(rowdata => rowdata.Field<string>("ProgramName")).ToList();//转换工艺代码
|
|
|
|
|
|
|
|
|
|
|
|
TEXTUSER.Text = MainWindow.user_; |
|
|
|
} |
|
|
|
private void UserControl_Loaded(object sender, RoutedEventArgs e) |
|
|
|
{ |
|
|
@ -81,6 +80,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.View |
|
|
|
comboBoxDyelot.IsEnabled = false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
string color_ = "#FF336FA8"; |
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)//保存按钮
|
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(comboBoxMachine.Text)) |
|
|
@ -171,7 +172,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.View |
|
|
|
WorkOrder_new.Add("Dyelot", Dyelot_); |
|
|
|
WorkOrder_new.Add("Remark", null); |
|
|
|
WorkOrder_new.Add("lock", 0); |
|
|
|
// WorkOrder_new.Add("color", color_);
|
|
|
|
WorkOrder_new.Add("color", color_); |
|
|
|
WorkOrder_new.Add("ColorNumber", TEXTColorNumber.Text); |
|
|
|
WorkOrder_new.Add("Client", TEXTClient.Text); |
|
|
|
WorkOrder_new.Add("ClothWeight", TEXTClothWeight.Text); |
|
|
|
WorkOrder_new.Add("ClothSpecies", TEXTClothSpecies.Text); |
|
|
|
WorkOrder_new.Add("BathRatio", TEXTBathRatio.Text); |
|
|
|
WorkOrder_new.Add("Total", TEXTTotal.Text); |
|
|
|
WorkOrder_new.Add("USER", TEXTUSER.Text); |
|
|
|
WorkOrder_new.Add("ColorName", TEXTColorName.Text); |
|
|
|
SQLiteHelpers.InsertData("WorkOrder", WorkOrder_new);// 执行插入
|
|
|
|
|
|
|
|
Dictionary<string, object> WorkOrder_DAT = new Dictionary<string, object>();//缓存函数
|
|
|
@ -313,6 +322,33 @@ namespace SunlightCentralizedControlManagement_SCCM_.View |
|
|
|
viewstop.ShowDialog(); |
|
|
|
} |
|
|
|
} |
|
|
|
private void MenuItem_Insert(object sender, RoutedEventArgs e)//右键插入
|
|
|
|
{ |
|
|
|
int rownum = Grid_data.SelectedIndex;//获取鼠标选中行并定义变量
|
|
|
|
if (rownum != -1)//判断鼠标定位是否有效
|
|
|
|
{ |
|
|
|
ID = (Grid_data.Columns[2].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第0列,
|
|
|
|
|
|
|
|
int d = 0; |
|
|
|
if (ID != null) { d = Convert.ToInt32(ID); } else { return; } |
|
|
|
string ProgramID = dat.Select().First().Field<string>("ProgramID").ToString(); |
|
|
|
string ProgramNAME = dat.Select().First().Field<string>("Program").ToString(); |
|
|
|
DataRow dr = dat.NewRow();//添加表数据
|
|
|
|
dr["ProgramID"] = ProgramID; |
|
|
|
dr["Program"] = ProgramNAME; |
|
|
|
dat.Rows.InsertAt(dr, d - 1); |
|
|
|
|
|
|
|
Dat(); |
|
|
|
Grid_data.ItemsSource = dat.DefaultView; |
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; } |
|
|
|
if (ID == null) ID = dat.Rows.Count.ToString(); |
|
|
|
ViewStep viewstop = new ViewStep(Numder, P1, P2, P3, P4, P5); |
|
|
|
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked); |
|
|
|
viewstop.data = ID; |
|
|
|
viewstop.ShowDialog(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void Grid_data_MouseDoubleClick(object sender, MouseButtonEventArgs e) |
|
|
|
{ |
|
|
@ -354,5 +390,43 @@ namespace SunlightCentralizedControlManagement_SCCM_.View |
|
|
|
|
|
|
|
Grid_data.ItemsSource = dat.DefaultView; |
|
|
|
} |
|
|
|
public void Dat()//行号刷新
|
|
|
|
{ |
|
|
|
int a = dat.Rows.Count; |
|
|
|
for (int i = 0; i < a; i++) |
|
|
|
{ |
|
|
|
DataRow dr = dat.Rows[i]; |
|
|
|
dr.BeginEdit(); |
|
|
|
dr["Step"] = i + 1; |
|
|
|
dr.EndEdit(); |
|
|
|
} |
|
|
|
} |
|
|
|
private void Tb_KeyTEXTClothWeight(object sender, TextCompositionEventArgs e)//输入事件
|
|
|
|
{ |
|
|
|
Regex numbeRegex = new Regex("^[.][0-9]+$|^[0-9]*[.]{0,1}[0-9]*$"); |
|
|
|
e.Handled = |
|
|
|
!numbeRegex.IsMatch( |
|
|
|
TEXTClothWeight.Text.Insert( |
|
|
|
TEXTClothWeight.SelectionStart, e.Text)); |
|
|
|
TEXTClothWeight.Text = TEXTClothWeight.Text.Trim(); |
|
|
|
} |
|
|
|
private void Tb_KeyTEXTBathRatio(object sender, TextCompositionEventArgs e)//输入事件
|
|
|
|
{ |
|
|
|
Regex numbeRegex = new Regex("^[.][0-9]+$|^[0-9]*[.]{0,1}[0-9]*$"); |
|
|
|
e.Handled = |
|
|
|
!numbeRegex.IsMatch( |
|
|
|
TEXTBathRatio.Text.Insert( |
|
|
|
TEXTBathRatio.SelectionStart, e.Text)); |
|
|
|
TEXTBathRatio.Text = TEXTBathRatio.Text.Trim(); |
|
|
|
} |
|
|
|
private void Tb_KeyTEXTTotal(object sender, TextCompositionEventArgs e)//输入事件
|
|
|
|
{ |
|
|
|
Regex numbeRegex = new Regex("^[.][0-9]+$|^[0-9]*[.]{0,1}[0-9]*$"); |
|
|
|
e.Handled = |
|
|
|
!numbeRegex.IsMatch( |
|
|
|
TEXTTotal.Text.Insert( |
|
|
|
TEXTTotal.SelectionStart, e.Text)); |
|
|
|
TEXTTotal.Text = TEXTTotal.Text.Trim(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|