FrmInputStdName.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using Core.Mes.Client.Comm.Tool;
  2. using CoreFS.CA06;
  3. using System;
  4. using System.Data;
  5. namespace Core.StlMes.Client.Qcm
  6. {
  7. public partial class FrmInputStdName : FrmBase
  8. {
  9. private string _stdName = "";
  10. private Dal _dal;
  11. public string StdName
  12. {
  13. get { return _stdName; }
  14. set { _stdName = value; }
  15. }
  16. public FrmInputStdName(OpeBase ob, string stdName)
  17. {
  18. InitializeComponent();
  19. this.ob = ob;
  20. labelTextBox1.Text = stdName;
  21. }
  22. private void FrmInputStdName_Load(object sender, EventArgs e)
  23. {
  24. _dal = new Dal(ob);
  25. }
  26. private void ultraButton1_Click(object sender, EventArgs e)
  27. {
  28. if (labelTextBox1.Text.Trim() == "")
  29. {
  30. MessageUtil.ShowWarning("请输入标准名称!");
  31. return;
  32. }
  33. _stdName = labelTextBox1.Text.Trim();
  34. if (IsExistStdName(_stdName))
  35. {
  36. MessageUtil.ShowWarning("系统已存在相同的标准名称!");
  37. return;
  38. }
  39. this.DialogResult = System.Windows.Forms.DialogResult.OK;
  40. }
  41. private void ultraButton2_Click(object sender, EventArgs e)
  42. {
  43. this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  44. }
  45. private bool IsExistStdName(string stdName)
  46. {
  47. DataRow dr = _dal.CoreProductManage.IsExistStdName(stdName);
  48. if (dr[0].ToString() == "0")
  49. {
  50. return false;
  51. }
  52. else
  53. {
  54. return true;
  55. }
  56. }
  57. }
  58. }