private void FillGridCustomSheet() { SheetDefs.RefreshCache(); SheetFieldDefs.RefreshCache(); //If from Dashboard Setup, populate when SheetDef is a Dashboard type. //If from normal Sheet window, populate all Sheets except Dashboard types. _listSheetDefs = SheetDefs.GetDeepCopy(false).FindAll(x => SheetDefs.IsDashboardType(x) == _isOpenedFromDashboardSetup); gridCustomSheet.BeginUpdate(); gridCustomSheet.ListGridColumns.Clear(); GridColumn col = new GridColumn(Lan.g("TableSheetDef", "Description"), 170); gridCustomSheet.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableSheetDef", "Type"), 100); gridCustomSheet.ListGridColumns.Add(col); gridCustomSheet.ListGridRows.Clear(); GridRow row; foreach (SheetDef sheetDef in _listSheetDefs) { row = new GridRow(); row.Cells.Add(sheetDef.Description); row.Cells.Add(sheetDef.SheetType.ToString()); gridCustomSheet.ListGridRows.Add(row); } gridCustomSheet.EndUpdate(); }
private void FillGridCustom(bool isSelectionMaintained = true, bool doRefreshCache = true) { if (doRefreshCache) { SheetDefs.RefreshCache(); SheetFieldDefs.RefreshCache(); } FillGrid(gridCustom, isSelectionMaintained, SheetDefs.GetCustomForType(SheetTypeEnum.PatientDashboardWidget).ToArray()); }
private void butTools_Click(object sender, EventArgs e) { FormSheetTools formSheetTools = new FormSheetTools(true); formSheetTools.ShowDialog(); if (formSheetTools.HasSheetsChanged) { SheetDefs.RefreshCache(); SheetFieldDefs.RefreshCache(); SheetDef sheetDefImported = SheetDefs.GetFirstOrDefault(x => x.SheetDefNum == formSheetTools.ImportedSheetDefNum); ToggleDashboardPermission(sheetDefImported, _listUserGroups.ToArray()); FillGridCustom(false, doRefreshCache: false); SelectDashboardDef(sheetDefImported); } }
private void RefreshAndFillGrids(long selectedSheetNum = -1) { #region Refresh both sheetDef lists SheetDefs.RefreshCache(); SheetFieldDefs.RefreshCache(); _listOtherSheetDefs = new List <SheetDef>() { SheetsInternal.GetSheetDef(SheetInternalType.ChartModule) }; //Must always be first in list. List <SheetDef> listCustomSheetDefs = SheetDefs.GetCustomForType(SheetTypeEnum.ChartModule); //_listOtherSheetDefs.AddRange(listCustomSheetDefs.FindAll(x => x.UserNum!=Security.CurUser.UserNum));//All other users. //_listCustomSheetDefs=listCustomSheetDefs.FindAll(x => x.UserNum==Security.CurUser.UserNum); #endregion FillGrid(gridOtherLayouts, _listOtherSheetDefs, selectedSheetNum); FillGrid(gridCustomLayouts, _listCustomSheetDefs, selectedSheetNum); }
/// <summary> /// Fills the Custom sheetDef grid. /// </summary> /// <param name="selectedSheetDefNum">The custom sheetDefNum that you would like to try and select after fill is complete</param> private void FillGrid2(long selectedSheetDefNum = -1) { SheetDefs.RefreshCache(); SheetFieldDefs.RefreshCache(); _listSheetDefs = SheetDefs.GetDeepCopy().FindAll(x => !SheetDefs.IsDashboardType(x)); grid2.BeginUpdate(); grid2.ListGridColumns.Clear(); grid2.ListGridColumns.Add(new GridColumn(Lan.g("TableSheetDef", "Description"), -1)); grid2.ListGridColumns.Add(new GridColumn(Lan.g("TableSheetDef", "Type"), 100)); grid2.ListGridColumns.Add(new GridColumn(Lan.g("TableSheetDef", "Use Mobile\r\nLayout"), 65, HorizontalAlignment.Center)); grid2.ListGridRows.Clear(); int selectedIndex = -1; foreach (SheetDef sheetDef in _listSheetDefs) { if (listFilter.SelectedItems.Count > 0 && !listFilter.GetListSelected <SheetTypeEnum>().Contains(sheetDef.SheetType)) { continue; } GridRow row = new GridRow(); row.Cells.Add(sheetDef.Description); row.Cells.Add(sheetDef.SheetType.ToString()); row.Cells.Add(sheetDef.HasMobileLayout?"X":""); row.Tag = sheetDef; if (selectedSheetDefNum == sheetDef.SheetDefNum) { selectedIndex = grid2.ListGridRows.Count; //Zero based index. } grid2.ListGridRows.Add(row); } grid2.EndUpdate(); if (selectedIndex != -1) { try { grid2.SetSelected(selectedIndex, true); } catch (Exception ex) { ex.DoNothing(); } } }
private void FillFieldList() { listAvailFields.Sorted = true; //will alphabetize, since we are adding either FieldName,ReportableName, or RadioButtonGroup depending on field type listAvailFields.Items.Clear(); //Add exam sheet fields to the list List <SheetFieldDef> availFields = SheetFieldDefs.GetForExamSheet(AvailExamDefs[listExamSheets.SelectedIndex].SheetDefNum); for (int i = 0; i < availFields.Count; i++) { if (availFields[i].FieldName == "") { continue; } if (availFields[i].FieldName != "misc") //This is an internally defined field { listAvailFields.Items.Add(availFields[i].FieldName); continue; } //misc: if (availFields[i].RadioButtonGroup != "") //Only gets set if field is a 'misc' check box and assigned to a group { if (listAvailFields.Items.Contains(availFields[i].RadioButtonGroup)) { continue; } else { listAvailFields.Items.Add(availFields[i].RadioButtonGroup); continue; } } if (availFields[i].ReportableName != "") //Not internal type or part of a RadioButtonGroup so just add the reportable name if available { listAvailFields.Items.Add(availFields[i].ReportableName); continue; } } }
private void FillGrid2() { SheetDefs.RefreshCache(); SheetFieldDefs.RefreshCache(); grid2.BeginUpdate(); grid2.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableSheetDef", "Description"), 170); grid2.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSheetDef", "Type"), 100); grid2.Columns.Add(col); grid2.Rows.Clear(); ODGridRow row; for (int i = 0; i < SheetDefC.Listt.Count; i++) { row = new ODGridRow(); row.Cells.Add(SheetDefC.Listt[i].Description); row.Cells.Add(SheetDefC.Listt[i].SheetType.ToString()); grid2.Rows.Add(row); } grid2.EndUpdate(); }
private void FillGridCustomSheet() { SheetDefs.RefreshCache(); SheetFieldDefs.RefreshCache(); _listSheetDefs = SheetDefs.GetDeepCopy(false); gridCustomSheet.BeginUpdate(); gridCustomSheet.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableSheetDef", "Description"), 170); gridCustomSheet.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSheetDef", "Type"), 100); gridCustomSheet.Columns.Add(col); gridCustomSheet.Rows.Clear(); ODGridRow row; foreach (SheetDef sheetDef in _listSheetDefs) { row = new ODGridRow(); row.Cells.Add(sheetDef.Description); row.Cells.Add(sheetDef.SheetType.ToString()); gridCustomSheet.Rows.Add(row); } gridCustomSheet.EndUpdate(); }