private void LoadPendingGRN() { string TrackingNo = Session["GRNID"].ToString(); //TODO Warehouse from security manager. Guid warehouseId = UserBLL.GetCurrentWarehouse(); List <GRNBLL> list = new List <GRNBLL>(); GRNBLL objGRN = new GRNBLL(); list = objGRN.GetPendingGRNByTrackingNo(warehouseId, TrackingNo); if (list != null) { if (list.Count == 1) { this.cboGradingCode.Items.Add(new ListItem(list[0].GradingCode.ToString(), list[0].GradingId.ToString())); this.cboGradingCode.SelectedValue = list[0].GradingId.ToString(); } else if (list.Count == 1) { this.lblmsg.Text = "An error has occred please contact the administrator."; return; } else { this.lblmsg.Text = "No Pending records"; return; } } else { this.lblmsg.Text = "No Pending records"; return; } }