Ejemplo n.º 1
0
        // démarrrer un travail - déclencher "compteur fonctionnement"
        private void metroTiledemarrer_Click(object sender, EventArgs e)
        {
            Calcul_TRS.date_debut = DateTime.Now;

            if (Calcul_TRS.produit_1 == "")
            {
                MetroFramework.MetroMessageBox.Show(this, "Veuillez saisir l'ordre de fabrication à traiter ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                if (!Formmain.Instance.MetroContainer.Controls.ContainsKey("UCdashboard"))
                {
                    UCdashboard uc = new UCdashboard();
                    uc.Dock = DockStyle.Fill;
                    Formmain.Instance.MetroContainer.Controls.Add(uc);
                    this.Dispose();
                }
                Formmain.Instance.MetroContainer.Controls["UCdashboard"].BringToFront();

                Formmain.Instance.MetroBack.Visible = false;
                Formmain.DASHBOARD = 1;
                Formmain.CONFIG    = 0;
            }
            Calcul_TRS.verif_equipe();// get equipe
            Calcul_TRS.insert_db_TRS();
            Calcul_TRS.insert_db_production();
        }
Ejemplo n.º 2
0
        private void metroTile_SELECT_Click(object sender, EventArgs e)//-------------------------------------------------------------------------------------------------------------
        {
            if (MetroFramework.MetroMessageBox.Show(this, " Vous valider ? ", "Message", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning) == DialogResult.Yes)
            {
                if (dataGridViewlistearret.Visible == true && dataGridViewlistearret_prevu.Visible == false) // arret non plannifié
                {
                    model_non_identifie.arret      = model.arret;
                    model_non_identifie.type_arret = "arret non plannifie";
                }

                else if (dataGridViewlistearret_prevu.Visible == true && dataGridViewlistearret.Visible == false) // arret planniifié
                {
                    model_non_identifie.arret      = model2.arret;
                    model_non_identifie.type_arret = "arret plannifie";
                }

                using (arrets_non_identifiés db = new arrets_non_identifiés())
                {
                    db.Entry(model_non_identifie).State = EntityState.Modified;
                    db.SaveChanges();
                }
            }
            Clear();
            PopulateDataGridView_arret_non_identifie();
            metroPanelarret.Visible  = false;
            metroTilearret.Visible   = false;
            metroTilepause.Visible   = false;
            metroTile_SELECT.Visible = false;

            dataGridViewlistearret.Visible       = false;
            dataGridViewlistearret_prevu.Visible = false;
            Calcul_TRS.verif_arret--;

            if (model2.arret == "changement _equipe") // calculer les 2 SMED
            {
                Calcul_TRS.changement_equipe = 1;
            }


            if (model2.arret == "changement serie") // calculer les 2 SMED
            {
                Calcul_TRS.SMED();
            }


            if (Calcul_TRS.verif_arret == 0)
            {
                // retrun to dashboard
                if (!Formmain.Instance.MetroContainer.Controls.ContainsKey("UCdashboard")) // // return to dashboard if there is any other breakdown
                {
                    UCdashboard uc = new UCdashboard();
                    uc.Dock = DockStyle.Fill;
                    Formmain.Instance.MetroContainer.Controls.Add(uc);
                }
                Formmain.Instance.MetroContainer.Controls["UCdashboard"].BringToFront();
                Formmain.Instance.MetroBack.Visible = true;
            }
        }
Ejemplo n.º 3
0
        private void metroTile1_Click(object sender, EventArgs e)
        {
            machine_1_rebut model_machine_rebut = new machine_1_rebut();

            if (metroLabelqte.Text == "0")
            {
                MetroFramework.MetroMessageBox.Show(this, "Veuillez saisir la quantité ", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            if (MetroFramework.MetroMessageBox.Show(this, "Voulez-vous saisir un rebus de " + metroLabelqte.Text + " articles ? pour " + model_rebut.rebut, "Message", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning) == DialogResult.Yes)
            {
                Calcul_TRS.rebut  += Convert.ToInt32(metroLabelqte.Text);
                metroLabelqte.Text = null;
                rebus_text         = 0;
                Calcul_TRS.current_rebut_quality  = model_rebut.rebut;
                Calcul_TRS.current_rebut_quantity = (int)rebus_text;

                if (checkBox_produit_1.Enabled)
                {
                    Calcul_TRS.produit_1_rebut = Calcul_TRS.current_rebut_quantity;
                }
                else if (checkBox_produit_2.Enabled)
                {
                    Calcul_TRS.produit_2_rebut = Calcul_TRS.current_rebut_quantity;
                }

                Calcul_TRS.insert_db_rebut();    // inserer dans db

                metroLabelqte.Text                = null;
                checkBox_produit_1.Checked        = false;
                checkBox_produit_2.Checked        = false;
                Calcul_TRS.current_rebut_quality  = "";   //reinitiatiliser
                Calcul_TRS.current_rebut_quantity = 0;
                panel_selection_anomalie.Visible  = false;

                if (Calcul_TRS.produit_2 == "") // return to dashboard if there is any other product
                {
                    // retrun to dashboard
                    if (!Formmain.Instance.MetroContainer.Controls.ContainsKey("UCdashboard"))
                    {
                        UCdashboard uc = new UCdashboard();
                        uc.Dock = DockStyle.Fill;
                        Formmain.Instance.MetroContainer.Controls.Add(uc);
                    }
                    Formmain.Instance.MetroContainer.Controls["UCdashboard"].BringToFront();
                    Formmain.Instance.MetroBack.Visible = true;
                }
            }
        }