private void dtp1_ValueChanged(object sender, EventArgs e) { TermekLista termek; VevoLista vevo; termek = ABKezeloTermek.TermekRendelesFeltoltes(); vevo = ABKezeloAdmin.VevoFeltolt(); foreach (var item in chart1.Series) { item.Points.Clear(); } TermekStatisztika[] t = new TermekStatisztika[termek.Count]; int n = 0; int darab = 0; foreach (VevoRendelesFizet item in vevo) { if (item.RendelesDatum >= dtp1.Value && item.RendelesDatum.Date <= dtp2.Value) { foreach (VevoRendelesTermek it in termek) { if (it.IdVevo == item.VevoID) { int i = 0; while (i < n && t[i].nev != it.TermekNev) { i++; } if (i < n) { t[i].db++; darab++; } else { t[n].nev = it.TermekNev; t[n].db = 1; n++; darab++; } } } } } Random r = new Random(); for (int i = 0; i < n; i++) { chart1.Series["db"].Points.AddXY(t[i].nev, t[i].db); chart1.Series["db"].Points[i].Color = Color.FromArgb(255, (byte)r.Next(255), (byte)r.Next(255)); } lbTermekDarab.Text = darab.ToString() + "/db"; }
private void dtp4_ValueChanged(object sender, EventArgs e) { TermekLista termek; VevoLista vevo; vevo = ABKezeloAdmin.VevoFeltolt(); termek = ABKezeloTermek.TermekRendelesFeltoltes(); foreach (var item in chart3.Series) { item.Points.Clear(); } TermekPenzugyiStatisztika[] t = new TermekPenzugyiStatisztika[termek.Count]; int netto = 0; int n = 0; foreach (VevoRendelesFizet item in vevo) { if (item.RendelesDatum >= dtp3.Value && item.RendelesDatum.Date <= dtp4.Value) { foreach (VevoRendelesTermek it in termek) { if (it.IdVevo == item.VevoID) { int i = 0; while (i < n && t[i].nev != it.TermekNev) { i++; } if (i < n) { t[i].bevetel += it.TermekAr * it.RendelesDb; netto += it.TermekAr * it.RendelesDb; } else { t[n].nev = it.TermekNev; t[n].bevetel = 1; n++; netto++; } } } } } Random r = new Random(); for (int i = 0; i < n; i++) { chart3.Series["bevetel"].Points.AddXY(t[i].nev, t[i].bevetel); chart3.Series["bevetel"].Points[i].Color = Color.FromArgb(255, (byte)r.Next(255), (byte)r.Next(255)); } lbTermekNetto.Text = netto.ToString() + "/Ft"; }
void BevételiÖsszegző() { VevoLista csomagolt = ABKezeloAdmin.CsomagoltRendelesFeltolt(); foreach (var item in chart2.Series) { item.Points.Clear(); } PenzugyiStatisztika[] p = new PenzugyiStatisztika[csomagolt.Count]; int bevetel = 0; int n = 0; foreach (VevoRendelesFizet item in csomagolt) { int i = 0; while (i < n && p[i].ev.Month != item.FizetesiHatarideje.Month) //>= dtp3.Value.Year && item.CsomagolasIdo.Date.Year <= dtp4.Value.Year { i++; } if (i < n) { p[i].bevetel += item.Brutto; bevetel += item.Brutto; } else { p[n].ev = item.FizetesiHatarideje.Date; p[n].bevetel = 1; n++; bevetel++; } } Random r = new Random(); for (int i = 0; i < n; i++) { chart2.Series["Brutto"].Points.AddXY(p[i].ev.Month + "." + p[i].ev.Year, p[i].bevetel); chart2.Series["Brutto"].Points[i].Color = Color.FromArgb(255, (byte)r.Next(255), (byte)r.Next(255)); } lbBruttoBevetel.Text = bevetel.ToString() + "/Ft"; }