private void RefreshDailyAssignWorkerDetailList(int did, int sessionid) { lst_nozzels.Clear(); DailyAssignWorkerDetailList.Clear(); DailyAssignWorkerDetailList = CustomeRepository.GetDailyAssignWorkerDetails(did, sessionid).ToList(); foreach (var item in DailyAssignWorkerDetailList) { string empname = ""; string activetext = ""; ListViewItem itm = new ListViewItem(); if (item.IsOpen) { activetext = "Open"; itm.ImageIndex = 0; if (string.IsNullOrEmpty(item.EmployeeName)) { empname = "Not Assigned"; } else { empname = item.EmployeeName; } } else { activetext = "Closed"; itm.ImageIndex = 1; } string name = item.NozzelName + Environment.NewLine + empname + Environment.NewLine + activetext; itm.Text = name; itm.Tag = item; lst_nozzels.Items.Add(itm); } }