private void PopulateData() { var db = new DataProcess(); var templates = db.TemplateList(); var sortedTemplates = from tpl in templates orderby tpl.Item, int.Parse(tpl.Type) select tpl; SortedTemplates = sortedTemplates.ToList(); TemplatesListBox.Items.Clear(); SortedTemplates.ForEach((template) => { TemplatesListBox.Items.Add(template.ShortDescription()); }); }
private void PopulateData() { var db = new DataProcess(); var templates = db.TemplateList(); var sortedTemplates = from tpl in templates orderby tpl.Item, int.Parse(tpl.Type) select tpl; SortedTemplates = sortedTemplates.ToList(); SortedTemplates.ForEach((tpl) => { TemplateListView.Items.Add(tpl.ToListItem()); }); TemplateListLabel.Text = string.Format("焊接模板(共{0}条)", SortedTemplates.Count()); }