void bodySetValue(List <FishEntity.SalesRequisitionBodyEntity> modelList) { int i = 0; foreach (FishEntity.SalesRequisitionBodyEntity list in modelList) { int idx = dataGridView1.Rows.Add( ); DataGridViewRow row = dataGridView1.Rows [idx]; row.Cells ["product_id"].Value = list.product_id; row.Cells ["productname"].Value = list.productname; row.Cells ["Funit"].Value = list.Funit; row.Cells ["Variety"].Value = list.Variety; row.Cells ["Quantity"].Value = list.Quantity; row.Cells ["unitprice"].Value = list.unitprice; row.Cells ["Amonut"].Value = list.Amonut; i++; if (i > 1) { UILibrary.PresaleRControlSGS sgs = new UILibrary.PresaleRControlSGS( ); sgs.Location = new System.Drawing.Point(0, 118 * (i - 1)); panel2.Controls.Add(sgs); //sgs . Dock = System . Windows . Forms . DockStyle . Top; sgs.Visible = true; sgs.Name = sgs + i.ToString( ); sgs.setSaleValue(list, gnjc, setbool); } else { sgs1.setSaleValue(list, gnjc, setbool); } } }
void bodySetValue ( List<FishEntity . PresaleRequisitionBodyEntity> modelList ) { int i = 0; foreach ( FishEntity . PresaleRequisitionBodyEntity model in modelList ) { int idx = dataGridView1 . Rows . Add ( ); DataGridViewRow row = dataGridView1 . Rows [ idx ]; row . Cells [ "codeNum_tre" ] . Value = model . codeNum; row . Cells [ "yfId" ] . Value = model . yfId; row . Cells [ "yfName" ] . Value = model . yfName; row . Cells [ "yfUnit" ] . Value = model . yfUnit; row . Cells [ "yfVarieties" ] . Value = model . yfVarieties; row . Cells [ "yfNum" ] . Value = model . yfNum; row . Cells [ "yfPrice" ] . Value = model . yfPrice; row . Cells [ "weight" ] . Value = model . weight; i++; if ( i > 1 ) { UILibrary . PresaleRControlSGS sgs = new UILibrary . PresaleRControlSGS ( ); sgs . Location = new System . Drawing . Point ( 0 ,118 * (i - 1) ); panel2 . Controls . Add ( sgs ); //sgs . Dock = System . Windows . Forms . DockStyle . Top; sgs . Visible = true; sgs . Name = sgs + i . ToString ( ); sgs . setValue ( model ,gnjc ); } else { sgs1 . setValue ( model ,gnjc ); } } }