Exemple #1
0
        private void btn_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtRAA001.Text))
            {
                XtraMessageBox.Show("来源单号不可为空");
                return;
            }
            SiftingDataEntity.MainEntity model = new SiftingDataEntity.MainEntity( );
            state = btn.Text;
            if (state.Equals("审核"))
            {
                model.DEL014 = true;
            }
            else
            {
                model.DEL014 = false;
            }

            model.DEL011 = txtRAA001.Text;
            model.DEL015 = txtDEL015.Text;
            if (state.Equals("反审核"))
            {
                if (_bll.Exists(txtRAA001.Text, txtDEA002.Text) == false)
                {
                    XtraMessageBox.Show("已经入库,不允许反审核");
                    return;
                }
            }
            result = _bll.Examine(model);
            if (result)
            {
                XtraMessageBox.Show(state + "成功");
                //if ( state . Equals ( "审核" ) )
                //    btn . Text = "反审核";
                //else if ( state . Equals ( "反审核" ) )
                //    btn . Text = "审核";
                examine(state);
                if (state.Equals("反审核"))
                {
                    toolEdit.Visibility = toolDelete.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
                }
                else
                {
                    toolEdit.Visibility = toolDelete.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
                }
            }
            else
            {
                XtraMessageBox.Show(state + "失败");
            }
        }