private void txtlistname_Click(object sender, EventArgs e) { FormSetPresaleRequisiton from = new FormSetPresaleRequisiton("鱼粉查询"); DialogResult result = from.ShowDialog(); if (result == DialogResult.OK) { txtlistname.Text = from.getPerson.billofgoods; txtferryname.Text = from.getPerson.shipno; txtwarehouse.Text = from.getPerson.warehouse; txtcornerno.Text = from.getPerson.cornerno; } }
// private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex < 0 || e.RowIndex < 0) { return; } if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("yfId", StringComparison.OrdinalIgnoreCase) == true) { FormSetPresaleRequisiton from = new FormSetPresaleRequisiton("预售采购申请单鱼粉查询"); DialogResult result = from.ShowDialog( ); if (result == DialogResult.OK) { bool isOk = true; FishEntity.ProductEntity _model = from.getPerson; for (int i = 0; i < dataGridView1.Rows.Count - 1; i++) { if (!string.IsNullOrEmpty(dataGridView1.Rows [i].Cells ["yfId"].Value.ToString( )) && dataGridView1.Rows [i].Cells ["yfId"].Value.ToString( ) == _model.code) { if (i != e.RowIndex) { isOk = false; break; } } } if (isOk == false) { return; } dataGridView1.Rows [e.RowIndex].Cells ["yfId"].Value = _model.code; dataGridView1.Rows [e.RowIndex].Cells ["yfName"].Value = _model.name; dataGridView1.Rows [e.RowIndex].Cells ["yfVarieties"].Value = _model.specification; dataGridView1.Rows [e.RowIndex].Cells ["yfUnit"].Value = _model.nature + _model.specification; dataGridView2.Rows[e.RowIndex].Cells["yfdb"].Value = _model.sgs_protein; dataGridView2.Rows[e.RowIndex].Cells["yftvn"].Value = _model.sgs_tvn; //dataGridView2.Rows[e.RowIndex].Cells["sgs_graypart"].Value = _model.sgs_graypart; dataGridView2.Rows[e.RowIndex].Cells["yfshy"].Value = _model.sgs_sandsalt; dataGridView2.Rows[e.RowIndex].Cells["yfza"].Value = _model.sgs_amine; dataGridView2.Rows[e.RowIndex].Cells["yfffa"].Value = _model.sgs_ffa; dataGridView2.Rows[e.RowIndex].Cells["yfzf"].Value = _model.sgs_fat; dataGridView2.Rows[e.RowIndex].Cells["yfsf"].Value = _model.sgs_water; dataGridView2.Rows[e.RowIndex].Cells["yfs"].Value = _model.sgs_sand; dataGridView2.Rows [e.RowIndex].Cells ["yfId_one"].Value = _model.code; dataGridView3.Rows [e.RowIndex].Cells ["yfId_tre"].Value = _model.code; dataGridView4.Rows [e.RowIndex].Cells ["yfId_for"].Value = _model.code; //dataGridView4 . Rows [ e . RowIndex ] . Cells [ "yfpp" ] . Value = _model . brand; } } if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("yfName", StringComparison.OrdinalIgnoreCase) == true) { _list = new FishEntity.ReceiptRecordEntity( ); _list.codeHuiKou = string.IsNullOrEmpty(texrebate.Text) == true ? 0 : Convert.ToDecimal(texrebate.Text); _list.codeOfYu = txtcode.Text; _list.codePrice = string.IsNullOrEmpty(dataGridView1.Rows [e.RowIndex].Cells ["yfPrice"].Value.ToString( )) == true ? 0 : Convert.ToDecimal(dataGridView1.Rows [e.RowIndex].Cells ["yfPrice"].Value.ToString( )); _list.codeYunFei = string.IsNullOrEmpty(texFreight.Text) == true ? 0 : Convert.ToDecimal(texFreight.Text); this.DialogResult = DialogResult.OK; } }