Exemplo n.º 1
0
        protected void QueryByWhere( )
        {
            _bll = new FishBll.Bll.PresaleRequisitionBll( );
            List <FishEntity.PresaleRequisitionHeadEntity> list = _bll.GetModelList(_where + _rolewhere + _orderBy);

            if (list == null || list.Count < 1)
            {
                MessageBox.Show("查无记录。");
            }
            else
            {
                _model = list [0];

                dataGridView1.Rows.Clear( );
                dataGridView2.Rows.Clear( );
                dataGridView3.Rows.Clear( );
                dataGridView4.Rows.Clear( );

                Clear( );

                SetPresaleRequisition( );
                Sethappening( );
                Setsgsindicators( );
                SetIndex( );
                Ship( );

                tmiModify.Visible   = true;
                tmiDelete.Visible   = true;
                tmiNext.Visible     = true;
                tmiPrevious.Visible = true;
                tmiReview.Visible   = true;
            }
            panel1.Enabled = true;
        }
Exemplo n.º 2
0
 void GenerateBody ( )
 {
     _bll = new FishBll . Bll . PresaleRequisitionBll ( );
     List<FishEntity . PresaleRequisitionBodyEntity> modelList = _bll . GetBodyList ( txtcode . Text );
     if ( modelList . Count < 1 )
         return;
     bodySetValue ( modelList );
 }
Exemplo n.º 3
0
        //保存
        public override void Save( )
        {
            _model    = new FishEntity.PresaleRequisitionHeadEntity( );
            _modelOne = new FishEntity.PresaleRequisitionBodyEntity( );

            if (GetPresaleRequisition( ) == false)
            {
                return;
            }
            _model.createman  = FishEntity.Variable.User.username;
            _model.createtime = _bll.getDate( );
            _model.modifyman  = _model.createman;
            _model.modifytime = _model.createtime;

            List <FishEntity.PresaleRequisitionBodyEntity> modelList = new List <FishEntity.PresaleRequisitionBodyEntity> ( );

            DataViewOne(modelList);

            _bll = new FishBll.Bll.PresaleRequisitionBll( );

            if (state == "add")
            {
                result = _bll.Add(_model, modelList);
            }
            else if (state == "edit")
            {
                result = _bll.Edit(_model, modelList);
            }

            if (result == true)
            {
                MessageBox.Show("保存成功");

                tmiSave.Visible   = false;
                tmiCancel.Visible = false;
                tmiAdd.Visible    = true;
                tmiModify.Visible = true;
                tmiQuery.Visible  = true;
                tmiDelete.Visible = true;
                tmiClose.Visible  = true;
                tmiReview.Visible = true;

                //panel2 . Enabled = false;
            }
            else
            {
                MessageBox.Show("保存失败,请重试");
            }

            base.Save( );
        }
Exemplo n.º 4
0
        void GenerateContect ( )
        {
            _bll = new FishBll . Bll . PresaleRequisitionBll ( );
            result = _bll . Exists ( txtcode . Text );
            if ( result == true )
            {
                FishEntity . PresaleRequisitionHeadEntity _list = _bll . GetHeadList ( txtcode . Text );
                if ( _list == null )
                    return;
                headSetValue ( _list );
            }
            else
                MessageBox . Show ( "合同编号:" + txtcode . Text + "不存在,请核实" );

        }
Exemplo n.º 5
0
        public override int Query( )
        {
            UIForms.FormFishCondition _queryForm = new UIForms.FormFishCondition( );
            _queryForm.StartPosition = FormStartPosition.CenterParent;
            _queryForm.ShowInTaskbar = false;
            if (_queryForm.ShowDialog( ) != System.Windows.Forms.DialogResult.OK)
            {
                return(0);
            }
            string _where = _queryForm.GetWhere( );

            FishBll.Bll.PresaleRequisitionBll _bll  = new FishBll.Bll.PresaleRequisitionBll( );
            List <FishEntity.ProductEntity>   _list = _bll.getList(_where);

            dataGridView1.Rows.Clear( );
            foreach (FishEntity.ProductEntity ml in _list)
            {
                int             idx = dataGridView1.Rows.Add( );
                DataGridViewRow row = dataGridView1.Rows [idx];
                row.Cells ["code"].Value          = ml.code;
                row.Cells ["name"].Value          = ml.name;
                row.Cells ["specification"].Value = ml.specification;
                row.Cells ["brand"].Value         = ml.brand;
                row.Cells ["nature"].Value        = ml.nature;
                row.Cells["sgs_protein"].Value    = ml.sgs_protein;
                row.Cells["sgs_tvn"].Value        = ml.sgs_tvn;
                row.Cells["sgs_graypart"].Value   = ml.sgs_graypart;
                row.Cells["sgs_sandsalt"].Value   = ml.sgs_sandsalt;
                row.Cells["sgs_amine"].Value      = ml.sgs_amine;
                row.Cells["sgs_ffa"].Value        = ml.sgs_ffa;
                row.Cells["sgs_fat"].Value        = ml.sgs_fat;
                row.Cells["sgs_water"].Value      = ml.sgs_water;
                row.Cells["sgs_sand"].Value       = ml.sgs_sand;
                row.Cells["shipno"].Value         = ml.shipno;
                row.Cells["billofgoods"].Value    = ml.billofgoods;
                row.Cells["cornerno"].Value       = ml.cornerno;
                row.Cells["warehouse"].Value      = ml.warehouse;
            }


            return(base.Query( ));
        }
Exemplo n.º 6
0
        //生成合同号
        protected void codeNum( )
        {
            _model = new FishEntity.PresaleRequisitionHeadEntity( );
            _bll   = new FishBll.Bll.PresaleRequisitionBll( );
            DateTime dt = _bll.getDate( );

            _model.code = _bll.codeNum( );
            if (_model.code == string.Empty)
            {
                _model.code = "ZD" + dt.ToString("MMdd") + "0001";
            }
            else
            {
                if (_model.code.Substring(2, 4) == dt.ToString("MMdd"))
                {
                    _model.code = "ZD" + (Convert.ToInt64(_model.code.Substring(2, 8)) + 1).ToString( ).PadLeft(8, '0');
                }
                else
                {
                    _model.code = "ZD" + dt.ToString("MMdd") + "0001";
                }
            }
            txtcode.Text = _model.code;
        }