public NoOverdue(DataSet dsOverdue) { InitializeComponent(); ControlForm kontrol = new ControlForm(); PictureBox[] listPbox = { pictureBox1, pictureBox2, pictureBox3, pictureBox4, pictureBox5 }; int counter = 0; loadLowStock(ref counter, listPbox, dsOverdue); if (counter == 0) { loadOutofStock(ref counter, listPbox, dsOverdue); } }
private void loadLowStock(ref int counter, PictureBox[] listPbox, DataSet dsOverdue) { ControlForm kontrol = new ControlForm(); for (int i = 0; i < dsOverdue.Tables["LowStock"].Rows.Count && counter <= 4; i++) { string id = dsOverdue.Tables["LowStock"].Rows[i]["BookId"].ToString(); string[] thumbnailList = dsOverdue.Tables["LowStock"].Rows[i]["PicturePath"].ToString().Split('|'); int stock = Convert.ToInt32(dsOverdue.Tables["LowStock"].Rows[i]["Stock"]); if (stock > 0) { kontrol.setFotoBuku(listPbox[counter], thumbnailList[0]); counter += 1; listId.Add(id); } } }