public void RaffraichirGrid() { DGVDoctorants.Rows.Clear(); r = 0; DAL.DALDoctorant D = new DAL.DALDoctorant(); dt = D.NewSelect(); string NomPrenom = ""; string CIN_Passeport = ""; for (int i = 0; i < dt.Rows.Count; i++) { CIN_Passeport = dt.Rows[i][1].ToString().Trim(); NomPrenom = "" + dt.Rows[i][2].ToString().Trim() + " " + dt.Rows[i][3].ToString().Trim(); DGVDoctorants.Rows.Add(CIN_Passeport, NomPrenom, dt.Rows[i][4].ToString().Trim(), dt.Rows[i][5].ToString().Trim(), dt.Rows[i][6].ToString().Trim()); } cmbCritereFr.Text = ""; cmbCritereFr.SelectedIndex = -1; labelValeur.Visible = false; cmbValeurFr.Visible = false; btnChercher.Visible = false; cmbCritereFr.Text = ""; cmbCritereFr.SelectedIndex = -1; labelValeur.Visible = false; cmbValeurFr.Visible = false; btnChercher.Visible = false; }
public bool ExistErreur() { DAL.DALDoctorant D = new DAL.DALDoctorant(); int x = D.ChechkCIN_PasseportUnicity(txtCin.Text); if ((txtCin.Text == "") || (txtCin.Text.Length < 8) || (txtNumInsc.Text == "") || (txtNomFr.Text == "") || (txtPrenomFr.Text == "") || (txtNomAr.Text == "") || (txtPrenomAr.Text == "") || (x != 0) || (cmbxSexe.Text == "") || (txtLieuNaiss.Text == "") || (cmbxNationalite.Text == "") || (cmbxCivilite.Text == "") || (txtMail.Text == "") || (IsValidMail(txtMail.Text) == false) || (txtTel.Text == "") || (txtGouvernat.Text == "") || (txtVille.Text == "") || (txtCodePost.Text == "") || (txtAdresse.Text == "") || (cmbxDerDiplome.Text == "") || (cmbxEcoleDoctoral.Text == "") || (txtSujet.Text == "") //|| (cmbVilleFr.Text == "") || || (txtAdresseAr.Text == "") //|| (txtCodePostaleFr.Text == "") || (cmbGradeFr.Text == "") || (cmbStatutFr.Text == "") || (cmbAffiliationFr.Text == "") //|| (txtRibFr.Text == "") || (txtIdentifiantUnique.Text == "") || (cmbDiplomeFr.Text == "") || (cmbDiplomeFr.Text == "") //|| (txtAliasFr.Text == "") || (cmbVilleAr.Text == "") ) { return(true); } else { return(false); } }
private void panelEnregistrer_Click_1(object sender, EventArgs e) { bool res = ExistErreur(); Entities.Doctorant Doct = new Entities.Doctorant(); //Entitée.DossierAffectation DA = new Entitée.DossierAffectation(); DataTable dt1 = new DataTable(); if (res == true) { AfficherErreur(); } else { Doct = GetDoctorantFromInterface(); // DA = GetDossierFromInterface(); //try //{ DAL.DALDoctorant D = new DAL.DALDoctorant(); D.InsertDoctorant(Doct); dt1 = D.SelectIdByCIN(Doct.CIN_Passeport); int IdDoct = int.Parse(dt1.Rows[0][0].ToString()); MessageBox.Show("Opération d'ajout bien éffectuée"); this.Close(); } }
private void cmbCritereFr_SelectedIndexChanged(object sender, EventArgs e) { string table = ""; string critere = cmbCritereFr.Text; DataTable dt2 = new DataTable(); if ((cmbCritereFr.Text == "Tous") || (cmbCritereFr.SelectedIndex == -1)) { r = 0; RaffraichirGrid(); } else { r = 1; labelValeur.Visible = true; cmbValeurFr.Visible = true; btnChercher.Visible = true; //if (cmbCritereFr.Text == "Situation Actuelle") //{ // cmbValeurFr.DataSource = null; // cmbValeurFr.Items.Clear(); // DAL.DALTypeSituationAdministrative S = new DAL.DALTypeSituationAdministrative(); // dt2 = S.SelectAllStatut(); // cmbValeurFr.DataSource = dt2; // cmbValeurFr.DisplayMember = "Code"; // cmbValeurFr.ValueMember = "IdTypeSituationAdmin"; // cmbValeurFr.SelectedIndex = -1; //} //if (cmbCritereFr.Text == "Département") //{ // cmbValeurFr.DataSource = null; // cmbValeurFr.Items.Clear(); // DAL.DALDepartement D = new DAL.DALDepartement(); // dt2 = D.SelectAllDepartement(); // cmbValeurFr.DataSource = dt2; // cmbValeurFr.DisplayMember = "Code"; // cmbValeurFr.ValueMember = "IdDepartement"; // cmbValeurFr.SelectedIndex = -1; //} //if (cmbCritereFr.Text == "Position Actuelle") //{ // critere = "TypeAdmission"; // table = "DossierAffectation"; // cmbValeurFr.DataSource = null; // cmbValeurFr.Items.Clear(); // cmbValeurFr.Text = ""; // DAL.DALEnseignant E = new DAL.DALEnseignant(); // dt2 = E.SelectValue(critere, table); // for (int i = 0; i < dt2.Rows.Count; i++) // { // cmbValeurFr.Items.Add(dt2.Rows[i][0]); // } //} if (cmbCritereFr.Text == "Nom") { critere = "NomFr"; table = "Doctorant"; cmbValeurFr.DataSource = null; cmbValeurFr.Items.Clear(); cmbValeurFr.Text = ""; DAL.DALDoctorant D = new DAL.DALDoctorant(); dt2 = D.SelectValue(critere, table); for (int i = 0; i < dt2.Rows.Count; i++) { cmbValeurFr.Items.Add(dt2.Rows[i][0]); } } //if (cmbCritereFr.Text == "Prénom") //{ // critere = "PrenomFr"; // table = "Enseignant where EtatActuel='Actif'"; // cmbValeurFr.DataSource = null; // cmbValeurFr.Items.Clear(); // cmbValeurFr.Text = ""; // DAL.DALEnseignant E = new DAL.DALEnseignant(); // dt2 = E.SelectValue(critere, table); // for (int i = 0; i < dt2.Rows.Count; i++) // { // cmbValeurFr.Items.Add(dt2.Rows[i][0]); // } //} //if (cmbCritereFr.Text == "CIN") //{ // critere = "CIN"; // table = "Enseignant where EtatActuel='Actif'"; // cmbValeurFr.DataSource = null; // cmbValeurFr.Items.Clear(); // cmbValeurFr.Text = ""; // DAL.DALEnseignant E = new DAL.DALEnseignant(); // dt2 = E.SelectValue(critere, table); // for (int i = 0; i < dt2.Rows.Count; i++) // { // cmbValeurFr.Items.Add(dt2.Rows[i][0]); // } //} //if (cmbCritereFr.Text == "Promotion") //{ // critere = "IdTypePromotion"; // table = "DossierAffectation"; // cmbValeurFr.DataSource = null; // cmbValeurFr.Items.Clear(); // cmbValeurFr.Text = ""; // DAL.DALEnseignant E = new DAL.DALEnseignant(); // DAL.DALTypePromotion P = new DAL.DALTypePromotion(); // dt2 = P.SelectAllGrade(); // cmbValeurFr.DataSource = dt2; // cmbValeurFr.ValueMember = "IdTypePromotion"; // cmbValeurFr.DisplayMember = "Code"; // cmbValeurFr.SelectedIndex = -1; //} } }
public void RemplirFiche() { DAL.DALDoctorant E = new DAL.DALDoctorant(); dt10 = E.SelectByCIN_Passeport(CIN_Passeport); if ((CIN_Passeport != "") && (E.ChechkCIN_PasseportUnicity(CIN_Passeport) == 1)) { txtCin.Text = dt10.Rows[0][1].ToString().Trim(); } txtNumInsc.Text = dt10.Rows[0][2].ToString().Trim(); txtNomFr.Text = dt10.Rows[0][3].ToString().Trim(); txtNomAr.Text = dt10.Rows[0][4].ToString().Trim(); txtPrenomFr.Text = dt10.Rows[0][5].ToString().Trim(); txtPrenomAr.Text = dt10.Rows[0][6].ToString().Trim(); txtNomJeuFilleFr.Text = dt10.Rows[0][7].ToString().Trim(); txtNomJeuFilleAr.Text = dt10.Rows[0][8].ToString().Trim(); cmbxSexe.Text = dt10.Rows[0][10].ToString().Trim(); DateTimePickerDateNaissance.Value = (DateTime)(dt10.Rows[0][11]); txtLieuNaiss.Text = dt10.Rows[0][12].ToString().Trim(); cmbxNationalite.Text = dt10.Rows[0][13].ToString().Trim(); cmbxPaysOrig.Text = dt10.Rows[0][14].ToString().Trim(); cmbxCivilite.Text = dt10.Rows[0][15].ToString().Trim(); txtProfession.Text = dt10.Rows[0][16].ToString().Trim(); txtEmployeur.Text = dt10.Rows[0][17].ToString().Trim(); txtMail.Text = dt10.Rows[0][18].ToString().Trim(); txtTel.Text = dt10.Rows[0][19].ToString().Trim(); txtAdresse.Text = dt10.Rows[0][20].ToString().Trim(); txtVille.Text = dt10.Rows[0][21].ToString().Trim(); txtGouvernat.Text = dt10.Rows[0][22].ToString().Trim(); txtCodePost.Text = dt10.Rows[0][23].ToString().Trim(); cmbxDerDiplome.Text = dt10.Rows[0][24].ToString().Trim(); dateTimePickerDateObt.Value = (DateTime)(dt10.Rows[0][25]); txtLieuObtention.Text = dt10.Rows[0][26].ToString().Trim(); cmbxEcoleDoctoral.Text = dt10.Rows[0][27].ToString().Trim(); cmbxSpecialite.Text = dt10.Rows[0][28].ToString().Trim(); txtSujet.Text = dt10.Rows[0][29].ToString().Trim(); cmbxStatut.Text = dt10.Rows[0][30].ToString().Trim(); cmbxEtatPaiAc.Text = dt10.Rows[0][31].ToString().Trim(); //cmbxEncadrant.SelectedValue =int.Parse( dt10.Rows[0][30].ToString()); //averifier //cmbxCoEncadrant.SelectedValue =int.Parse( dt10.Rows[0][31].ToString()); TxtObs.Text = dt10.Rows[0][39].ToString().Trim(); if (dt10.Rows[0][9].ToString() != "") { byte[] img = (byte[])(dt10.Rows[0][9]); MemoryStream ms = new MemoryStream(img); pictureBox1.Image = Image.FromStream(ms); } //DAL.DALDossierAffectation DA = new DAL.DALDossierAffectation(); //dt20 = DA.SelectDossierAffectation(int.Parse(dt10.Rows[0][0].ToString())); //cmbDiplomeFr.Text = dt20.Rows[0][2].ToString().Trim(); //cmbGradeFr.SelectedValue = int.Parse(dt20.Rows[0][3].ToString()); //txtNiveau.Text = dt20.Rows[0][3].ToString(); }
public void RemplirFiche(int id) { DAL.DALDoctorant D = new DAL.DALDoctorant(); dt2 = D.SelectDoctorant(id); lblConsCIN.Text = dt2.Rows[0][1].ToString().Trim(); lblConsNumInsc.Text = dt2.Rows[0][2].ToString().Trim(); lblConNomPrenom.Text = dt2.Rows[0][3].ToString().Trim() + " " + dt2.Rows[0][5].ToString().Trim(); lblConNomPrAr.Text = dt2.Rows[0][4].ToString().Trim() + " " + dt2.Rows[0][6].ToString().Trim(); lblConNomJeuFilFr.Text = dt2.Rows[0][7].ToString().Trim(); lblConNomJeuFilAr.Text = dt2.Rows[0][8].ToString().Trim(); lblConSexe.Text = dt2.Rows[0][10].ToString().Trim(); lblConDatNaiss.Text = dt2.Rows[0][11].ToString().Trim(); lblConLieuNaiss.Text = dt2.Rows[0][12].ToString().Trim(); lblConNat.Text = dt2.Rows[0][13].ToString().Trim(); lblConPaysOrig.Text = dt2.Rows[0][14].ToString().Trim(); lblConCivilite.Text = dt2.Rows[0][15].ToString().Trim(); lblConProfon.Text = dt2.Rows[0][16].ToString().Trim(); lblConEmploy.Text = dt2.Rows[0][17].ToString().Trim(); lblConEmail.Text = dt2.Rows[0][18].ToString().Trim(); lblConTel.Text = dt2.Rows[0][19].ToString().Trim(); lblConAdress.Text = dt2.Rows[0][20].ToString().Trim(); lblConVill.Text = dt2.Rows[0][21].ToString().Trim(); lblConGouv.Text = dt2.Rows[0][22].ToString().Trim(); lblConPost.Text = dt2.Rows[0][23].ToString().Trim(); lblConDerDip.Text = dt2.Rows[0][24].ToString().Trim(); lblConDateDip.Text = dt2.Rows[0][25].ToString().Trim(); lblConLieuDip.Text = dt2.Rows[0][26].ToString().Trim(); lblConEcoDoct.Text = dt2.Rows[0][27].ToString().Trim(); lblConsSpec.Text = dt2.Rows[0][28].ToString().Trim(); lblConSujet.Text = dt2.Rows[0][29].ToString().Trim(); lblConStatut.Text = dt2.Rows[0][30].ToString().Trim(); lblConEtatPai.Text = dt2.Rows[0][31].ToString(); //label20.Text = dt2.Rows[0][4].ToString().Trim() + " " + dt2.Rows[0][6].ToString().Trim(); //TAlias.Text = dt2.Rows[0][12].ToString().Trim(); //TSexe.Text = dt2.Rows[0][13].ToString().Trim(); //TDateNaissance.Text = ((DateTime)dt2.Rows[0][14]).ToString("dd/M/yyyy"); //TLieuNaissance.Text = dt2.Rows[0][15].ToString().Trim(); //TNationnalite.Text = dt2.Rows[0][17].ToString().Trim(); //txtCivilite.Text = dt2.Rows[0][19].ToString().Trim(); //txtNbEnfant.Text = dt2.Rows[0][20].ToString().Trim(); //TTel1.Text = dt2.Rows[0][21].ToString().Trim(); //TTel2.Text = dt2.Rows[0][22].ToString().Trim(); //TMail.Text = dt2.Rows[0][23].ToString().Trim(); //TAdresse.Text = dt2.Rows[0][24].ToString().Trim(); //TVille.Text = dt2.Rows[0][26].ToString().Trim(); //TCodePostale.Text = dt2.Rows[0][28].ToString().Trim(); //TDepartement.Text = d.NomFr.Trim(); //TDiplome.Text = dt7.Rows[0][2].ToString().Trim(); //DAL.DALTypePromotion TD = new DAL.DALTypePromotion(); //Entitée.TypePromotion P = new Entitée.TypePromotion(); //P = TD.SelectById(int.Parse(dt7.Rows[0][3].ToString().Trim())); //TGrade.Text = P.Code.Trim(); //txtTypeAdmission.Text = dt7.Rows[0][5].ToString().Trim(); //TPeriode.Text = dt7.Rows[0][7].ToString().Trim(); //txtAnneeUniver.Text = dt7.Rows[0][6].ToString().Trim(); if (dt2.Rows[0][9].ToString() != "") { byte[] img = (byte[])(dt2.Rows[0][9]); MemoryStream ms = new MemoryStream(img); pictureBox1.Image = Image.FromStream(ms); } //TxtObs.Text = dt2.Rows[0][35].ToString().Trim(); }