private void SetVisibleColumns_MasterMonthlyOperation(ComponentArt.Web.UI.Grid grid) { MonthlyOperationGridClientSettings monthlyOperationGridClientSettings = this.MonthlyOperationGridClientSettingsBusiness.GetMonthlyOperationGridClientSettings(); GridColumnCollection Gcc = grid.Levels[0].Columns; for (int i = 1; i < Gcc.Count; i++) { PropertyInfo PInfo = typeof(MonthlyOperationGridClientSettings).GetProperty(Gcc[i].DataField); if (PInfo != null) { Gcc[i].Visible = (bool)PInfo.GetValue(monthlyOperationGridClientSettings, null); } } }
private void SetReserveFieldsHeaderColumnsCaption_MasterMonthlyOperation(ComponentArt.Web.UI.Grid grid) { BPersonMonthlyWorkedTime MonthlyOperationBusiness = new BPersonMonthlyWorkedTime(0); GridColumnCollection Gcc = grid.Levels[0].Columns; IDictionary <ConceptReservedFields, string> ConceptsReservedFieldsReservedFieldsDic = MonthlyOperationBusiness.GetReservedFieldsNames(); foreach (string conceptReservedFieldName in Enum.GetNames(typeof(ConceptReservedFields))) { for (int i = 0; i < Gcc.Count; i++) { if (Gcc[i].DataField == conceptReservedFieldName) { //Gcc[i].HeadingText = MonthlyOperationBusiness.GetReservedFieldsName((ConceptReservedFields)Enum.Parse(typeof(ConceptReservedFields), conceptReservedFieldName)); Gcc[i].HeadingText = ConceptsReservedFieldsReservedFieldsDic[(ConceptReservedFields)Enum.Parse(typeof(ConceptReservedFields), conceptReservedFieldName)]; break; } } } }
private void BuildGrid_UpdateCalculationResult(ComponentArt.Web.UI.Grid grid) { IList <ArchiveFieldMap> ArchiveFieldMapList = this.UpdateCalculationResultBusiness.GetArchiveGridSettings(); GridColumnCollection Gcc = grid.Levels[0].Columns; for (int i = 5; i < Gcc.Count - 1; i++) { ArchiveFieldMap archiveFieldMap = ArchiveFieldMapList.Where(afm => afm.PId.ToLower() == Gcc[i].DataField.ToLower()).FirstOrDefault(); if (archiveFieldMap != null) { Gcc[i].Visible = archiveFieldMap.Visible; Gcc[i].HeadingText = archiveFieldMap.Title; Gcc[i].Width = archiveFieldMap.ColumnSize; } else { Gcc[i].Visible = false; } } }
private void BuildGrid_MasterMonthlyOperation(ComponentArt.Web.UI.Grid grid) { this.SetGridColumnsSize_MasterMonthlyOperation(grid); this.SetVisibleColumns_MasterMonthlyOperation(grid); this.SetReserveFieldsHeaderColumnsCaption_MasterMonthlyOperation(grid); }