private void LoadBoxIdListFromMasterBillId(int masterBillId, ComboBox cbbBoxes) { if (masterBillId <= 0) { return; } List <BoxOutEntity> listBoxOut = _repositoryShipment.GetBoxIdByMasterBillid(masterBillId); if (listBoxOut != null && listBoxOut.Count > 0) { cbbBoxes.DataSource = listBoxOut; cbbBoxes.ValueMember = "Id"; cbbBoxes.DisplayMember = "BoxId"; } else { cbbBoxes.DataSource = null; cbbBoxes.Items.Clear(); } }