Exemplo n.º 1
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex < 0 || e.RowIndex < 0)
            {
                return;
            }
            if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("fishId1", StringComparison.OrdinalIgnoreCase))
            {
                FormNewSelfcontrolWare form = new FormNewSelfcontrolWare( );
                if (form.ShowDialog( ) == DialogResult.OK)
                {
                    _models = form.getModel;
                    int idx = dataGridView1.Rows.Add( );
                    dataGridView1.Rows [idx].Cells ["fishId1"].Value         = _models.fishId;
                    dataGridView1.Rows [idx].Cells ["codeNum"].Value         = _models.codeNum;
                    dataGridView1.Rows [idx].Cells ["codeNumContract"].Value = _models.codeNumContract;
                    dataGridView1.Rows[idx].Cells["qualitySpe"].Value        = _models.qualitySpe;
                    dataGridView1.Rows [idx].Cells ["country"].Value         = _models.country;
                    dataGridView1.Rows[idx].Cells["price"].Value             = _models.price;
                    dataGridView1.Rows [idx].Cells ["brand"].Value           = _models.brand;
                    dataGridView1.Rows [idx].Cells ["protein"].Value         = _models.protein;
                    dataGridView1.Rows [idx].Cells ["tvn"].Value             = _models.tvn;
                    dataGridView1.Rows [idx].Cells ["salt"].Value            = _models.salt;
                    dataGridView1.Rows [idx].Cells ["acid"].Value            = _models.acid;
                    dataGridView1.Rows [idx].Cells ["ash"].Value             = _models.ash;
                    dataGridView1.Rows [idx].Cells ["histamine"].Value       = _models.histamine;
                    dataGridView1.Rows [idx].Cells ["las"].Value             = _models.las;
                    dataGridView1.Rows [idx].Cells ["das"].Value             = _models.das;
                    dataGridView1.Rows [idx].Cells ["tons"].Value            = _models.tons;
                    dataGridView1.Rows [idx].Cells ["rkCode"].Value          = _models.rkCode;

                    dataGridView1.Rows[idx].Cells["goods"].Value = "鱼粉";

                    setValueToSum( );
                }
            }
        }
Exemplo n.º 2
0
        private void fishId_DoubleClick(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtdataForm.Text))
            {
                MessageBox.Show("请选择数据来源");
                return;
            }

            if (txtdataForm.Text.Equals("自制仓库"))
            {
                FormNewSelfcontrolWare form = new FormNewSelfcontrolWare( );//FormSelfcontrolWare
                if (form.ShowDialog( ) == DialogResult.OK)
                {
                    FishEntity.BatchSheetsEntity _model = form.getModel;
                    fishId.Text     = _model.fishId;
                    price.Text      = _model.price.ToString( );
                    tvn.Text        = _model.tvn;
                    protein.Text    = _model.protein;
                    ash.Text        = _model.ash;
                    histamine.Text  = _model.histamine;
                    salt.Text       = _model.salt;
                    las.Text        = _model.las;
                    das.Text        = _model.das;
                    country.Text    = _model.country;
                    qualitySpe.Text = _model.qualitySpe;
                    brand.Text      = _model.brand;
                }
            }
            else if (txtdataForm.Text.Equals("自营仓库"))
            {
                FormNewPriWarehouse form = new FormNewPriWarehouse();//
                if (form.ShowDialog() == DialogResult.OK)
                {
                    FishEntity.ProductQuoteVo _model = form.getModel;
                    fishId.Text     = _model.code;
                    price.Text      = _model.confirmrmb.ToString();
                    tvn.Text        = _model.sgs_tvn.ToString();
                    protein.Text    = _model.sgs_protein.ToString();
                    ash.Text        = _model.sgs_graypart.ToString();
                    histamine.Text  = _model.sgs_amine.ToString();
                    FFA.Text        = _model.sgs_ffa.ToString();;
                    salt.Text       = _model.domestic_sandsalt.ToString();
                    las.Text        = _model.domestic_lysine.ToString();
                    das.Text        = _model.domestic_methionine.ToString();
                    qualitySpe.Text = _model.specification;
                    country.Text    = _model.nature;
                    brand.Text      = _model.brand;
                }
            }
            else if (txtdataForm.Text.Equals("报盘"))
            {
                FormQuote form = new FormQuote();//
                if (form.ShowDialog() == DialogResult.OK)
                {
                    FishEntity.ProductQuoteVo _model = form.getModel;
                    fishId.Text     = _model.code;
                    tvn.Text        = _model.quote_tvn.ToString();
                    protein.Text    = _model.quote_protein.ToString();
                    ash.Text        = _model.quote_graypart.ToString();
                    histamine.Text  = _model.quote_amine.ToString();
                    FFA.Text        = _model.quote_ffa.ToString();;
                    salt.Text       = _model.quote_sandsalt.ToString();
                    qualitySpe.Text = _model.specification;
                    brand.Text      = _model.brand;
                    country.Text    = _model.nature;
                }
            }
            else if (txtdataForm.Text.Equals("现货"))
            {
                FormSpot form = new FormSpot();//
                if (form.ShowDialog() == DialogResult.OK)
                {
                    FishEntity.ProductQuoteVo _model = form.getModel;
                    fishId.Text     = _model.code;
                    price.Text      = _model.quotermb.ToString();
                    tvn.Text        = _model.sgs_tvn.ToString();
                    protein.Text    = _model.sgs_protein.ToString();
                    ash.Text        = _model.sgs_graypart.ToString();
                    histamine.Text  = _model.sgs_amine.ToString();
                    FFA.Text        = _model.sgs_ffa.ToString();;
                    salt.Text       = _model.sgs_sandsalt.ToString();
                    qualitySpe.Text = _model.specification;
                    brand.Text      = _model.brand;
                    country.Text    = _model.nature;
                }
            }
            else if (txtdataForm.Text.Equals("确盘"))
            {
                FormConfirm form = new FormConfirm();//
                if (form.ShowDialog() == DialogResult.OK)
                {
                    FishEntity.ProductQuoteVo _model = form.getModel;
                    fishId.Text     = _model.code;
                    price.Text      = _model.quotermb.ToString();
                    tvn.Text        = _model.quote_tvn.ToString();
                    protein.Text    = _model.quote_protein.ToString();
                    ash.Text        = _model.quote_graypart.ToString();
                    histamine.Text  = _model.quote_amine.ToString();
                    FFA.Text        = _model.quote_ffa.ToString();;
                    salt.Text       = _model.quote_sandsalt.ToString();
                    qualitySpe.Text = _model.specification;
                    brand.Text      = _model.brand;
                    country.Text    = _model.nature;
                }
            }
        }