public override int Modify()
        {
            _Refreshbll = new FishBll.Bll.ProcessStateBll();
            if (_Refreshbll.ExistsNumbering(txtNumbering.Text, "hwfkExBool") == true)
            {
                MessageBox.Show("已审核无法操作!");
                return(0);
            }
            if (_fish == null)
            {
                MessageBox.Show("请查询需要修改的数据。");
                return(0);
            }
            if (string.IsNullOrEmpty(txtCodeOdd.Text))
            {
                MessageBox.Show("请选择销售合同号");
                return(0);
            }
            FishBll.Bll.CargoFeedbackSheetBll bll = new FishBll.Bll.CargoFeedbackSheetBll();
            decimal temp = 0;

            _fish.Code = txtcode.Text;
            if (bll.ExistsUpdate(_fish.Code, FishEntity.Variable.User.username) != true)
            {
                MessageBox.Show("不是所属人无法操作!");
                return(0);
            }
            _fish.Sponsor          = txtsponsor.Text.Trim();
            _fish.Acceptor         = txtacceptor.Text.Trim();
            _fish.Processresult    = txtprocessresult.Text.Trim();
            _fish.Evaluation       = txtevaluation.Text.Trim();
            _fish.Attendance       = txtattendance.Text.Trim();
            _fish.Review           = txtreview.Text.Trim();
            _fish.Remarks          = txtremarks.Text.Trim();
            _fish.ConfirmTheWeight = txtConfirmTheWeight.Text;
            _fish.Modifytime       = DateTime.Now;
            _fish.Modifyman        = FishEntity.Variable.User.username;
            _fish.codeContract     = txtCodeOdd.Text;
            bool isOk = bll.Update(_fish);

            if (isOk)
            {
                if (txtNumbering.Text != "")
                {
                    _Refreshbll = new FishBll.Bll.ProcessStateBll();
                    _Refreshbll.GetFormCargoFeedbackSheet(txtNumbering.Text);
                }
                MessageBox.Show("修改成功。");
            }
            else
            {
                //txtcode.Text = string.Empty;
                MessageBox.Show("修改失败。");
            }
            return(1);
        }
Ejemplo n.º 2
0
        public override int Modify()
        {
            _Refreshbll = new FishBll.Bll.ProcessStateBll();
            if (_Refreshbll.ExistsNumbering(txtNumbering.Text, "hwfkExBool") == true)
            {
                MessageBox.Show("已审核无法操作!");
                return(0);
            }
            if (_fish == null)
            {
                MessageBox.Show("请查询需要修改的数据。");
                return(0);
            }
            if (string.IsNullOrEmpty(txtCodeOdd.Text))
            {
                MessageBox.Show("请选择销售合同号");
                return(0);
            }
            FishBll.Bll.CargoFeedbackSheetBll bll = new FishBll.Bll.CargoFeedbackSheetBll();
            decimal temp = 0;

            _fish.Code = txtcode.Text;
            if (bll.ExistsUpdate(_fish.Code, FishEntity.Variable.User.username) != true)
            {
                MessageBox.Show("不是所属人无法操作!");
                return(0);
            }
            _fish.Remarks          = txtremarks.Text.Trim();
            _fish.ConfirmTheWeight = txtConfirmTheWeight.Text;
            _fish.Modifytime       = DateTime.Now;
            _fish.Modifyman        = FishEntity.Variable.User.username;
            _fish.codeContract     = txtCodeOdd.Text;
            _fish.FishMealId       = txtFishMealId.Text;
            _fish.PoundBillNumber  = txtPoundBillNumber.Text;
            _fish.PoundDifference  = txtPoundDifference.Text;
            _fish.NetWeight        = txtNetWeight.Text;
            bool isOk = bll.Update(_fish, this.Name);

            if (isOk)
            {
                //if (txtNumbering.Text != "")
                //{
                //    _Refreshbll = new FishBll.Bll.ProcessStateBll();
                //    _Refreshbll.GetFormCargoFeedbackSheet(txtNumbering.Text);
                //}
                MessageBox.Show("修改成功。");
            }
            else
            {
                //txtcode.Text = string.Empty;
                MessageBox.Show("修改失败。");
            }
            return(1);
        }
        public override void Save()
        {
            if (string.IsNullOrEmpty(txtCodeOdd.Text))
            {
                MessageBox.Show("请选择销售合同号");
                return;
            }

            FishEntity.CargoFeedbackSheetEntity _fish = new FishEntity.CargoFeedbackSheetEntity();
            _fish.Code = FishBll.Bll.SequenceUtil.GetCargoFeedbackSheetSequence();
            decimal temp;

            _fish.Sponsor          = txtsponsor.Text.Trim();
            _fish.Acceptor         = txtacceptor.Text.Trim();
            _fish.Processresult    = txtprocessresult.Text.Trim();
            _fish.Evaluation       = txtevaluation.Text.Trim();
            _fish.Attendance       = txtattendance.Text.Trim();
            _fish.Review           = txtreview.Text.Trim();
            _fish.Remarks          = txtremarks.Text.Trim();
            _fish.ConfirmTheWeight = txtConfirmTheWeight.Text;
            _fish.Createtime       = DateTime.Now;
            _fish.Createman        = FishEntity.Variable.User.username;
            _fish.Modifytime       = DateTime.Now;
            _fish.Modifyman        = FishEntity.Variable.User.username;
            _fish.codeContract     = txtCodeOdd.Text;
            _fish.Numbering        = txtNumbering.Text;

            FishBll.Bll.CargoFeedbackSheetBll bll = new FishBll.Bll.CargoFeedbackSheetBll();
            bool isok = bll.Exists(_fish.Code);

            while (isok)
            {
                _fish.Code = FishBll.Bll.SequenceUtil.GetSampleSingleSequence();
                isok       = bll.Exists(_fish.Code);
            }
            int id = bll.Add(_fish);

            if (id > 0)
            {
                _fish.Id = id;
                if (txtNumbering.Text != "")
                {
                    _Refreshbll = new FishBll.Bll.ProcessStateBll();
                    _Refreshbll.GetFormCargoFeedbackSheet(txtNumbering.Text);
                }
                tmiSave.Visible   = false;
                tmiClose.Visible  = true;
                tmiCancel.Visible = false;
                tmiDelete.Visible = true;
                tmiReview.Visible = true;
                tmiAdd.Visible    = true;
                tmiModify.Visible = true;
                tmiQuery.Visible  = true;
                MessageBox.Show("添加成功。");
                txtcode.Text      = _fish.Code.ToString();
                txtcreateman.Text = _fish.Createman.ToString();
                txtmodifyman.Text = _fish.Modifyman.ToString();
            }
            else
            {
                // txtCode.Text = _fish.Code;
                MessageBox.Show("添加失败。");
            }
        }
