internal void init() { Transform parent = UIRootFinder.uiRootTran; GameObject asset = (GameObject)AssetManager.Instance.LoadPrefab("RecordPanel"); panel = Instantiate(asset) as GameObject; panel.transform.parent = parent; panel.transform.localScale = Vector3.one; panelScript = panel.GetComponent <RecordPanel>(); UIEventListener.Get(panelScript.returnbtn).onClick = OnReturnClick; }
public void Init() { mainPanel = new MainPanel(); buildTabelPanel = new BuildTabelPanel(); communicationPanel = new CommunicationPanel(); recordPanel = new RecordPanel(); //panel加入dictionary (key -> value) mPanelDictionary.Add(Page.Main, mainPanel); mPanelDictionary.Add(Page.Communication, communicationPanel); mPanelDictionary.Add(Page.Record, recordPanel); mPanelDictionary.Add(Page.BuildTable, buildTabelPanel); this.Controls.Add(mPanelDictionary[Page.Main]); this.Controls.Add(mPanelDictionary[Page.Communication]); this.Controls.Add(mPanelDictionary[Page.Record]); this.Controls.Add(mPanelDictionary[Page.BuildTable]); }
public IEnumerable <Record> FindData(RecordPanel recordPanel) { return(SearchHelper.GetDataFromDB(_contextFactory, recordPanel)); }
internal static IEnumerable <Record> GetDataFromDB(IDbContextFactory <WeightliftingContext> contextFactory, RecordPanel recordPanel) { using var context = contextFactory.CreateDbContext(); var resultRecords = context.Records.Where(record => (recordPanel.MenIsIncluded && recordPanel.WomenIsIncluded || (recordPanel.MenIsIncluded ? record.Attempt.Athlete.Sex == Men : recordPanel.WomenIsIncluded && record.Attempt.Athlete.Sex == Women)) && (record.Attempt.Date >= recordPanel.DateLowerLimit && record.Attempt.Date <= recordPanel.DateUpperLimit) && (record.Exercise.Name == (recordPanel.TotalIsIncluded ? Total : null) || record.Exercise.Name == (recordPanel.SnatchIsIncluded ? Snatch : null) || record.Exercise.Name == (recordPanel.CleanAndPressIsIncluded ? Press : null) || record.Exercise.Name == (recordPanel.CleanAndJerkIsIncluded ? CleanAndJerk : null)) && (recordPanel.Competition == null || record.Attempt.Competition.Name == recordPanel.Competition) && (recordPanel.AthleteName == null || record.Attempt.Athlete.Name == recordPanel.AthleteName) && (record.Attempt.AthleteWeight >= recordPanel.WeightLowerLimit && record.Attempt.AthleteWeight <= recordPanel.WeightUpperLimit) && (recordPanel.IsWorldRecordsIncluded && recordPanel.IsOlympicRecordsIncluded || (recordPanel.IsWorldRecordsIncluded ? record.RecordTypeNavigation.Name == World : recordPanel.IsOlympicRecordsIncluded && record.RecordTypeNavigation.Name == Olympic)) && record.Active == recordPanel.IsActive) .Select(record => new Record { AthleteName = record.Attempt.Athlete.Name, Competition = record.Attempt.Competition.Name, Excercise = record.Exercise.Name, RecordType = record.RecordTypeNavigation.Name, Result = record.Attempt.Result, WeightCategory = record.Category.Name }); return(resultRecords.ToArray()); }
public void RecordButtonPressed() { recordSelected.SetActive(true); RecordPanel.SetActive(true); }