示例#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;
        }
示例#2
0
 public void UpdateStdMat(T_StandardMaterial stdMat)
 {
     StdMatList.Remove(StdMatList.Find(o => o.MatCode == stdMat.MatCode));
     StdMatList.Add(stdMat);
 }
示例#3
0
        private void InitStdMatList()
        {
            StdMatList = new List<T_StandardMaterial>();

            T_StandardMaterial stdMatA = new T_StandardMaterial() { MatCode = "A0B0C1001", MatDesc = "测试编码1", MatTypeCode = "TA", MatModeCode = "MA" };
            T_StandardMaterial stdMatB = new T_StandardMaterial() { MatCode = "A0B0C2002", MatDesc = "测试编码2", MatTypeCode = "TC", MatModeCode = "MC" };

            StdMatList.Add(stdMatA);
            StdMatList.Add(stdMatB);
        }
示例#4
0
 public void AddStdMat(T_StandardMaterial stdMat)
 {
     StdMatList.Add(stdMat);
 }