/// <summary> /// Initializes a new instance of the <see cref="EdFiGridModel"/> class. /// </summary> public EdFiGridModel() { EntityIds = new List<StudentSchoolIdentifier>(); GridTable = new GridTable(); ListMetadata = new List<MetadataColumnGroup>(); Students = new List<StudentWithMetricsAndAccommodations>(); }
public ViewResult Get(int schoolId, int localEducationAgencyId) { var model = service.Get(new StaffRequest() { SchoolId = schoolId }); var gridTable = new GridTable(); var metadata = listMetadataProvider.GetListMetadata(metadataListIdResolver.GetListId(ListType.Staff, schoolCategoryProvider.GetSchoolCategoryType(schoolId))); gridTable.Columns = metadata.GenerateHeader(); gridTable.Rows = metadata.GenerateRows(model.Staff, schoolId); return View(gridTable); }
public ActionResult Get(EdFiDashboardContext context) { //IList<SchoolMetricModel> schoolMetrics = service.Get(new SchoolMetricTableRequest() { MetricVariantId = context.MetricVariantId.GetValueOrDefault(), LocalEducationAgencyId = context.LocalEducationAgencyId.GetValueOrDefault() }); SchoolMetricTableModel schoolMetrics = service.Get(new SchoolMetricTableRequest() { MetricVariantId = context.MetricVariantId.GetValueOrDefault(), LocalEducationAgencyId = context.LocalEducationAgencyId.GetValueOrDefault() }); var model = new GridTable { MetricVariantId = context.MetricVariantId.GetValueOrDefault(), Columns = schoolMetrics.ListMetadata.GenerateHeader(), Rows = schoolMetrics.ListMetadata.GenerateRows(schoolMetrics.SchoolMetrics) }; return View(model); }
//Used to setup the cell-specific formatting information private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e) { switch (e.TableCellIdentity.TableCellType) { case GridTableCellType.RecordPreviewCell: { GridGroupingControl groupingControl = (GridGroupingControl)sender; GridTable table = groupingControl.Table; GridRecord record = (GridRecord)e.TableCellIdentity.DisplayElement.ParentRecord; e.Style.CellValue = record.GetValue("Notes").ToString(); break; } case GridTableCellType.AlternateRecordFieldCell: case GridTableCellType.AddNewRecordFieldCell: case GridTableCellType.RecordFieldCell: { GridTable table = e.TableCellIdentity.Table; string tableName = table.TableDescriptor.Name; GridRecord record = (GridRecord)e.TableCellIdentity.DisplayElement.ParentRecord; object recordkey = record.PrimaryKeys[0]; string fieldName = e.TableCellIdentity.Column.MappingName; GridStyleInfo style = GetCellStyle(tableName, recordkey, fieldName); if (style != null) { e.Style.ModifyStyle(style, Syncfusion.Styles.StyleModifyType.Override); } break; } } StringBuilder sb = new StringBuilder(); sb.Append(e.TableCellIdentity.Info); if (e.Style != null) { sb.AppendFormat("\r\nCellType = {0}", e.Style.CellType); sb.AppendFormat(", CellValueType = {0}", e.Style.CellValueType); sb.AppendFormat(", nFormat = \"{0}\"", e.Style.Format); sb.AppendFormat(", CellValue = \"{0}\"", e.Style.CellValue); sb.AppendFormat(", ImageSizeMode = \"{0}\"", e.Style.ImageSizeMode); } e.Style.CellTipText = sb.ToString(); }
public virtual JsonResult Listar(GridTable grid) { try { grid.page = (grid.page == 0) ? 1 : grid.page; grid.rows = (grid.rows == 0) ? 100 : grid.rows; var where = (Utils.GetWhere(grid.filters, grid.rules)); if (!string.IsNullOrEmpty(where)) { grid._search = true; if (!string.IsNullOrEmpty(grid.searchString)) { where = where + " and "; } } var generic = Listar(CentroCostoBL.Instancia, grid.sidx, grid.sord, grid.page, grid.rows, grid._search, grid.searchField, grid.searchOper, grid.searchString, where); generic.Value.rows = generic.List .Select(item => new Row { id = item.IDCentroCosto, cell = new[] { item.IDCentroCosto.ToString(), item.CCO_Codigo, item.CCO_Nombre, item.CCO_Descripcion, item.NombreEstado } }).ToArray(); return Json(generic.Value); } catch (Exception ex) { logger.Error(string.Format("Mensaje: {0} Trace: {1}", ex.Message, ex.StackTrace)); return MensajeError(); } }
/// <summary> /// sinh các detail table nằm trong tab /// </summary> public void GenerateDetailTable() { Ext.Net.TabPanel tab = new TabPanel(); tab.Border = false; tab.ID = this.ID + "TabPanel"; tab.AnchorHorizontal = "100%"; tab.Height = 170; tab.EnableTabScroll = true; tab.Plugins.Add(new TabScrollerMenu() { PageSize = 30, Width = new Unit(500), }); List <OneManyFormInfo> rs = OneManyFormController.GetInstance() .GetAll(this.GridPanelName + "OneManyForm", 1); int count = 0; foreach (OneManyFormInfo item in rs) { Control ct = this.Page.LoadControl("../Base/MiniGridPanel/MiniGrid.ascx"); ct.ID = this.GridPanelName + "_OneManyForm_" + item.TableName; //Tên của Grid được lưu trong CSDL GridTable gridTable = ct as GridTable; gridTable.Height = 150; gridTable.Width = OneManyForm.Width; //gridTable gridTable.OutSideQuery = item.ForeignKey; count++; Ext.Net.Panel panel = new Ext.Net.Panel(count + "." + item.Title); panel.ID = "pnl" + item.TableName; panel.AnchorHorizontal = "100%"; panel.Border = false; Ext.Net.Container c = new Container(); c.AnchorHorizontal = "100%"; c.Height = 160; c.Layout = "Form"; c.ContentControls.Add(ct); // c.Items.Add(gridTable.GetGridPanel()); panel.Items.Add(c); tab.Items.Add(panel); } OneManyForm.AddDetailTable(tab, this.GridPanelName + "OneManyForm"); }
public JsonResult Listar(GridTable gridTable) { return ListarJqGrid(new ListParameter<Usuario, UsuarioDto> { BusinessLogicClass = _usuarioBl, Grid = gridTable, SelecctionFormat = p => new UsuarioDto { Id = p.Id, UserName = p.UserName, Email = p.Email, Nombre = p.Nombre, Apellido = p.Apellido, RolNombre = p.Rol.Nombre, Estado = p.Estado } }); }
private void SampleCustomization() { //creating new relation GridRelationDescriptor relation = new GridRelationDescriptor(); //Setting relationKind as UniformChileList. relation.RelationKind = RelationKind.UniformChildList; relation.MappingName = "Child"; relation.Name = "Child"; relation.ChildTableName = "ChildTable"; grid.TableDescriptor.Relations.Add(relation); this.grid.ShowGroupDropArea = true; GridTable chiltTable = grid.GetTable("ChildTable"); this.grid.AddGroupDropArea(chiltTable); chiltTable.TableDescriptor.GroupedColumns.Add("Field1"); }
public ActionResult Get(EdFiDashboardContext context) { IList<SchoolPriorYearMetricModel> schoolMetrics = service.Get(new SchoolPriorYearMetricTableRequest() { MetricVariantId = context.MetricVariantId.GetValueOrDefault(), LocalEducationAgencyId = context.LocalEducationAgencyId.GetValueOrDefault() }); var resolvedListId = metadataListIdResolver.GetListId(ListType.PriorYearSchoolMetricTable, SchoolCategory.None); var columnGroups = listMetadataProvider.GetListMetadata(resolvedListId); var model = new GridTable { MetricVariantId = context.MetricVariantId.GetValueOrDefault(), Columns = columnGroups.GenerateHeader(), Rows = columnGroups.GenerateRows((List<SchoolPriorYearMetricModel>)schoolMetrics) }; return View(model); }
/// <summary> /// 增加各科成绩预测内容行 /// </summary> /// <param name="tb"></param> /// <param name="entity"></param> private void CreateExamStatisticRow(GridTable tb) { var entity = CreateEntityTable(); for (int i = 0; i < entity.Count; i++) { var tr = tb.NewRow(); tr[0].Text = entity[i].CourseShortName; tr[1].Text = entity[i].PredictionScoreDisplay; tr[2].Text = entity[i].PointsToGainDisplay; tr.DefaultBackgroundColor = i % 2 == 0 ? Color.FromArgb(219, 228, 233) : Color.White; tr.DefaultForegroundColor = Color.FromArgb(107, 109, 111); tr.DefaultFontSize = 10; tr.RowHeight = 32; tr.DefaultCellAlign = CellAlign.Center; tb.AddRow(tr); } }
private void FillUpdateGrid() { var srcgrid = new GridTable(m_srcInfo.GetTableStructure(SynQueryType.SelectAll), ""); var dstgrid = new GridTable(m_dstInfo.GetTableStructure(SynQueryType.SelectAll), ""); try { m_gridSourceConn.Connection.Invoke(() => { FillGridTable(m_updates, srcgrid, m_gridSourceConn, m_srcSada, m_srcInfo); }); m_gridTargetConn.Connection.Invoke(() => { FillGridTable(m_updates, dstgrid, m_gridTargetConn, m_dstSada, m_dstInfo); }); var upgrid = m_gridFills[(int)SynTableData.Modified]; upgrid.Fill(EnumUpgradeGridRows(srcgrid, dstgrid, upgrid.GetStructure(null))); } finally { srcgrid.CloseView(); dstgrid.CloseView(); } }
private IEnumerable <IBedRecord> EnumUpgradeGridRows(GridTable srcgrid, GridTable dstgrid, ITableStructure ts) { var ensrc = srcgrid.EnumRows(new TableDataSetProperties()).GetEnumerator(); var endst = dstgrid.EnumRows(new TableDataSetProperties()).GetEnumerator(); var holder = new BedValueHolder(); for (; ;) { if (!ensrc.MoveNext()) { break; } if (!endst.MoveNext()) { break; } var newrec = new ArrayDataRecord(ts); for (int i = 0; i < m_srcInfo.KeyCols.Length; i++) { newrec.SeekValue(i); ensrc.Current.ReadValue(i); ensrc.Current.WriteTo(newrec); } for (int i = 0; i < m_srcInfo.DataCols.Length; i++) { newrec.SeekValue(m_srcInfo.KeyCols.Length + i); ensrc.Current.ReadValue(m_srcInfo.KeyCols.Length + i); ensrc.Current.WriteTo(newrec); } for (int i = 0; i < m_dstInfo.DataCols.Length; i++) { newrec.SeekValue(m_srcInfo.KeyCols.Length + m_srcInfo.DataCols.Length + i); endst.Current.ReadValue(m_srcInfo.KeyCols.Length + i); endst.Current.WriteTo(newrec); } yield return(newrec); } }
public JsonResult Add(GridTable gt) { using (SqlSugarClient db = SugarDao.GetInstance()) { string message = string.Empty; var isValid = ValidationSugar.PostValidation("validate_key_grid_index", out message); ActionResultModel <string> model = new ActionResultModel <string>(); if (isValid)//后台验证数据完整性 { model.isSuccess = db.Insert(gt) != DBNull.Value; model.responseInfo = model.isSuccess ? "添加成功" : "添加失败"; } else { model.isSuccess = false; model.responseInfo = message; } return(Json(model)); } }
private void L3PageLoaded(object sender, RoutedEventArgs e) { GridTable.InputNumber288("n0", false, false, COL_TotalMoney); GridTable.SetDefaultFilterChangeGrid(); L3Control.SetShortcutPopupMenu(MainMenuControl); try { if (dt.Rows.Count == 0) { LoadSimple(); SetTimer(); } bLoaded = true; } catch (SqlException) { System.Windows.MessageBox.Show("Lỗi!"); bLoaded = false; } }
private void cmTable_Loaded(object sender, RoutedEventArgs e) { mnsNew.IsEnabled = false; mnsPay.IsEnabled = true; if (Convert.ToInt32(GridTable.GetFocusedRowCellValue("Status")) == 0) { mnsPay.IsEnabled = false; } if (Convert.ToInt32(GridTable.GetFocusedRowCellValue("Status")) == 2) { mnsNew.IsEnabled = true; mnsPay.IsEnabled = false; mnsAdd.IsEnabled = false; } if (Convert.ToInt32(GridTable.GetFocusedRowCellValue("Status")) == 1 && Convert.ToDecimal(GridTable.GetFocusedRowCellValue("TotalMoney")) == 0) { mnsNew.IsEnabled = true; mnsPay.IsEnabled = false; } }
private void tsbEdit_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) { D05F2011 frm = new D05F2011(); int i = 0; try { frm.TableID = GridTable.GetFocusedRowCellValue("TableID").ToString(); i = GridTable.View.FocusedRowData.RowHandle.Value; } catch (Exception) { System.Windows.MessageBox.Show("Chọn 1 dòng để sửa không phải dòng này!"); } frm.FormState = Lemon3.EnumFormState.FormEdit; frm.WindowStartupLocation = WindowStartupLocation.CenterScreen; frm.ShowDialog(); LoadSimple(); GridTable.FocusRowHandle(i); }
private void TableModel_QueryCoveredRange(object sender, GridQueryCoveredRangeEventArgs e) { GridTable thisTable = this.gridGroupingControl1.Table; if (e.RowIndex < thisTable.DisplayElements.Count) { Element el = thisTable.DisplayElements[e.RowIndex]; if (el is ExtraSection) { // Cover some cells of the extra section (specified with extraSectionCoverCols) int startCol = el.GroupLevel + 1; // Add +1 so we have place for column header if (e.ColIndex >= startCol && e.ColIndex <= this.extraSectionCoverCols + el.ParentTableDescriptor.GroupedColumns.Count) { e.Range = GridRangeInfo.Cells(e.RowIndex, startCol, e.RowIndex, this.extraSectionCoverCols + el.ParentTableDescriptor.GroupedColumns.Count); e.Handled = true; } } } }
public JsonResult Edit(GridTable gt) { using (SqlSugarClient db = SugarDao.GetInstance()) { ActionResultModel <string> model = new ActionResultModel <string>(); string message = string.Empty; var isValid = ValidationSugar.PostValidation("validate_key_grid_index", out message); if (isValid)//后台验证数据完整性 { model.isSuccess = db.Update <GridTable>(gt, it => it.id == gt.id); model.responseInfo = model.isSuccess ? "编辑成功" : "编辑失败"; } else { model.isSuccess = false; model.responseInfo = message; } return(Json(model)); } }
/// <summary> /// 创建表格 /// </summary> /// <returns></returns> public GridTable GetTable() { var tb = new GridTable(3) { DefaultColWidth = new double[] { 150, 320, 80 }, TablePreferredWidth = PreferredWidth.FromPercent(100), DefaultFontName = "微软雅黑", DefaultFontNameAscii = "Microsoft YaHei", DefaultFontSize = 12, DefaultForegroundColor = GetRgb("#333"), DefaultCellAlign = CellAlign.Center, DefaultBorderColor = Color.LightGray, }; KnowledgePoints(tb); MasteryLevel(tb); ImprovementRoom(tb); MajorKnowledgePoints(tb); KnowledgePointMicroCourse(tb); return(tb); }
public void AsposeWordTable1() { string tempFile = "D:\\test.docx"; Document doc = new Document(tempFile); DocumentBuilder builder = new DocumentBuilder(doc); // var writer = new WordWriter(builder); var document = WordFactory.CreateBuilder(tempFile); document.ReplaceCallBack("{SubjectTable}", writer => { var tb = new GridTable(3) { DefaultColWidth = new double[] { 60, 60, 60 } }; ChartHelper.TableCommonSetting(tb); CreateTableHeader(tb); CreateExamStatisticRow(tb); writer.WriteGridTable(tb); }); document.Save("D:\\test.docx"); }
public JsonResult ListarDetalle(GridTable grid) { var jqgrid = CrearJgrid(grid, DetalleOrdenCompra.Count); jqgrid.rows = DetalleOrdenCompra.Select(item => new JRow { id = item.IdMovimientoProducto.ToString(), cell = new[] { item.IdMovimientoProducto.ToString(), item.CodigoProducto, item.NombreProducto, item.NombrePresentacion, item.PrecioBase.ToString(), item.Cantidad.ToString(), item.MontoDescuento.ToString(), item.MontoImpuesto.ToString(), item.SubTotal.ToString() } }).ToArray(); return(Json(jqgrid)); }
public JsonResult ListarDetalle(GridTable grid) { if (DetalleTransferencia == null) { return(Json(new JGrid())); } var jqgrid = CrearJgrid(grid, DetalleTransferencia.Count); jqgrid.rows = DetalleTransferencia.Select(item => new JRow { id = item.IdMovimientoProducto.ToString(), cell = new[] { item.IdMovimientoProducto.ToString(), item.CodigoProducto, item.NombreProducto, item.NombrePresentacion, item.Cantidad.ToString() } }).ToArray(); return(Json(jqgrid)); }
private void mnsPay_Click(object sender, RoutedEventArgs e) { string VoucherID = ""; DataTable dt = BLTable.SelectPayment(GridTable.GetFocusedRowCellValue("TableID").ToString(), GridTable.GetFocusedRowCellValue("Status").ToString()); if (dt.Rows.Count > 0) { VoucherID = dt.Rows[dt.Rows.Count - 1]["VoucherID"].ToString(); } D05F2141 frmPayment = new D05F2141(); frmPayment.TotalMoney = Convert.ToDecimal(dt.Rows[dt.Rows.Count - 1]["Amount"]); frmPayment.WindowStartupLocation = WindowStartupLocation.CenterScreen; frmPayment.ShowDialog(); if (!frmPayment.bClicked) { return; } decimal AmountPayment = frmPayment.TotalMoney; BLTable.UpdateMoney(L3SQLClient.SQLMoney(GridTable.GetFocusedRowCellValue("TotalMoney"), "n0"), L3SQLClient.SQLMoney(GridTable.GetFocusedRowCellValue("People"), "n0"), GridTable.GetFocusedRowCellValue("TableID")); BLTable.UpdateVoucherD91T2140(L3SQLClient.SQLMoney(AmountPayment, "n0"), VoucherID); LoadSimple(); }
//used to initialize the custom styles to the GridGroupingControl private void buttonAdv1_Click(object sender, EventArgs e) { this.gridGroupingControl1.Appearance.AnyCell.ImageSizeMode = GridImageSizeMode.CenterImage; this.gridGroupingControl1.IntelliMousePanning = true; GridTable employeeTable = this.gridGroupingControl1.Table; GridTableDescriptor employeeTableDescriptor = this.gridGroupingControl1.TableDescriptor; RecordFieldStylesCollection employee = TableRecordFieldStyles.GetObject(this.gridGroupingControl1.TableDescriptor.Name); employee.GetObject(2).GetObject("LastName").BackColor = ColorConvert.ColorFromString("#84A1C3"); employee.GetObject(2).GetObject("LastName").Font.Bold = true; employee.GetObject(1).GetObject("City").BackColor = ColorConvert.ColorFromString("#FF9933");; employee.GetObject(1).GetObject("City").Font.Italic = true; employee.GetObject(1).GetObject("Address").Interior = new BrushInfo(PatternStyle.OutlinedDiamond, ColorConvert.ColorFromString("#84A1C3"), ColorConvert.ColorFromString("#2a437e")); employee.GetObject(1).GetObject("Address").TextColor = Color.White; employee.GetObject(1).GetObject("Address").Font.Bold = true; employee.GetObject(1).GetObject("Address").Font.Size += 2; // see also gridGroupingControl1_QueryCellStyleInfo handler, // case GridTableCellType.AlternateRecordFieldCell: // case GridTableCellType.AddNewRecordFieldCell: // case GridTableCellType.RecordFieldCell: }
/// <summary> /// 知识点微课 /// </summary> /// <param name="tb"></param> private void KnowledgePointMicroCourse(GridTable tb) { var knowledgePointMicroCourse = tb.NewRow(); string describe = "测试主要攻破知识点描述"; knowledgePointMicroCourse[0].Html = string.Format("<img src = '{0}' style = 'width:15; height:15;' /> <span style='font-size:16;font-weight:bold;font-family:微软雅黑'>{1}</span>", imgCodePath, "知识点微课"); knowledgePointMicroCourse[1].Text = describe; knowledgePointMicroCourse[2].Html = string.Format(@"<img src='{0}' style='width:2cm; height:2cm;'/>", imgCodePath); //knowledgePointMicroCourse[1].TopPadding = 0; //knowledgePointMicroCourse[1].Html = string.Format(@"<span style='margin: 0px; padding: 0px;font-family:Microsoft YaHei;float:left'>{0}</span> // <img src='{1}' style='width:2cm; height:2cm;'/>", describe, imgCodePath); SetTableStyle(knowledgePointMicroCourse); knowledgePointMicroCourse[1].CellAlign = CellAlign.Right; knowledgePointMicroCourse[1].RightBorderSetting.Color = Color.White; knowledgePointMicroCourse[2].CellAlign = CellAlign.Right; knowledgePointMicroCourse[2].RightPadding = 7; knowledgePointMicroCourse[2].TopPadding = 5; knowledgePointMicroCourse[2].BottomPadding = 5; knowledgePointMicroCourse[2].Border = true; knowledgePointMicroCourse[2].LeftBorderSetting.Color = Color.White; tb.AddRow(knowledgePointMicroCourse); }
protected void Page_Load(object sender, EventArgs e) { GridTable.DataSource = TinTuc_DS(); GridTable.DataBind(); ListDrop(); }
protected IList <T> CrearJGrid <T>(IPaged <T> iPaged, GridTable gridTable, string [] nombreFiltros, ref JGrid jGrid) where T : class { var totalPaginas = 0; var filtros = new List <object>(); if (!string.IsNullOrEmpty(gridTable.filters)) { var filters = JsonConvert.DeserializeObject <JOERP.Helpers.JqGrid.Filter>(gridTable.filters); foreach (var nombreFiltro in nombreFiltros) { var filtro = filters.rules.FirstOrDefault(p => p.field == nombreFiltro); filtros.Add(filtro == null ? null : filtro.data); } } else { foreach (var nombreFiltro in nombreFiltros) { filtros.Add(null); } } if (gridTable.rules != null) { var index = 0; foreach (var nombreFiltro in nombreFiltros) { foreach (var rule in gridTable.rules) { if (rule.field != nombreFiltro) { continue; } filtros[index] = rule.data; } index++; } } var cantidad = iPaged.Count(filtros.ToArray()); gridTable.page = (gridTable.page == 0) ? 1 : gridTable.page; gridTable.rows = (gridTable.rows == 0) ? 100 : gridTable.rows; if (cantidad > 0 && gridTable.rows > 0) { var div = cantidad / (decimal)gridTable.rows; var round = Math.Ceiling(div); totalPaginas = Convert.ToInt32(round); totalPaginas = totalPaginas == 0 ? 1 : totalPaginas; } gridTable.page = gridTable.page > totalPaginas ? totalPaginas : gridTable.page; var start = gridTable.rows * gridTable.page - gridTable.rows; if (start < 0) { start = 0; } jGrid.total = totalPaginas; jGrid.page = gridTable.page; jGrid.records = cantidad; jGrid.start = start; filtros.Insert(0, gridTable.sidx); filtros.Insert(1, gridTable.sord); filtros.Insert(2, gridTable.rows); filtros.Insert(3, start); filtros.Insert(4, cantidad); var lista = iPaged.GetPaged(filtros.ToArray()); return(lista); }
public ActionResult Get(EdFiDashboardContext context) { var learningStandards = service.Get(new LearningStandardRequest() { StudentUSI = context.StudentUSI.GetValueOrDefault(), SchoolId = context.SchoolId.GetValueOrDefault(), MetricVariantId = context.MetricVariantId.GetValueOrDefault() }); var model = new GridTable { MetricVariantId = context.MetricVariantId.GetValueOrDefault() }; if (learningStandards == null || learningStandards.Count == 0) { return View(model); } /*Preparing headers*/ #region Headers model.Columns = new List<Column>{ new Column { IsVisibleByDefault = true, IsFixedColumn = true, Children= new List<Column>{ new ImageColumn{ Src = "LeftGrayCorner.png", IsVisibleByDefault=true, IsFixedColumn = true}, new TextColumn{ DisplayName = StudentExpectationsColumnHeading, IsVisibleByDefault=true, IsFixedColumn = true}, } }, new TextColumn{DisplayName="Spacer", IsVisibleByDefault=true, IsFixedColumn = true, Children= new List<Column>{ new TextColumn{IsVisibleByDefault=true, IsFixedColumn = true}, } } }; //For the Dynamic Columns (this is the Header which is empty "no text") var parentColumn = new TextColumn { DisplayName = BenchmarkAssessmentsColumnHeading, IsVisibleByDefault = true }; foreach (var learningStandardAssessment in learningStandards[0].Assessments) parentColumn.Children.Add(new TextColumn { DisplayName = learningStandardAssessment.DateAdministration.ToString("MMMM d, yyyy"), Tooltip = learningStandardAssessment.AssessmentTitle, IsVisibleByDefault = true }); model.Columns.Add(parentColumn); #endregion #region Rows foreach (var learningStandard in learningStandards) { var row = new List<object>(); //First cells (Spacer,Expectation,Spacer) row.Add(new CellItem<double> { DV = "", V = 0 }); row.Add(new ObjectiveTextCellItem<string> { O = learningStandard.LearningStandard + " " + learningStandard.Description, V = learningStandard.LearningStandard }); //Spacer row.Add(new SpacerCellItem<double> { DV = "", V = 0 }); foreach (var learningStandardAssessment in learningStandard.Assessments) { var cell = new ObjectiveCellItem<int> { DV = "", V = -1 }; if (learningStandardAssessment.Administered) { cell.V = ChangeValueForSorting(learningStandardAssessment.MetricStateTypeId); cell.ST = (learningStandardAssessment.MetricStateTypeId != null) ? learningStandardAssessment.MetricStateTypeId.Value : (int)MetricStateType.None; cell.DV = learningStandardAssessment.Value; } row.Add(cell); } model.Rows.Add(row); } #endregion return View(model); }
private void tsbListAll_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) { GridTable.ListAll(); }
public ActionResult Get(EdFiDashboardContext context) { var learningObjectives = service.Get(new LearningObjectiveRequest() { StudentUSI = context.StudentUSI.GetValueOrDefault(), SchoolId = context.SchoolId.GetValueOrDefault(), MetricVariantId = context.MetricVariantId.GetValueOrDefault() }); var model = new GridTable { MetricVariantId = context.MetricVariantId.GetValueOrDefault() }; if (learningObjectives == null || learningObjectives.AssessmentTitles.Count == 0) { return View(model); } var orderedAssessmentTitles = GetOrderedAssessmentTitles(learningObjectives.AssessmentTitles); #region Headers model.Columns = new List<Column>{ new Column { IsVisibleByDefault = true, IsFixedColumn = true, Children= new List<Column>{ new ImageColumn{ Src = "LeftGrayCorner.png", IsVisibleByDefault=true, IsFixedColumn = true }, new TextColumn{ DisplayName = learningObjectives.InventoryName, IsVisibleByDefault=true, IsFixedColumn = true}, } }, new TextColumn{DisplayName="Spacer", IsVisibleByDefault=true, IsFixedColumn = true, Children= new List<Column>{ new TextColumn{ IsVisibleByDefault=true, IsFixedColumn = true}, } } }; //For the Dynamic Columns (this is the Header which is empty "no text") var parentColumn = new TextColumn { DisplayName = "Reading Assessments", IsVisibleByDefault = true }; foreach (var learningObjectiveTitle in orderedAssessmentTitles) { parentColumn.Children.Add(new TextColumn { DisplayName = learningObjectiveTitle, IsVisibleByDefault = true }); } model.Columns.Add(parentColumn); #endregion #region Rows var orderedLearningObjectives = learningObjectives.LearningObjectiveSkills.OrderBy(los => los.SectionName).ThenBy(los => los.SkillName); foreach (var learningObjectiveSection in orderedLearningObjectives) { var row = new List<object>(); //Learning Objective section cell row.Add(new CellItem<double> { DV = "", V = 0 }); row.Add(new ObjectiveTextCellItem<string> { O = string.Format("{0}: {1}", learningObjectiveSection.SectionName, learningObjectiveSection.SkillName), V = string.Format("{0}: {1}", learningObjectiveSection.SectionName, learningObjectiveSection.SkillName) }); //Spacer row.Add(new SpacerCellItem<double> { DV = "", V = 0 }); foreach (var learningObjectiveAssessmentTitle in orderedAssessmentTitles) { var cell = new ObjectiveCellItem<int> { DV = "", V = -1 }; if (learningObjectiveSection.SkillValues.Any(skill => skill.Title == learningObjectiveAssessmentTitle)) { var learningObjectiveSkill = learningObjectiveSection.SkillValues.Where(skill => skill.Title == learningObjectiveAssessmentTitle).First(); cell.V = ChangeValueForSorting(learningObjectiveSkill.MetricStateTypeId); cell.ST = (learningObjectiveSkill.MetricStateTypeId != null) ? learningObjectiveSkill.MetricStateTypeId.Value : (int)MetricStateType.None; cell.DV = learningObjectiveSkill.Value; } row.Add(cell); } model.Rows.Add(row); } #endregion return View(model); }
protected void Page_Load(object sender, EventArgs e) { GridTable.DataSource = DienThoai_DS(); GridTable.DataBind(); ListUpdate(); }
public static GridTable GetBDAData() { GridTable table = null; IServiceRequest oAUMService; try { var currentAuthorization = Authorization.CurrentAuthorization; oAUMService = ServiceRequestFactory.GetProxy(SERVICES.AUM_SERVICE); if (currentAuthorization.IsOsj) { if (currentAuthorization.OsjIds != null && currentAuthorization.OsjIds.Count() > 0) { GFWM.Common.PracticeManagement.Entities.Request.PremierBusinessBuilderRequest request = new GFWM.Common.PracticeManagement.Entities.Request.PremierBusinessBuilderRequest(); var response = oAUMService.Request <GFWM.Common.PracticeManagement.Entities.Request.PremierBusinessBuilderRequest, GFWM.Common.PracticeManagement.Entities.Response.PremierBusinessBuilderResponse>(request); if (response != null && response.OsjBda != null) { table = new GridTable(); DateTime?dt = response.OsjBda.EligibleAumDate; table.Header = new List <GridCell>() { new GridCell() { Value = "ID" }, new GridCell() { Value = "Name" }, new GridCell() { Value = dt.HasValue ? string.Format("BDA Eligible AUM (as of {0})", dt.Value.ToString("MM/dd/yy")) : "BDA Eligible AUM" }, new GridCell() { Value = "Available BDA Balance" }, new GridCell() { Value = "Maximum BDA Balance" }, new GridCell() { Value = "Available BDA % of Max" }, }; var cells = new List <GridCell>() { new GridCell() { Value = response.OsjBda.OsjId }, new GridCell() { Value = response.OsjBda.FirmName }, new GridCell() { Value = response.OsjBda.EligibleAum.HasValue ? response.OsjBda.EligibleAum.Value.ToString("C0") : "$0" }, new GridCell() { Value = response.OsjBda.AvailableBalance.HasValue ? response.OsjBda.AvailableBalance.Value.ToString("C0") : "$0" }, new GridCell() { Value = response.OsjBda.MaximumBalance.HasValue ? response.OsjBda.MaximumBalance.Value.ToString("C0") : "$0" }, new GridCell() { Value = response.OsjBda.PercentageOfMax.HasValue ? response.OsjBda.PercentageOfMax.Value.ToString("N0") + " %" : "0 %" }, }; var rows = new List <GridRow>() { new GridRow() { Cells = cells, } }; table.Rows = rows; } } } return(table); } catch (Exception ex) { Sitecore.Diagnostics.Log.Error("Error executing GetBDAData request", ex, typeof(PracticeManagementHelper)); } return(null); }
private static GridTable GetAdvisorTable(IEnumerable <GFWM.Common.PracticeManagement.Entities.Data.AdvisorBda> advisorBdas) { GridTable advisorTable = new GridTable(); DateTime? dt = advisorBdas.Where(a => a.EligibleAumDate.HasValue).Select(s => s.EligibleAumDate).FirstOrDefault(); advisorTable.ID = HtmlTableHelper.ILSAdvisorCODE; advisorTable.Header = new List <GridCell>() { new GridCell() { Value = "Advisor Name" }, new GridCell() { Value = "Net Contributions for PC Status Level" }, new GridCell() { Value = dt.HasValue ? string.Format("BDA Eligible AUM (as of {0})", dt.Value.ToString("MM/dd/yy")) : "BDA Eligible AUM" }, new GridCell() { Value = "Available BDA Balance" }, new GridCell() { Value = "Maximum BDA Balance" }, new GridCell() { Value = "Available as % of Max" } }; advisorTable.Rows = new List <GridRow>(); foreach (var a in advisorBdas) { GridRow row = new GridRow() { Cells = new List <GridCell>() { new GridCell() { Value = a.AdvisorName }, new GridCell() { Value = a.NetContributions.HasValue ? a.NetContributions.Value.ToString("C0") : "$0" }, new GridCell() { Value = a.EligibleAum.HasValue ? a.EligibleAum.Value.ToString("C0") : "$0" }, new GridCell() { Value = a.AvailableBalance.HasValue ? a.AvailableBalance.Value.ToString("C0") : "$0" }, new GridCell() { Value = a.MaximumBalance.HasValue ? a.MaximumBalance.Value.ToString("C0") : "$0" }, new GridCell() { Value = a.PercentageOfMax.HasValue ? a.PercentageOfMax.Value.ToString("N0") + " %" : "0 %" } }, Attributes = new Dictionary <string, string>() { { "data-imageurl", GetInvestmentLevelImageUrl(a.PCStatus) } } }; advisorTable.Rows.Add(row); } return(advisorTable); }
public void BuildGrid(GridTable gridTable, CellSizeStyle cellSizeStyle) { this.gridLayer = new GridLayer(this, cellSizeStyle, gridTable); }
public ActionResult Get(EdFiDashboardContext context) { var goalStrands = service.Get(new GoalStrandRequest() { StudentUSI = context.StudentUSI.GetValueOrDefault(), SchoolId = context.SchoolId.GetValueOrDefault(), MetricVariantId = context.MetricVariantId.GetValueOrDefault() }); var model = new GridTable { MetricVariantId = context.MetricVariantId.GetValueOrDefault() }; if (goalStrands == null || goalStrands.Count == 0) { return(View(model)); } /*Preparing headers*/ #region Headers model.Columns = new List <Column> { new Column { IsVisibleByDefault = true, IsFixedColumn = true, Children = new List <Column> { new ImageColumn { Src = "LeftGrayCorner.png", IsVisibleByDefault = true, IsFixedColumn = true }, new TextColumn { DisplayName = GoalStrandsColumnHeading, IsVisibleByDefault = true, IsFixedColumn = true }, } }, new TextColumn { DisplayName = "Spacer", IsVisibleByDefault = true, IsFixedColumn = true, Children = new List <Column> { new TextColumn { IsVisibleByDefault = true, IsFixedColumn = true }, } } }; //For the Dynamic Columns (this is the Header which is empty "no text") var parentColumn = new TextColumn { DisplayName = BenchmarkAssessmentsColumnHeading, IsVisibleByDefault = true }; foreach (var goalStrandAssessment in goalStrands[0].Assessments) { parentColumn.Children.Add(new TextColumn { DisplayName = goalStrandAssessment.AssessmentForm + ": " + goalStrandAssessment.AssessmentPeriod + "<br/>(" + goalStrandAssessment.DateAdministration.ToString("MM/d/yy") + ")", Tooltip = goalStrandAssessment.AssessmentTitle, IsVisibleByDefault = true }); } model.Columns.Add(parentColumn); #endregion #region Rows foreach (var goalStrand in goalStrands) { var row = new List <object>(); //First cells (Spacer,Expectation,Spacer) row.Add(new CellItem <double> { DV = "", V = 0 }); row.Add(new ObjectiveTextCellItem <string> { O = goalStrand.LearningStandard, V = goalStrand.LearningStandard }); //Spacer row.Add(new SpacerCellItem <double> { DV = "", V = 0 }); foreach (var goalStrandAssessment in goalStrand.Assessments) { var cell = new GoalStrandCellItem <int> { DV = "", V = -1 }; if (goalStrandAssessment.Administered) { cell.V = ChangeValueForSorting(goalStrandAssessment.MetricStateTypeId); cell.GS = (goalStrandAssessment.MetricStateTypeId != null) ? goalStrandAssessment.MetricStateTypeId.Value : (int)MetricStateType.None; cell.DV = string.Format("{0} = {1}", goalStrandAssessment.AssessmentReportingType, goalStrandAssessment.Value); } row.Add(cell); } model.Rows.Add(row); } #endregion return(View(model)); }
/// <summary> /// Grids the specified helper. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="helper">The helper.</param> /// <param name="collection">The collection.</param> /// <param name="columns">The columns.</param> /// <returns></returns> public static string Grid <T>(this HtmlHelper helper, List <T> collection, List <string> columns) { GridTable <T> table = new GridTable <T>(collection, () => columns, GetRow, string.Empty, string.Empty); return(table.CreateTable()); }
/// <summary> /// Grids the specified helper. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="helper">The helper.</param> /// <param name="collection">The collection.</param> /// <param name="columns">The columns.</param> /// <param name="row">The row.</param> /// <param name="cssClass">The CSS class.</param> /// <param name="id">The id.</param> /// <returns></returns> public static string Grid <T>(this HtmlHelper helper, List <T> collection, Func <List <string> > columns, Func <T, List <string> > row, string cssClass, string id) { GridTable <T> table = new GridTable <T>(collection, columns, row, cssClass, id); return(table.CreateTable()); }
public ActionResult Get(EdFiGridRequest request) { var previousNextModel = PreviousNextSessionProvider.GetPreviousNextModel(Request.UrlReferrer, request.PreviousNextSessionPage, request.SchoolId ?? request.LocalEducationAgencyId); // make sure the StaffUSI is set //request.StaffUSI = UserInformation.Current.StaffUSI; // If the StudentListType is None then the list will not be known until the service call if (request.StudentListType == StudentListType.None.ToString()) { previousNextModel.EntityIdArray = null; previousNextModel.ListPersistenceUniqueId = null; previousNextModel.ListUrl = Request.UrlReferrer != null ? Request.UrlReferrer.OriginalString : null; } else { request.UniqueListId = previousNextModel.ListPersistenceUniqueId; } // this will persist the watch list selections to the next/previous // controller if (request.StudentWatchListData != null && request.StudentWatchListData.Any()) { previousNextModel.StudentWatchListData = request.StudentWatchListData; } var totalRows = 0; if (request.StudentIdList != null && !request.StudentIdList.Any()) { totalRows = previousNextModel.EntityIdArray != null ? previousNextModel.EntityIdArray.Count() : 0; request.StudentIdList = totalRows == 0 ? new List<long>() : PreviousNextSessionProvider.GetStudentIdList(previousNextModel, request.PageNumber, request.PageSize, request.SortColumn, request.SortDirection); } var resourceModel = EdFiGridService.Get(request); // If ListPersistenceUniqueId is Null then the Id should have been set in the service based on list id if determined if (previousNextModel.ListPersistenceUniqueId == null) { previousNextModel.ListPersistenceUniqueId = request.UniqueListId; } var rows = resourceModel.ListMetadata.GenerateRows(resourceModel.Students.ToList<StudentWithMetrics>(), previousNextModel.ListPersistenceUniqueId); var model = new GridTable { Rows = rows, TotalRows = resourceModel.EntityIds.Any() ? resourceModel.EntityIds.Count : totalRows }; // Do not store previous/next if the Id could not be determined if (previousNextModel.ListPersistenceUniqueId != null) { PreviousNextSessionProvider.SetPreviousNextDataModel(previousNextModel, request.SortColumn, request.SortDirection, resourceModel.EntityIds); } return Json(model); }