private void LoadDataToGridView() { this.dgvBookStatus.Rows.Clear(); BookStatusBLL bookStatusBLL = new BookStatusBLL(); List <BookStatusBLL> bookStatusArr = new List <BookStatusBLL>(); bookStatusArr = BookStatusDAL.getBookStatusList(); foreach (BookStatusBLL row in bookStatusArr) { this.dgvBookStatus.Rows.Add(row.BookStatusId, row.Name); } this.GetSelectedValue(); this.dgvBookStatus.CellClick += new DataGridViewCellEventHandler(dgvBookStatus_CellClick); }
public List <ComboboxItem> getComboboxItemBookStatus() { List <BookStatusBLL> bookStatusList = new List <BookStatusBLL>(); bookStatusList = BookStatusDAL.getBookStatusList(); List <ComboboxItem> comboboxItemList = new List <ComboboxItem>(); for (int i = 0; i < bookStatusList.Count; i++) { ComboboxItem item = new ComboboxItem(); item.Value = bookStatusList[i].BookStatusId; item.Text = bookStatusList[i].Name; comboboxItemList.Add(item); } return(comboboxItemList); }