示例#1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (formHelper.inputCheck(groupBox1))
            {
                getPara();

                #region  检查要插入的字段是否已存在;
                if (eLogic.SearchNO(txtNo.Text.Trim()))
                {
                    MessageBox.Show("该记录已存在,请从新操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    ClearAction();
                    txtNo.Focus();
                    return;
                }
                #endregion
                //try
                //{
                // 插入设备信息;
                if (eLogic.FrmEquipmentInsert(eClass))
                {
                    ClearAction();
                    //MessageBox.Show("新增记录成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    setComboBox();
                    SetDataGridView("");
                }
                else
                {
                    MessageBox.Show("新增记录失败,请从新操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                //}
                //catch(Exception)
                //{
                //    MessageBox.Show("插入信息失败,请标明文档编号!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
                //}
            }
        }