public override void Select(List <Thematics> List, ThematicTransaction @object, int indexOfSelect) { int Y = @object.Y; try { Button SQLButton; List = List.FindAll(p => p.GetEventId() == indexOfSelect); foreach (var i in List) { SQLButton = new Button { Size = new Size(@object.Width, @object.Height), Location = new Point(@object.X, Y), Font = @object.Font, Text = i.GetDescription(), Tag = i }; MainForm.Controls.Add(SQLButton); Y += 95; SQLButton.Click += Click; } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString(), ex.Source.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public virtual void Find(string symbols, List <Events> listOfEvents, ThematicTransaction @theme, List <Thematics> listOfThematics) { int Y = @theme.Y; try { Button SQLButton; listOfThematics = listOfThematics.FindAll(x => x.Description.ToLower().Contains(symbols)); listOfEvents = listOfEvents.FindAll(x => x.Name.ToLower().Contains(symbols)); if (listOfEvents.Count() == 0 && listOfThematics.Count() == 0 || symbols == "") { Label SQLLabel; SQLLabel = new Label { Size = new Size(@theme.Width, @theme.Height), Location = new Point(@theme.X, Y), Font = new Font("Microsoft Sans Serif", 16F, FontStyle.Regular, GraphicsUnit.Point, 204), TextAlign = System.Drawing.ContentAlignment.MiddleCenter, Text = "На ваш запрос не нашлось результата" }; theme.MainForm.Controls.Add(SQLLabel); } else { foreach (var i in listOfThematics) { List <Events> Event = listOfEvents.FindAll(p => p.GetId() == i.GetEventId()); string eventId = default; foreach (var item in Event) { eventId = item.GetName(); } SQLButton = new Button { Size = new Size(@theme.Width, @theme.Height), Location = new Point(@theme.X, Y), Font = new Font("Microsoft Sans Serif", 10F, FontStyle.Regular, GraphicsUnit.Point, 204), Text = i.GetDescription() + "\n" + eventId, Tag = i }; theme.MainForm.Controls.Add(SQLButton); Y += 95; SQLButton.Click += Click; } foreach (var i in listOfEvents) { SQLButton = new Button { Size = new Size(@theme.Width, @theme.Height), Location = new Point(@theme.X, Y), Font = new Font("Microsoft Sans Serif", 16F, FontStyle.Regular, GraphicsUnit.Point, 204), Text = i.GetName(), Tag = i }; theme.MainForm.Controls.Add(SQLButton); Y += 95; SQLButton.Click += Click; } } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString(), ex.Source.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public virtual void Select(List <Thematics> List, ThematicTransaction @object, int indexOfSelect) { Console.WriteLine("Performing base class selecting all with index"); }