private void BT_ok_Click(object sender, EventArgs e) { TxtData.PolishData.PartRecipeRemark = TE_Remark.Text; TxtData.PolishData.PartRecipeName = TE_RecipeName.Text.Trim(); TxtData.PolishData.PartMatlabFile = TE_File.Text.Trim(); if (TxtData.PolishData.PartRecipeName == "") { MessageBox.Show("名称为空"); TxtData.PolishData.PartMatlabFile = null; TxtData.PolishData.PartRecipeName = null; return; } if (db.ExistRecipe(RecipeName)) { MessageBox.Show("产品名称已存在!"); TxtData.PolishData.PartMatlabFile = null; TxtData.PolishData.PartRecipeName = null; return; } if (!System.IO.File.Exists(TE_File.Text)) { MessageBox.Show("文件不存在!"); TxtData.PolishData.PartMatlabFile = null; TxtData.PolishData.PartRecipeName = null; return; } this.Close(); }
private void BT_ok_Click(object sender, EventArgs e) { Remark = TE_Remark.Text; RecipeName = TE_RecipeName.Text.Trim(); double.TryParse(TE_F1.Text, out frame[0]); double.TryParse(TE_F2.Text, out frame[1]); double.TryParse(TE_F3.Text, out frame[2]); double.TryParse(TE_F4.Text, out frame[3]); double.TryParse(TE_F5.Text, out frame[4]); double.TryParse(TE_F6.Text, out frame[5]); double.TryParse(TE_O1.Text, out offset[0]); double.TryParse(TE_O2.Text, out offset[1]); double.TryParse(TE_O3.Text, out offset[2]); double.TryParse(TE_O4.Text, out offset[3]); double.TryParse(TE_O5.Text, out offset[4]); double.TryParse(TE_O6.Text, out offset[5]); if (CreatRecipe) { if (RecipeName.Trim() == "") { MessageBox.Show("名称为空"); return; } if (db.ExistRecipe(RecipeName)) { MessageBox.Show("产品名称已存在!"); return; } else { if (db.AddRecipe(RecipeName, int.Parse(CBE_Type.EditValue.ToString()), frame, offset, Remark)) { this.Close(); } else { RecipeName = ""; MessageBox.Show("操作错误!"); return; } } } else { if (db.EditRecipe(RecipeName, int.Parse(CBE_Type.EditValue.ToString()), frame, offset, Remark)) { this.Close(); } else { MessageBox.Show("操作错误!"); return; } } }
private void Poll(object target) { TxtData.PublicData.ErrorCode = ftp.DownLoadRecipe() ? 0 : 16; if (TxtData.PublicData.ErrorCode == 0) { //2014.12.03 //注释掉检查文本格式 // TxtData.PublicData.ErrorCode = PublicFunc.IsRecipeOk(Application.StartupPath + "\\Txt\\Recipe.txt") ? 0 : 33; // } if (TxtData.PublicData.ErrorCode == 0) { TxtData.PublicData.ErrorCode = db.ExistRecipe(RecipeName) ? 0 : 45; } if (TxtData.PublicData.ErrorCode == 0) { TxtData.PublicData.ErrorCode = db.DeleteAllTraj(RecipeName) ? 0 : 38; } if (TxtData.PublicData.ErrorCode == 0) { TxtData.PublicData.ErrorLine = db.ImportProduct(Application.StartupPath + "\\Txt\\Recipe.txt", RecipeName); TxtData.PublicData.ErrorCode = (TxtData.PublicData.ErrorLine == 0) ? 0 : 20; // TxtData.PublicData.ErrorCode = (db.ImportProduct(Application.StartupPath + "\\Txt\\Recipe.txt", RecipeName) == 0) ? 0 : 20; } if (TxtData.PublicData.ErrorCode == 0) { TxtData.PublicData.ErrorCode = RobotKit.SoapInstance.SoapRead.SetAppdata("bUpload", false) ? 0 : 12; } if (TxtData.PublicData.ErrorCode == 0) { while (TxtData.DataBase.Upload) { System.Threading.Thread.Sleep(10); } } IsUpload = false; }
private void BT_ok_Click(object sender, EventArgs e) { Remark = TE_Remark.Text; RecipeName = TE_RecipeName.Text.Trim(); double.TryParse(TE_F1.Text, out frame[0]); double.TryParse(TE_F2.Text, out frame[1]); double.TryParse(TE_F3.Text, out frame[2]); double.TryParse(TE_F4.Text, out frame[3]); double.TryParse(TE_F5.Text, out frame[4]); double.TryParse(TE_F6.Text, out frame[5]); double.TryParse(TE_O1.Text, out offset[0]); double.TryParse(TE_O2.Text, out offset[1]); double.TryParse(TE_O3.Text, out offset[2]); double.TryParse(TE_O4.Text, out offset[3]); double.TryParse(TE_O5.Text, out offset[4]); double.TryParse(TE_O6.Text, out offset[5]); if (CreatRecipe) { if (RecipeName.Trim() == "") { MessageBox.Show("名称为空"); return; } if (!Regex.IsMatch(RecipeName.Trim(), @"^[a-zA-Z0-9_]+$")) { MessageBox.Show("名称不符合规范"); return; } if (db.ExistRecipe(RecipeName)) { MessageBox.Show("产品名称已存在!"); return; } else { if (db.AddRecipe(RecipeName, int.Parse(CBE_Type.EditValue.ToString()), frame, offset, Remark)) { this.Close(); } else { RecipeName = ""; MessageBox.Show("操作错误!"); return; } } } else { if (TC_Traj.SelectedTabPageIndex == 2) { double.TryParse(FL1.Text, out frame[0]); double.TryParse(FL2.Text, out frame[1]); double.TryParse(FL3.Text, out frame[2]); double.TryParse(FL4.Text, out frame[3]); double.TryParse(FL5.Text, out frame[4]); double.TryParse(FL6.Text, out frame[5]); } if (TC_Traj.SelectedTabPageIndex == 3) { double.TryParse(TL1.Text, out offset[0]); double.TryParse(TL2.Text, out offset[1]); double.TryParse(TL3.Text, out offset[2]); double.TryParse(TL4.Text, out offset[3]); double.TryParse(TL5.Text, out offset[4]); double.TryParse(TL6.Text, out offset[5]); } // if (db.EditRecipe(RecipeName, int.Parse(CBE_Type.EditValue.ToString()), frame, offset, Remark)) { this.Close(); } else { MessageBox.Show("操作错误!"); return; } } }