예제 #1
0
        protected override int Delete( )
        {
            if (string.IsNullOrEmpty(txtDEL015.Text))
            {
                XtraMessageBox.Show("配方单号不可为空");
                return(0);
            }
            if (string.IsNullOrEmpty(txtRAA001.Text))
            {
                XtraMessageBox.Show("订单单号不可为空");
                return(0);
            }
            if (string.IsNullOrEmpty(txtDEA002.Text))
            {
                XtraMessageBox.Show("品名不可为空");
                return(0);
            }

            if (XtraMessageBox.Show("确认删除?", "删除", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (_bll.ExistsJSK(txtRAA001.Text, txtDEA002.Text))
                {
                    XtraMessageBox.Show("系统已经生成分筛领料,不允许删除");
                    return(0);
                }

                result = _bll.Delete(txtDEL015.Text, txtRAA001.Text, txtDEL018.Text);
                if (result)
                {
                    XtraMessageBox.Show("删除成功");
                    controlClear( );
                    controlUnEnable( );
                    deleteTool( );
                    txtDEL015.Text    = string.Empty;
                    txtDEL015.Enabled = true;
                    btn.Enabled       = true;

                    strW       = "1=1";
                    strW       = " AND IBB015='N' AND IBB023='T' AND IBB965!=''";
                    tableQuery = _bll.getTableQuery(strW);
                    txtRAA001.Properties.DataSource    = tableQuery;
                    txtRAA001.Properties.DisplayMember = "IBB001";
                    txtRAA001.Properties.ValueMember   = "IBB001";
                }
                else
                {
                    XtraMessageBox.Show("删除失败");
                }
            }

            return(base.Delete( ));
        }