/// <summary> /// Populates the items. /// </summary> void PopulateItems(DateTime issueDate, bool parForce = true) { try { TimeSpan difference = issueDate - Convert.ToDateTime(Application["AppCurrentDate"]); double days = difference.TotalDays; if (days <= 0) { if (parForce || base.Session[this.Session_Key] == null) { IConsumable _consumablemManager = (IConsumable)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BConsumable, BusinessProcess.Clinical"); this.dtData = _consumablemManager.GetPatientConsumableByDate(this.PatientID, issueDate); dtData.TableName = "Consumables"; } else { this.dtData = (DataTable)Session[this.Session_Key]; } } this.BindGrid(); } catch (Exception ex) { isError = true; showErrorMessage(ref ex); } }