예제 #1
0
        protected override void AddObject()
        {
            if (string.IsNullOrWhiteSpace(MatCode) || MatCode.Length != 9)
            {
                MessageBox.Show("编码信息填写有误");
                return;
            }

            if (_Proxy.CheckMatCode(MatCode))
            {
                MessageBox.Show("错误,标准物资编码重复");
                return;
            }

            T_StandardMaterial item = new T_StandardMaterial()
            {
                MatCode     = this.MatCode,
                MatTypeCode = this.MatTypeComboBox.SelectedValue.ToString(),
                MatModeCode = this.MatModeComboBox.SelectedValue.ToString(),
                MatDesc     = this.DescTextBox.Text
            };

            _Proxy.AddStdMat(item);

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }