예제 #1
0
 //      modifier, copier, supprimer     true = modif    false = copie   si copie enregistré change en true
 public frmDetTypeTest(TypeTest _t, bool _s)
 {
     InitializeComponent();
     statut = _s;
     chargeDetail();
     chargeTypeTest(_t);
 }
예제 #2
0
 //      modifier, copier, supprimer     true = modif    false = copie   si copie enregistré change en true
 public frmDetTypeTest(TypeTest _t, bool _s, int lvla)
 {
     InitializeComponent();
     statut = _s;
     chargeDetail();
     chargeTypeTest(_t);
     lvlAcces = lvla;
     checkLvlAcces();
 }
예제 #3
0
        private void btnAjout_Click(object sender, EventArgs e)
        {
            var Det = new frmDetTypeTest(lvlAcces);

            Det.ShowDialog();
            if (Det.statut == true)
            {
                SelectTypeTest = Det.TypeSelect;
                update();
            }
        }
예제 #4
0
 private void btnX_Click(object sender, EventArgs e)
 {
     gridTypeTest.Rows.Clear();
     chargeDonne();
     txtRecherche.Text = "";
     gridTypeTest.Sort(gridTypeTest.Columns[0], ListSortDirection.Ascending);
     if (gridTypeTest.RowCount > 0)
     {
         gridTypeTest.Rows[0].Selected = true;
         SelectTypeTest = (TypeTest)gridTypeTest.Rows[0].Tag;
     }
 }
예제 #5
0
        private void btnCopier_Click(object sender, EventArgs e)
        {
            frmDetTypeTest frmCop;
            TypeTest cop = TypeSelect;
            cop.codeTypeTest = "";

            frmCop = new frmDetTypeTest(cop, false, lvlAcces);
            frmCop.ShowDialog();
            if (frmCop.statut == true)
            {
                TypeSelect = frmCop.TypeSelect;
                this.Close();
            }
            frmCop.Closed += (s, args) => this.Close();
        }
예제 #6
0
        public static bool SupprimerTypeTest(TypeTest Effacer)
        {
            var F =
                (from d in db.tblTypeTest
                 where d.CodeTypeTest == Effacer.codeTypeTest
                 select d).First();

            db.tblTypeTest.Remove(F);

            try
            {
                db.SaveChanges();
                return true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return false;
            }
        }
예제 #7
0
 public Employe(tblEmploye _emp)
 {
     IdEmp = _emp.IdEmp;
     PrenomEmp = _emp.PrenomEmp;
     NomEmp = _emp.NomEmp;
     CourrielEmp = _emp.CourrielEmp;
     NoTelPrincipal = _emp.NoTelPrincipal;
     NoTelSecondaire = _emp.NoTelSecondaire;
     AdressePostale = _emp.AdressePostale;
     DateEmbaucheEmp = _emp.DateEmbaucheEmp;
     CompetenceParticuliere = _emp.CompetenceParticuliere;
     Statut = _emp.Statut;
     CommentaireEmp = _emp.CommentaireEmp;
     LstEmTypeTest = new List<TypeTest>();
     foreach (tblTypeTest item in _emp.tblTypeTest)
     {
         TypeTest tt = new TypeTest(item);
         LstEmTypeTest.Add(tt);
     }
 }
예제 #8
0
        public static bool setTypeTest(TypeTest settings)
        {
            var r =
                (from e in db.tblTypeTest
                where e.CodeTypeTest == settings.codeTypeTest
                select e).First();

            r.NomTypeTest = settings.nomTypeTest;
            r.ObjectifTypeTest = settings.objectifTypeTest;
            r.DescTypeTest = settings.descTypeTest;
            r.CommentaireTest = settings.commentaireTypeTest;

            try
            {
                db.SaveChanges();
                return true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return false;
            }
        }
예제 #9
0
        public static bool AjouterTypeTest(TypeTest settings)
        {
            var ajout = new tblTypeTest();

            ajout.CodeTypeTest = settings.codeTypeTest;
            ajout.NomTypeTest = settings.nomTypeTest;
            ajout.ObjectifTypeTest = settings.objectifTypeTest;
            ajout.DescTypeTest = settings.descTypeTest;
            ajout.CommentaireTest = settings.commentaireTypeTest;

            db.tblTypeTest.Add(ajout);

            try
            {
                db.SaveChanges();
                return true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return false;
            }
        }
예제 #10
0
        private void btnEnregistrer_Click(object sender, EventArgs e)
        {
            TypeTest enregistrement = new TypeTest();
            DialogResult resultEnr;

            enregistrement.codeTypeTest = txtCode.Text;
            enregistrement.nomTypeTest = txtNomTest.Text;
            enregistrement.objectifTypeTest = txtObjTest.Text;
            enregistrement.descTypeTest = txtDescTest.Text;
            enregistrement.commentaireTypeTest = txtComTest.Text;

            resultEnr = MessageBox.Show("Voulez-vous vraiment enregistrer ?", "Enregistrement", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (resultEnr == DialogResult.Yes && gestionTypeTest.veriflongueur(enregistrement) == true)
            {
                if (TypeSelect != null && statut == true)//     modif typeselect celui de base ; statut == true
                {
                    if (gestionTypeTest.verifier(enregistrement, TypeSelect) == true)
                    {
                        gestionTypeTest.modifier(enregistrement);
                        TypeSelect = enregistrement;
                        this.Close();
                    }
                }
                else // ajout nouveau ou copie
                {
                    if (gestionTypeTest.verifAjout(enregistrement) == true)
                    {
                        gestionTypeTest.ajouter(enregistrement);
                        statut = true;
                        TypeSelect = enregistrement;
                        this.Close();
                    }
                }
            }
        }
예제 #11
0
        private void recherche()
        {
            if (txtRecherche.Text != "")
            {
                gridTypeTest.Rows.Clear();
                foreach (TypeTest t in gestionTypeTest.recherche(txtRecherche.Text))
                {
                    string[] tblTmp = new string[] { t.codeTypeTest, t.nomTypeTest, t.objectifTypeTest, t.descTypeTest, t.commentaireTypeTest };
                    int index = gridTypeTest.Rows.Add(tblTmp);
                    gridTypeTest.Rows[index].Tag = t;
                }

                if (gridTypeTest.RowCount != 0)
                {
                    gridTypeTest.Rows[0].Selected = true;
                    SelectTypeTest = (TypeTest)gridTypeTest.Rows[0].Tag;
                }
            }
            else
                MessageBox.Show("Le champ de recherche est vide", "erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
예제 #12
0
        private void modifierType()
        {
            frmDetTypeTest detailTT = new frmDetTypeTest(SelectTypeTest, true, lvlAcces);
            detailTT.ShowDialog();

            if(detailTT.statut == true)
            {
                SelectTypeTest = detailTT.TypeSelect;
                update();
            }
            else
            {
                int index = gestionTypeTest.RowByCode(SelectTypeTest.codeTypeTest, gridTypeTest);
                if (gridTypeTest.RowCount > (index + 1))
                    SelectTypeTest = (TypeTest)gridTypeTest.Rows[index + 1].Tag;
                else
                    SelectTypeTest = (TypeTest)gridTypeTest.Rows[index - 1].Tag;
                update();
            }
        }
예제 #13
0
 private void gridTypeTest_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex != -1)
     {
         gridTypeTest.Rows[e.RowIndex].Selected = true;
         SelectTypeTest = (TypeTest)gridTypeTest.Rows[e.RowIndex].Tag;
         modifierType();
     }
 }
예제 #14
0
 private void chargeObjet()
 {
     if (gridTypeTest.Rows.Count != 0)
     {
         gridTypeTest.Rows[0].Selected = true;
         SelectTypeTest = (TypeTest)gridTypeTest.Rows[0].Tag;
         gridTypeTest.Sort(gridTypeTest.Columns[0], ListSortDirection.Ascending);
     }
     btnDetails.Click += new EventHandler(btnDetails_Click);
     btnAjout.Click += new EventHandler(btnAjout_Click);
     btnRecherche.Click += new EventHandler(btnRecherche_Click);
     btnX.Click += new EventHandler(btnX_Click);
     this.txtRecherche.KeyDown += new KeyEventHandler(txtRecherche_KeyDown);
     btnDetails.Visible = true;
     btnAjout.Visible = true;
     btnRecherche.Visible = true;
     txtRecherche.Visible = true;
     btnX.Visible = true;
     this.Text = "Texcel : Gestion - Type test";
 }
예제 #15
0
        public List<TypeTest> recherche(string cle)
        {
            List<TypeTest> lstTT = new List<TypeTest>();

            foreach (var item in rTypeTestSQL.rechercheTypeTest(cle))
            {
                TypeTest tpt = new TypeTest(item);
                lstTT.Add(tpt);
            }
            return lstTT;
        }
예제 #16
0
        // verifie ajout
        public bool verifAjout(TypeTest nouv)
        {
            var lstBrut = rTypeTestSQL.getTypeTest();

            foreach (tblTypeTest item in lstBrut)
            {
                if (nouv.codeTypeTest == item.CodeTypeTest)
                {
                    if (nouv.nomTypeTest == item.NomTypeTest &&
                        nouv.objectifTypeTest == item.ObjectifTypeTest &&
                        nouv.descTypeTest == item.DescTypeTest &&
                        nouv.commentaireTypeTest == item.CommentaireTest)
                    {
                        MessageBox.Show("Vous ne pouvez pas enregistrer sans avoir effectuer de changement", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return false;
                    }
                    else
                    {
                        MessageBox.Show("Vous devez changer le code de type de test pour enregistrer", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return false;
                    }
                }
            }
            return true;
        }
예제 #17
0
 private void chargeTypeTest(TypeTest _t)
 {
     TypeSelect = _t;
     txtCode.Text = _t.codeTypeTest;
     txtNomTest.Text = _t.nomTypeTest;
     txtObjTest.Text = _t.objectifTypeTest;
     txtDescTest.Text = _t.descTypeTest;
     txtComTest.Text = _t.commentaireTypeTest;
 }