Ejemplo n.º 4
0
        public override void Save()
        {
            if (string.IsNullOrEmpty(txtCodeOdd.Text))
            {
                MessageBox.Show("请选择销售合同号");
                return;
            }
            if (check() == false)
            {
                return;
            }
            _fish      = new FishEntity.CargoFeedbackSheetEntity();
            _fish.Code = FishBll.Bll.SequenceUtil.GetCargoFeedbackSheetSequence();
            decimal temp;

            _fish.Remarks          = txtremarks.Text.Trim();
            _fish.ConfirmTheWeight = txtConfirmTheWeight.Text;
            _fish.Createtime       = DateTime.Now;
            _fish.Createman        = FishEntity.Variable.User.username;
            _fish.Modifytime       = DateTime.Now;
            _fish.Modifyman        = FishEntity.Variable.User.username;
            _fish.codeContract     = txtCodeOdd.Text;
            _fish.Numbering        = txtNumbering.Text;
            _fish.FishMealId       = txtFishMealId.Text;
            _fish.PoundBillNumber  = txtPoundBillNumber.Text;
            _fish.PoundDifference  = txtPoundDifference.Text;
            _fish.NetWeight        = txtNetWeight.Text;
            FishBll.Bll.CargoFeedbackSheetBll bll = new FishBll.Bll.CargoFeedbackSheetBll();
            bool isok = bll.Exists(_fish.Code);

            while (isok)
            {
                _fish.Code = FishBll.Bll.SequenceUtil.GetSampleSingleSequence();
                isok       = bll.Exists(_fish.Code);
            }

            decimal dOne = 0M;
            int     id   = 0;

            if (!string.IsNullOrEmpty(_fish.PoundDifference) && decimal.TryParse(_fish.PoundDifference, out dOne) && dOne <= 0)
            {
                id = bll.Add(_fish, this.Name);
            }
            else
            {
                id = bll.Add(_fish);
            }

            if (id > 0)
            {
                _fish.Id = id;
                //if ( txtNumbering . Text != "" )
                //{
                //    _Refreshbll = new FishBll . Bll . ProcessStateBll ( );
                //    _Refreshbll . GetFormCargoFeedbackSheet ( txtNumbering . Text );
                //}
                tmiSave.Visible   = false;
                tmiClose.Visible  = true;
                tmiCancel.Visible = false;
                tmiDelete.Visible = true;
                tmiReview.Visible = true;
                tmiAdd.Visible    = true;
                tmiModify.Visible = true;
                tmiQuery.Visible  = true;
                MessageBox.Show("添加成功。");
                txtcode.Text      = _fish.Code.ToString( );
                txtcreateman.Text = _fish.Createman.ToString( );
                txtmodifyman.Text = _fish.Modifyman.ToString( );
            }
            else
            {
                // txtCode.Text = _fish.Code;
                MessageBox.Show("添加失败。");
            }
        }