Example #1
0
        //确认
        private void button2_Click(object sender, System.EventArgs e)
        {
            if (string.IsNullOrEmpty(lookUpEdit14.Text))
            {
                MessageBox.Show("物料类别不可为空");
                return;
            }
            if (string.IsNullOrEmpty(textBox1.Text))
            {
                MessageBox.Show("领用数量不可为空");
                return;
            }
            if (string.IsNullOrEmpty(lookUpEdit2.Text))
            {
                MessageBox.Show("领用人不可为空");
                return;
            }

            _was        = new MulaolaoLibrary.WarehouseReceiptWASEntity( );
            _was.WAS001 = lookUpEdit14.Text;
            _was.WAS004 = textBox8.Text;
            _was.WAS002 = dateTimePicker1.Value;
            _was.WAS005 = textBox7.Text;
            _was.WAS006 = string.IsNullOrEmpty(textBox1.Text) == true ? 0 : Convert.ToInt32(textBox1.Text);
            _was.WAS007 = string.IsNullOrEmpty(textBox2.Text) == true ? 0 : Convert.ToDecimal(textBox2.Text);
            _was.WAS008 = string.IsNullOrEmpty(textBox3.Text) == true ? 0 : Convert.ToDecimal(textBox3.Text);
            _was.WAS009 = lookUpEdit2.Text;
            _was.WAS010 = richTextBox1.Text;
            _was.WAS012 = string.IsNullOrEmpty(lookUpEdit14.EditValue.ToString( )) == true ? 0 : Convert.ToInt32(lookUpEdit14.EditValue.ToString( ));

            if (this.Text.Equals("新增"))
            {
                result = _bll.AddL(_was);
                if (result == true)
                {
                    MessageBox.Show("新增成功");
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("新增失败");
                }
            }
            else if (this.Text.Equals("编辑"))
            {
                _was.idx = string.IsNullOrEmpty(lookUpEdit14.Tag.ToString( )) == true ? 0 : Convert.ToInt32(lookUpEdit14.Tag);
                result   = _bll.EditL(_was);
                if (result == true)
                {
                    MessageBox.Show("编辑成功");
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("编辑失败");
                }
            }
        }
Example #2
0
 //编辑
 private void button7_Click(object sender, EventArgs e)
 {
     if (getFor( ) == false)
     {
         return;
     }
     isOk = _bll.EditL(_was);
     if (isOk == true)
     {
         MessageBox.Show("编辑成功");
         setFor( );
     }
     else
     {
         MessageBox.Show("编辑失败");
     }
 }