예제 #1
0
 private void bunifuFlatButton3_Click(object sender, EventArgs e)
 {
     System.Drawing.Point P = new Point(0, bunifuFlatButton3.Location.Y);
     panel3.Location = P;
     panel3.Visible  = true;
     Statistics.Logger("Access Statistics");
     statistiques1.Show();
 }
예제 #2
0
        private void bunifuTileButton1_Click(object sender, EventArgs e)
        {
            this.productsTableAdapter1.Insert(N.Text, Cat.Text, double.Parse(Price.Text), int.Parse(Quan.Text), Desc.Text);
            this.productsDataSet1.AcceptChanges();
            Statistics.Logger("Added product " + N.Text);

            MessageBox.Show("Ajouté avec succées!", "Congratulastions", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }
예제 #3
0
 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");
 }
예제 #4
0
        public void RemoveFromQuart()
        {
            foreach (ListViewItem item in listQuart.SelectedItems)
            {
                int index = item.Index;
                listQuart.Items.RemoveAt(index);
                Statistics.CancelBuy(item.Text);
            }
            label1.Text = Statistics.PriceSum.ToString() + "    DH";

            Statistics.Logger("Removed an item from quart");
        }
예제 #5
0
        public void AddToQuart()
        {
            foreach (ListViewItem item in listProducts.SelectedItems)
            {
                ListViewItem lvItem = item.Clone() as ListViewItem;
                listQuart.Items.Add(lvItem);
                Statistics.OnBuy(lvItem.Text);
            }
            label1.Text = Statistics.PriceSum.ToString() + "    DH";

            Statistics.Logger("Added an item to quart");
        }
예제 #6
0
 private void bunifuFlatButton4_Click(object sender, EventArgs e)
 {
     System.Drawing.Point P = new Point(0, bunifuFlatButton4.Location.Y);
     statistiques1.Hide();
     panel3.Location = P;
     panel3.Visible  = true;
     quart1.Hide();
     logs1.Hide();
     vendor1.Show();
     stock2.Hide();
     Statistics.Logger("Access vendors List");
 }
예제 #7
0
        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";
        }
예제 #8
0
 private void StockDataGrid_RowValidated(object sender, DataGridViewCellEventArgs e)
 {
     this.productsTableAdapter.Update(this.productsDataSet1.Products);
     Statistics.Logger("Updated Product");
 }
예제 #9
0
 private void StockDataGrid_UserDeletedRow(object sender, DataGridViewRowEventArgs e)
 {
     this.productsTableAdapter.Update(this.productsDataSet1.Products);
     Statistics.Logger("Deleted Product");
 }
예제 #10
0
 private void VendorDataGrid_RowValidated(object sender, DataGridViewCellEventArgs e)
 {
     vendeurTableAdapter1.Update(productsDataSet1.Vendeur);
     Statistics.Logger("Updated Vendor info");
 }
예제 #11
0
 private void VendorDataGrid_UserDeletedRow(object sender, DataGridViewRowEventArgs e)
 {
     this.vendeurTableAdapter1.Update(this.productsDataSet1.Vendeur);
     Statistics.Logger("Deleted vendor");
 }
예제 #12
0
 private void bunifuThinButton21_Click_1(object sender, EventArgs e)
 {
     Statistics.Logger("Exit application");
     Environment.Exit(0);
 }
예제 #13
0
 private void bunifuTileButton1_Click(object sender, EventArgs e)
 {
     this.vendeurTableAdapter.Insert(N.Text, P.Text, CIN.Text, Tele.Text, Adrs.Text);
     Statistics.Logger("Added vendor " + N.Text);
     this.Close();
 }