public bool insert(Chequier chequier) { object[] values = new object[] { chequier.Compte.IdCompte, chequier.LibelleMoyenPaiementStr, chequier.NombreCheque , chequier.Numero1Cheque, chequier.DernierCheque }; string[] parameters = new string[] { "ID_COMPTE", "LIBELLE_MOYEN_PAIEMENT", "NOMBRE_CHQ" , "NUMERO_1_CHQ", "NUMERO_D_CHQ" }; return(Connexion.callProcedureNonQuery("addChequier", parameters, values, true)); }
public static bool creerModifierChequier(Chequier chequier) { return(chequier.persist()); }
private void btAjoutMoyenPaiement_Click(object sender, EventArgs e) { if (rbChequier.Checked == true) { Chequier chequier = new Chequier(); try { chequier.DernierCheque = int.Parse(txtNbDernierCheque.Text); chequier.Numero1Cheque = int.Parse(txtNbPremierCheque.Text); chequier.NombreCheque = (int)cbNbCheques.SelectedItem; } catch (Exception) { MessageBox.Show("Les données saisies doivent être des nombres", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } chequier.LibelleMoyenPaiement = MoyenPaiement.TypeMoyenPaiement.Chequier; chequier.Compte = compte; if (BSGestionClient.creerModifierChequier(chequier)) { MessageBox.Show("Le chequier a été ajouté à la base", "Ajout moyen paiement", MessageBoxButtons.OK, MessageBoxIcon.Information); if (callabck != null) { callabck.refresh(); } this.Close(); } else { Utilities.showErrorMessage("Erreur lors de l'ajout du chequier", "Erreur"); } } else if (rbCarteBancaire.Checked == true) { if (string.IsNullOrEmpty(txtNoCarte.Text)) { Utilities.showErrorMessage("Veuillez saisir le numéro de carte", "Numéro de carte"); return; } Carte carte = new Carte(); TypeCarte typeCarte = new TypeCarte(); try { typeCarte.IdTypeCarte = int.Parse(txtIdTypeCarte.Text); } catch (Exception) { Utilities.showErrorMessage("Le type de carte doit être correctement saisie", "Type de carte"); return; } carte.NumeroCarte = txtNoCarte.Text; carte.DateDebValidite = dtDateDebut.Value; carte.DateFinValidite = dtDateFin.Value; carte.Compte = compte; carte.LibelleMoyenPaiement = MoyenPaiement.TypeMoyenPaiement.Carte; carte.TypeCarte = typeCarte; if (BSGestionClient.creerModifierCarte(carte)) { MessageBox.Show("Le moyen de paiement à été ajouté à la base", "Ajout moyen paiement", MessageBoxButtons.OK, MessageBoxIcon.Information); if (callabck != null) { callabck.refresh(); } this.Close(); } else { Utilities.showErrorMessage("Erreur lors de la création de la carte", "Erreur"); } } }
public bool update(Chequier chequier) { object[] values = new object[] { chequier.IdMoyenPaiement, chequier.NombreCheque, chequier.Numero1Cheque, chequier.DernierCheque }; object[] valuesWhere = new object[] { chequier.IdMoyenPaiement }; return(Connexion.update(tableName, champs, values, champsWhere, valuesWhere)); }
public bool delete(Chequier chequier) { return(Connexion.callProcedureNonQuery("delChequier", new string[] { "P_ID_MOYEN_PAIEMENT" }, new object[] { chequier.IdMoyenPaiement }, false)); }