using Core.Mes.Client.Comm.Tool; using CoreFS.CA06; using System; using System.Data; namespace Core.StlMes.Client.Qcm { public partial class FrmInputStdName : FrmBase { private string _stdName = ""; private Dal _dal; public string StdName { get { return _stdName; } set { _stdName = value; } } public FrmInputStdName(OpeBase ob, string stdName) { InitializeComponent(); this.ob = ob; labelTextBox1.Text = stdName; } private void FrmInputStdName_Load(object sender, EventArgs e) { _dal = new Dal(ob); } private void ultraButton1_Click(object sender, EventArgs e) { if (labelTextBox1.Text.Trim() == "") { MessageUtil.ShowWarning("请输入标准名称!"); return; } _stdName = labelTextBox1.Text.Trim(); if (IsExistStdName(_stdName)) { MessageUtil.ShowWarning("系统已存在相同的标准名称!"); return; } this.DialogResult = System.Windows.Forms.DialogResult.OK; } private void ultraButton2_Click(object sender, EventArgs e) { this.DialogResult = System.Windows.Forms.DialogResult.Cancel; } private bool IsExistStdName(string stdName) { DataRow dr = _dal.CoreProductManage.IsExistStdName(stdName); if (dr[0].ToString() == "0") { return false; } else { return true; } } } }