public override void Init(Competition content) { base.Init(content); ContentCaption = string.Format("{0} - Список Игр", Competition.Name); var teams = DbContext.TeamCompetitionSet.Where(f => f.CompetitionId == Competition.Id).Select(f => f.TeamId).ToList(); var stages = DbContext.StageSet.Where(f => f.CompetitionId == Competition.Id).Select(f => f.Id).ToList(); DbContext.GameSet.Where(f => f.CompetitionId == Competition.Id).Load(); DbContext.TeamSet.Where(f => f.Used && teams.Contains(f.Id)).Load(); this.GridEX.RootTable.Columns["Team"].HasValueList = true; this.GridEX.RootTable.Columns["Team"].EditType = EditType.Combo; this.GridEX.RootTable.Columns["Team"].ColumnType = ColumnType.Text; this.GridEX.RootTable.Columns["Team"].ValueList.PopulateValueList(DbContext.TeamSet.Local.Where(f => f.Used).ToList(), "Name"); this.GridEX.RootTable.Columns["Team2"].HasValueList = true; this.GridEX.RootTable.Columns["Team2"].EditType = EditType.Combo; this.GridEX.RootTable.Columns["Team2"].ColumnType = ColumnType.Text; this.GridEX.RootTable.Columns["Team2"].ValueList.PopulateValueList(DbContext.TeamSet.Local.Where(f => f.Used).ToList(), "Name"); this.GridEX.RootTable.Columns["Winner"].HasValueList = true; this.GridEX.RootTable.Columns["Winner"].EditType = EditType.NoEdit; this.GridEX.RootTable.Columns["Winner"].ColumnType = ColumnType.Text; this.GridEX.RootTable.Columns["Winner"].ValueList.PopulateValueList(DbContext.TeamSet.Local.Where(f => f.Used).ToList(), "Name"); DbContext.StageSet.Where(f => stages.Contains(f.Id)).Load(); this.GridEX.RootTable.Columns["Stage"].HasValueList = true; this.GridEX.RootTable.Columns["Stage"].EditType = EditType.Combo; this.GridEX.RootTable.Columns["Stage"].ColumnType = ColumnType.Text; this.GridEX.RootTable.Columns["Stage"].ValueList.PopulateValueList(DbContext.StageSet.Local.ToList(), "Name"); this.GridEX.RootTable.Columns["Stage"].GroupComparer = this; this.GridEX.RootTable.Columns["Stage"].SortComparer = this; this.GridEX.RootTable.Columns["ParentGame1"].HasValueList = true; this.GridEX.RootTable.Columns["ParentGame1"].EditType = EditType.Combo; this.GridEX.RootTable.Columns["ParentGame1"].ColumnType = ColumnType.Text; this.GridEX.RootTable.Columns["ParentGame1"].ValueList.PopulateValueList(DbContext.GameSet.Local.ToList(), "Name2"); this.GridEX.RootTable.Columns["ParentGame2"].HasValueList = true; this.GridEX.RootTable.Columns["ParentGame2"].EditType = EditType.Combo; this.GridEX.RootTable.Columns["ParentGame2"].ColumnType = ColumnType.Text; this.GridEX.RootTable.Columns["ParentGame2"].ValueList.PopulateValueList(DbContext.GameSet.Local.ToList(), "Name2"); GridEX.DataSource = DbContext.GameSet.Local.ToBindingList(); GridEX.SetReadonly(!App.AdminMode); }
public void Init() { GridEX.DataSource = DbContext.CompetitionRefereeSet.Local.ToBindingList(); GridEX.SetReadonly(!App.AdminMode); }
public void Init() { DbContext.TeamSet.Load(); GridEX.DataSource = DbContext.TeamSet.Local.ToBindingList(); GridEX.SetReadonly(!App.AdminMode); }