private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { var gr = model.elmGroups[listBox1.SelectedIndex]; if (gr.totalPrice == 0) { label_supl.Text = ""; label_cs.Text = ""; label_suplPrice.Text = ""; } else { string suplName = gr.SupplierName; Supl supl = new Supl(suplName); label_supl.Text = supl.getSupplierStr(); label_cs.Text = gr.CompSetName; double suplPrice = 0.0; foreach (var grp in model.elmGroups) { if (grp.SupplierName == suplName) { suplPrice += grp.totalPrice; } } label_suplPrice.Text = string.Format("Всего по поставщику {0:N0} руб", suplPrice); } ts.HighlightClear(); model.Highlight(model.elmGroups[listBox1.SelectedIndex]); }
private void Form1_Load(object sender, EventArgs e) { boot = new Boot(); model = boot.model; WrForm(wrForm.modelINFO); WrForm(wrForm.modelReport); List <Gr> grLst = new List <Gr>(); foreach (var gr in model.elmGroups) { if (gr.totalPrice == 0) { grLst.Add(gr); } } model.Highlight(grLst); }