private void Form1_Load(object sender, EventArgs e) { Statistics.StatsManager(1); timer1.Enabled = true; vendor1.Hide(); quart1.Hide(); stock2.Hide(); statistiques1.Hide(); logs1.Hide(); Statistics.Logger("Application loaded"); }
private void Statistiques_Load(object sender, EventArgs e) { Statistics.StatsManager(1); chartMonthly.Series["Ventes/Mois"].Points.AddXY("Janvier", Statistics.ItemsPerMonth[0]); chartMonthly.Series["Ventes/Mois"].Points.AddXY("Fevrier", Statistics.ItemsPerMonth[1]); chartMonthly.Series["Ventes/Mois"].Points.AddXY("Mars", Statistics.ItemsPerMonth[2]); chartMonthly.Series["Ventes/Mois"].Points.AddXY("Avril", Statistics.ItemsPerMonth[3]); chartMonthly.Series["Ventes/Mois"].Points.AddXY("Mai", Statistics.ItemsPerMonth[4]); chartMonthly.Series["Ventes/Mois"].Points.AddXY("juin", Statistics.ItemsPerMonth[5]); chartMonthly.Series["Ventes/Mois"].Points.AddXY("juillet", Statistics.ItemsPerMonth[6]); chartMonthly.Series["Ventes/Mois"].Points.AddXY("Août", Statistics.ItemsPerMonth[7]); chartMonthly.Series["Ventes/Mois"].Points.AddXY("Spetembre", Statistics.ItemsPerMonth[8]); chartMonthly.Series["Ventes/Mois"].Points.AddXY("Octobre", Statistics.ItemsPerMonth[9]); chartMonthly.Series["Ventes/Mois"].Points.AddXY("Novembre", Statistics.ItemsPerMonth[10]); chartMonthly.Series["Ventes/Mois"].Points.AddXY("Dècembre", Statistics.ItemsPerMonth[11]); }
private void bunifuFlatButton1_Click(object sender, EventArgs e) { string Lg = "Bought: "; string Facture = ""; foreach (ListViewItem item in listQuart.Items) { if (Lg == "Bought: ") { Lg += item.Text; } else { Lg += " + " + item.Text; } Facture += "\n" + item.Text; foreach (DataRow Row in productsDataSet1.Products.Rows) { if (Row["Nom"].ToString() == item.Text) { try { Row["Quantite"] = int.Parse(Row["Quantite"].ToString()) - 1; productsTableAdapter.Update(Row); } catch (Exception ex) { MessageBox.Show(ex.Message); } continue; } } } Facture += "\n\n" + Statistics.PriceSum.ToString() + " DH"; Lg += " Total: " + Statistics.PriceSum.ToString(); Statistics.ItemsPerMonth[Statistics.MonthNum()]++; Statistics.StatsManager(2); Statistics.Logger("The purshase:\t(" + Lg + ") was made"); MessageBox.Show(Facture, "Facture", MessageBoxButtons.OK, MessageBoxIcon.Information); listQuart.Clear(); Statistics.PriceSum = 0; label1.Text = "0 DH"; }