private void FillGrid() { ScreenList = Screens.Refresh(ScreenGroupCur.ScreenGroupNum); ListViewItem[] items = new ListViewItem[ScreenList.Length]; for (int i = 0; i < items.Length; i++) { items[i] = new ListViewItem(ScreenList[i].ScreenGroupOrder.ToString()); items[i].SubItems.Add(ScreenList[i].GradeLevel.ToString()); if (ScreenList[i].Age == 0) { items[i].SubItems.Add(""); } else { items[i].SubItems.Add(ScreenList[i].Age.ToString()); } items[i].SubItems.Add(ScreenList[i].Race.ToString()); items[i].SubItems.Add(ScreenList[i].Gender.ToString()); items[i].SubItems.Add(ScreenList[i].Urgency.ToString()); items[i].SubItems.Add(getX(ScreenList[i].HasCaries)); items[i].SubItems.Add(getX(ScreenList[i].EarlyChildCaries)); items[i].SubItems.Add(getX(ScreenList[i].CariesExperience)); items[i].SubItems.Add(getX(ScreenList[i].ExistingSealants)); items[i].SubItems.Add(getX(ScreenList[i].NeedsSealants)); items[i].SubItems.Add(getX(ScreenList[i].MissingAllTeeth)); items[i].SubItems.Add(ScreenList[i].Comments); } listMain.Items.Clear(); listMain.Items.AddRange(items); }
private void FillGrid() { ScreenList = Screens.Refresh(ScreenGroupCur.ScreenGroupNum); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col; col = new ODGridColumn(Lan.g(this, "#"), 30); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Grade"), 55); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Age"), 40); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Race"), 60); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Sex"), 40); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Urgency"), 55); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Caries"), 45); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "ECC"), 50); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "CarExp"), 50); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "ExSeal"), 50); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "NeedSeal"), 60); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "NoTeeth"), 60); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Comments"), 100); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; for (int i = 0; i < ScreenList.Length; i++) { row = new ODGridRow(); row.Cells.Add(ScreenList[i].ScreenGroupOrder.ToString()); row.Cells.Add(ScreenList[i].GradeLevel.ToString()); row.Cells.Add(ScreenList[i].Age.ToString()); row.Cells.Add(ScreenList[i].Race.ToString()); row.Cells.Add(ScreenList[i].Gender.ToString()); row.Cells.Add(ScreenList[i].Urgency.ToString()); row.Cells.Add(getX(ScreenList[i].HasCaries)); row.Cells.Add(getX(ScreenList[i].EarlyChildCaries)); row.Cells.Add(getX(ScreenList[i].CariesExperience)); row.Cells.Add(getX(ScreenList[i].ExistingSealants)); row.Cells.Add(getX(ScreenList[i].NeedsSealants)); row.Cells.Add(getX(ScreenList[i].MissingAllTeeth)); row.Cells.Add(ScreenList[i].Comments); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
private void butDelete_Click(object sender, System.EventArgs e) { if (gridMain.SelectedIndices.Length != 1) { MessageBox.Show("Please select one item first."); return; } ScreenGroupCur = ScreenGroupList[gridMain.GetSelectedIndex()]; OpenDentBusiness.Screen[] screenList = Screens.Refresh(ScreenGroupCur.ScreenGroupNum); if (screenList.Length > 0) { MessageBox.Show("Not allowed to delete a screening group with items in it."); return; } ScreenGroups.Delete(ScreenGroupCur); FillGrid(); }
private void butDelete_Click(object sender, System.EventArgs e) { if (listMain.SelectedIndices.Count != 1) { MessageBox.Show("Please select one item first."); return; } ScreenGroup ScreenGroupCur = ScreenGroups.List[listMain.SelectedIndices[0]]; Screens.Refresh(ScreenGroupCur.ScreenGroupNum); if (Screens.List.Length > 0) { MessageBox.Show("Not allowed to delete a screening group with items in it."); return; } ScreenGroups.Delete(ScreenGroupCur); FillGrid(); }