protected void displaySections() { DataSet ds = new DataSet(); ds = this.ConnSQL.getSectionsList(); SectionsList.DataSource = ds.Tables["sectionslist"].DefaultView; SectionsList.DataBind(); }
public GridBlockComposite Add(SectionsList rowParts, SectionBase colPart) { var blocksList = rowParts .Select(rowPart => GridBlockSimple.Create(rowPart, colPart)); _simpleBlocksList.AddRange(blocksList); return(this); }
private void UncheckEverything() { foreach (var item in SectionsList.Items) { ContentPresenter presenter = SectionsList?.ContainerFromItem(item) as ContentPresenter; if (presenter.GetChildren().FirstOrDefault() is ToggleButton toggleButton) { toggleButton.IsChecked = false; } } }
internal override void SetState() { UncheckEverything(); var currentItem = SectionsList?.Items?.SingleOrDefault(_ => ((OpenHABWidgetMapping)_).Command == Widget.Item.State); ContentPresenter presenter = SectionsList?.ContainerFromItem(currentItem) as ContentPresenter; if (presenter.GetChildren().FirstOrDefault() is ToggleButton toggleButton) { toggleButton.IsChecked = true; } }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// @fn private void BuildPopup() /// /// @brief Builds the pop up and related items /// /// @author Le Duc Anh /// @date 8/14/2010 //////////////////////////////////////////////////////////////////////////////////////////////////// private void BuildPopup() { // initialize the pop up m_listPopup.PopupAnimation = PopupAnimation.Fade; m_listPopup.Placement = PlacementMode.Relative; m_listPopup.PlacementTarget = this; m_listPopup.PlacementRectangle = new Rect(0, this.ActualHeight, 30, 30); m_listPopup.Width = this.ActualWidth; // initialize the sections' list if (ShowSectionButton) { m_listSection = new ListBoxEx((int)m_itemStyle + ListBoxEx.ItemStyles.NormalStyle); ////////////////////////////////////////////////////////////////////////// m_listSection.Items.Clear(); // add items into the list // is there any smarter way? if (SectionsList != null) { if (SectionsInitiallySelected != null && SectionsList.Count() == SectionsInitiallySelected.Count) { for (int i = 0; i < SectionsList.Count(); i++) { m_listSection.Items.Add(SectionsList[i]); if (SectionsInitiallySelected[i]) { m_listSection.SelectedItems.Add(m_listSection.Items[i]); } } } else { foreach (string item in SectionsList) { m_listSection.Items.Add(item); } m_listSection.SelectAll(); } } ////////////////////////////////////////////////////////////////////////// m_listSection.Width = this.Width; m_listSection.SelectionChanged += new SelectionChangedEventHandler(ListSection_SelectionChanged); m_listSection.MouseLeave += new MouseEventHandler(ListSection_MouseLeave); } // initialize the previous items' list m_listPreviousItem = new ListBoxEx(); m_listPreviousItem.MouseLeave += new MouseEventHandler(ListPreviousItem_MouseLeave); m_listPreviousItem.SelectionChanged += new SelectionChangedEventHandler(ListPreviousItem_SelectionChanged); m_listPreviousItem.Width = this.Width; }
public bool SaveUpdateSections(List <SectionList> sections) { Appraisal objApr = new Appraisal(); foreach (SectionList oItem in sections) { SectionsList objSec = new SectionsList(); objSec.sectionId = oItem.sectionId; objSec.sectionName = oItem.sectionName; objSec.sectionType = oItem.sectionType; objApr.SaveUpdateSections(objSec); } return(false); }
//метод сравнивает список перечислений int с sections, rows, cells public static void Comparator(List <IEnumerable <int?> > parseCondition) { //получаем номер секции текущего condition var numberSectioninControl = parseCondition[0].Select(x => x.Value).FirstOrDefault(); //получаем структуру секции с текущим номером и работаем уже только с ней var currentSection = SectionsList.Where(x => x.NumberSection == numberSectioninControl).FirstOrDefault(); if (currentSection == null) { LogEvent.Write("ERROR! Номера секции " + numberSectioninControl + " не существует"); } else // если секция существует, то продолжаем проверять row в ней { var numberRowsInControl = parseCondition[1].Select(x => x.Value).ToList(); foreach (var row in numberRowsInControl) { var currentRow = currentSection.Rows.Where(x => x.NumberRow == row).FirstOrDefault(); if (currentRow == null) { LogEvent.Write("ERROR! Номера row " + row + " не существует в секции №" + currentSection.NumberSection); } // если row существует, то проверяем cells в ней else { //если cells по какой то причине не получилось получить, например была *, то продолжаем при исключений проверяить все row не падая try { var numberCellsInControl = parseCondition[2].Select(x => x.Value).ToList(); foreach (var cell in numberCellsInControl) { if (!currentRow.Cells.Select(x => x.NumberCell).ToList().Contains(cell)) { LogEvent.Write("ERROR! Номера cell " + cell + " не существует в row №" + currentRow.NumberRow + " в секции №" + currentSection.NumberSection); } } } catch (Exception) { continue; } } } } }
public override void RefreshData() { EvaluationModel = EvaluationsRealm.Get(EvaluationLocalId); var sections = SectionsRealm.GetAll(x => x.Evaluation == EvaluationModel).ToList(); var sectionsContainer = new List <ViewModels.Controls.PrettyListViewItems.EvaluationSection>(); var overallScore = 0.0f; foreach (var sec in sections) { overallScore += sec.Score; sectionsContainer.Add(new ViewModels.Controls.PrettyListViewItems.EvaluationSection(sec)); } OverallScore = overallScore; SectionsList.Clear(); SectionsList.AddRange(sectionsContainer); }
//обработчик со *. По сути обрабатывает только случай, когда row *, в остальных случаях возвращает первые 3 перечисления public static string StarHandler(string str) { var massStr = str.Split(new char[] { '[', ']' }).Where(x => x != "").ToArray(); var indexStar = massStr.IndexOfContains('*'); //обрабатывается случай, когда row *, например {[1][*][5,6,7]} - допишет все row в 1 section if (indexStar.Length == 1 && indexStar[0] == 1) { string allRow = null; var currentSection = SectionsList.Where(x => x.NumberSection == massStr[0].ToInt()).First(); foreach (var row in currentSection.Rows) { allRow += row.NumberRow + ","; } massStr[1] = allRow.Substring(0, allRow.Length - 1); return($"[{massStr[0]}][{massStr[1]}][{massStr[2]}]"); } return($"[{massStr[0]}][{massStr[1]}][{massStr[2]}]"); }
protected void btnAddNewSection_Click(object sender, EventArgs e) { string sectionName = SectionName.Text; string sectionDesc = SectionDesc.Text; int sectionID = 0; // logger.Debug("Add New Section: " + sectionName.Length + " " + sectionDesc.Length); if (sectionName.Length >= 3 && sectionDesc.Length >= 3) { // logger.Debug("Add New Section: "+sectionName+" "+sectionDesc); try { sectionID = AdminSections.AddNewSection(sectionName, sectionDesc); } catch (Exception ex) { logger.Error("Add New Section Error: " + ex.Message); } SectionName.Text = ""; SectionDesc.Text = ""; } SectionsList.DataBind(); }
private void Init(bool isDefault) { if (isDefault) { SelectedSection = SectionsList[0]; SelectedType = TypesList[0]; SelectedStatus = StatusesList[0]; SelectedSource = SourcesList[0]; SelectedCustomer = CustomersList[0]; SelectedBroker = BrokersList[0]; SelectedTrader = TradersList[0]; } else { SelectedSection = SectionsList.First(s => s.id == Auction.sectionId); SelectedType = TypesList.First(t => t.id == Auction.typeId); SelectedStatus = StatusesList.First(s => s.Id == Auction.StatusId); SelectedSource = SourcesList.First(s => s.id == Auction.SiteId); SelectedCustomer = CustomersList.First(c => c.id == Auction.CustomerId); SelectedBroker = BrokersList.First(b => b.Id == Auction.BrokerId); SelectedTrader = TradersList.First(t => t.id == Auction.TraderId); } }
protected void SectionsList_PageIndexChanging(Object sender, GridViewPageEventArgs e) { SectionsList.PageIndex = e.NewPageIndex; SectionsList.DataBind(); }
public static GridBlockComposite Create(SectionsList rowParts, SectionsList colParts) { var block = new GridBlockComposite(); return(block.Add(rowParts, colParts)); }
private void AddSectionButton_Click(object sender, RoutedEventArgs e) { SectionsList selection = new SectionsList(course_id); sections.Add(selection); }