Exemple #1
0
        /// <summary>
        /// 保存按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void saveBtn_Click(object sender, EventArgs e)
        {
            this.ValidateChildren(ValidationConstraints.Enabled & ValidationConstraints.TabStop & ValidationConstraints.Selectable);
            if (!VTMS.ControlLib.ValidatorManager.ValidateControls(this))
            {
                MessageBox.Show("控件内容不合法");
                return;
            }
            Apply apply = getApplyInfo();

            try
            {
                if (this.isUpdate)
                {
                    ApplyDao.Update(apply);
                }
                else
                {
                    object id = ApplyDao.Add(apply);
                    MessageBox.Show("当前流水号为 " + id);
                }
                this.isUpdate = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
        }
Exemple #2
0
        /// <summary>
        /// 保存
        /// </summary>
        private void saveInfo()
        {
            Apply apply = getPrintInfo();

            try
            {
                if (this.isUpdate)
                {
                    ApplyDao.Update(apply);
                }
                else
                {
                    object id = ApplyDao.Add(apply);
                    MessageBox.Show("当前流水号为 " + id); ApplyDao.Add(apply);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
        }