private void Carte_Checked(object sender, RoutedEventArgs e) { // Get RadioButton reference. var button = sender as RadioButton; string carte = button.Content.ToString(); switch (carte) { case ("Demo (5 Tours - 5x5 cases)"): this.typeCarte = TypeCarte.DEMO; break; case("Petit (20 Tours - 10x10 cases)"): this.typeCarte = TypeCarte.PETIT; break; case("Normale (30 Tours - 15x15 cases)"): this.typeCarte = TypeCarte.NORMAL; break; default: break; } }
public bool insert(TypeCarte typeCarte) { object[] values = new object[] { typeCarte.ReseauCarteStr, typeCarte.PlfGloPaiement, typeCarte.PlfGloPaiement , typeCarte.PeriodePlfPaiement, typeCarte.PlfGlobalRetraitExterne, typeCarte.PlfRetEtranger, typeCarte.PlfRetraitFrance , typeCarte.PeriodePlfGlobalRetrait, typeCarte.PlfGlobalRetraitInternes }; return(Connexion.insert(tableName, champs, values)); }
// Constructeurs ====================================================================================================== public Carte() { loadDescription(); _textEdit = false; _imageEdit = false; _type = TypeCarte.CARD; }
/// <summary> /// /// </summary> public Carte(string curNom, TypeCarte curTypeCarte, int curAttaque, int curSoin, int curAction, int curValeur = -1, Dictionary <string, decimal> curmodificateurJoueur = null, Dictionary <string, decimal> curmodificateurAdversaire = null) { this._nom = curNom; this._typeCarte = curTypeCarte; this._attaque = curAttaque; this._soin = curSoin; _action = curAction; if (curValeur == -1) { _valeurCarte = this._action; } else { _valeurCarte = curValeur; } if (curmodificateurJoueur == null) { _modificateurJoueur = new Dictionary <string, decimal>(); } else { _modificateurJoueur = curmodificateurJoueur; } if (curmodificateurAdversaire == null) { _modificateurAdversaire = new Dictionary <string, decimal>(); } else { _modificateurAdversaire = curmodificateurAdversaire; } }
public bool update(TypeCarte typeCarte) { object[] values = new object[] { typeCarte.ReseauCarteStr, typeCarte.PlfGloPaiement, typeCarte.PlfGloPaiement , typeCarte.PeriodePlfPaiement, typeCarte.PlfGlobalRetraitExterne, typeCarte.PlfRetEtranger, typeCarte.PlfRetraitFrance , typeCarte.PeriodePlfGlobalRetrait, typeCarte.PlfGlobalRetraitInternes }; object[] valuesWhere = new object[] { typeCarte.IdTypeCarte }; return(Connexion.update(tableName, champs, values, champsWhere, valuesWhere)); }
public FenRechercheTypeCarte(FenSaisirMoyenPaiement fenSaisirMoyenPaiement) { InitializeComponent(); this.fenSaisirMoyenPaiement = fenSaisirMoyenPaiement; cbReseau.Items.Add("Choisissez"); cbReseau.Items.AddRange(TypeCarte.getReseauCarteBancaire()); cbReseau.SelectedIndex = 0; initData(); txtId.Focus(); }
public void nouvellePartie(TypeCarte taille, TypeUnite typeJ1, TypeUnite typeJ2) { SmallWorld.Instance.carte = fabAutre.creerCarte(taille); SmallWorld.Instance.carte.initialiseVortexs(); SmallWorld.Instance.carte.print(); List<Joueur> joueurs = new List<Joueur>(); r = new Random(); SmallWorld.Instance.premierJoueur = r.Next(SmallWorld.NOMBRE_JOUEURS); SmallWorld.Instance.joueurCourant = SmallWorld.Instance.premierJoueur; Console.WriteLine("Premier joueur : " + SmallWorld.Instance.premierJoueur); joueurs.Add(fabAutre.creerJoueur(typeJ1, 0)); joueurs.Add(fabAutre.creerJoueur(typeJ2, 1)); SmallWorld.Instance.joueurs = joueurs; SmallWorld.Instance.nbTours = 0; int nombreUnites = SmallWorld.Instance.carte.getNombreUniteMax(); List<Coordonnee> posDepartJoueurs = SmallWorld.Instance.carte.getDepartJoueurs(); foreach (Joueur j in SmallWorld.Instance.joueurs) { switch (j.Peuple) { case TypeUnite.Gaulois: fabUnit = new FabriqueGaulois(); break; case TypeUnite.Viking: fabUnit = new FabriqueViking(); break; case TypeUnite.Nain: fabUnit = new FabriqueNain(); break; default: throw new Exception("Type unité non reconnue"); } for (int i = 0; i < nombreUnites; i++) { j.addUnite(fabUnit.fabriquerUnite(posDepartJoueurs[j.idJoueur])); } } }
/** * Methode permettant la creation d'une partie * tc Le type de la carte * tp Les peuples choisis par les joueurs * nomPartie Le nom de la partie */ public static IPartie CreerPartie(TypeCarte tc, List<TypePeuple> tp, string nomPartie) { StrategiePartie s; switch (tc) { case TypeCarte.DEMO: s = new MonteurDemo(); break; case TypeCarte.PETIT: s = new MonteurPetit(); break; case TypeCarte.NORMAL: s = new MonteurNormal(); break; default: s = new MonteurDemo(); break; } return s.CreerPartie(nomPartie, tp); }
/** * Lance une nouvelle partie */ public void nouvellePartie(TypeCarte tailleCarte, TypeUnite j1, TypeUnite j2) { MonteurPartie monteur = new MonteurPartie(); monteur.nouvellePartie(tailleCarte, j1, j2); nbTourMax = SmallWorld.Instance.carte.getNombreTours(); }
private void btCreer_Click(object sender, EventArgs e) { TypeCarte typeCarte = new TypeCarte(); try{ typeCarte.PlfGloPaiement = decimal.Parse(txtPlfGloPaiement.Text); } catch { MessageBox.Show("Le plafond global de paiment n'a pas été rensigné correctement", "Ajout d'une type de carte bancaire", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try{ typeCarte.PlfGloPaiementEtranger = decimal.Parse(txtPlfPaiementEtr.Text); } catch { MessageBox.Show("Le plafond de paiment à l'etranger n'a pas été rensigné correctement", "Ajout d'une type de carte bancaire", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try{ typeCarte.PeriodePlfPaiement = int.Parse(txtPeriodePlfPaiement.Text); } catch { MessageBox.Show("Le période du plafond de paiment n'a pas été rensigné correctement", "Ajout d'une type de carte bancaire", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try{ typeCarte.PlfGlobalRetraitExterne = decimal.Parse(txtPlfGloRetraitExt.Text); } catch { MessageBox.Show("Le plafond de retrait DAB externe n'a pas été rensigné correctement", "Ajout d'une type de carte bancaire", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try{ typeCarte.PlfGlobalRetraitInternes = decimal.Parse(txtPlfGloRetraitInt.Text); } catch { MessageBox.Show("Le plafond de retrait DAB interne n'a pas été rensigné correctement", "Ajout d'une type de carte bancaire", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try{ typeCarte.PlfRetEtranger = decimal.Parse(txtPlfRetraitEtr.Text); } catch { MessageBox.Show("Le plafond de retrait à l'étranger n'a pas été rensigné correctement", "Ajout d'une type de carte bancaire", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try{ typeCarte.PlfRetraitFrance = decimal.Parse(txtPlfRetraitFr.Text); } catch { MessageBox.Show("Le plafond de retrait en France n'a pas été rensigné correctement", "Ajout d'une type de carte bancaire", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try{ typeCarte.PeriodePlfGlobalRetrait = int.Parse(txtPeriodePlfRetrait.Text); } catch { MessageBox.Show("La période du plafond de retrait n'a pas été rensigné correctement", "Ajout d'une type de carte bancaire", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } typeCarte.ReseauCarteStr = cbReseau.SelectedText; if (BSGestionClient.InsertTypeCarte(typeCarte)) { MessageBox.Show("Le type de carte vient d'être ajouté", "Ajout d'une type de carte bancaire", MessageBoxButtons.OK, MessageBoxIcon.Information); if (callback != null) { callback.refresh(); } this.Close(); } else { Utilities.showErrorMessage("Erreur lors de l'insertion du type de carte", "Erreur"); } }
private void initUi() { cbReseau.Items.AddRange(TypeCarte.getReseauCarteBancaire()); cbReseau.SelectedIndex = 0; }
/// <summary> /// /// </summary> public Carte(string curNom, TypeCarte curTypeCarte, int curAttaque, int curSoin, int curAction, int curValeur = -1, Dictionary<string, decimal> curmodificateurJoueur = null, Dictionary<string, decimal> curmodificateurAdversaire = null) { this._nom = curNom; this._typeCarte = curTypeCarte; this._attaque = curAttaque; this._soin = curSoin; _action = curAction; if (curValeur == -1) { _valeurCarte = this._action; } else { _valeurCarte = curValeur; } if (curmodificateurJoueur == null) { _modificateurJoueur = new Dictionary<string, decimal>(); } else { _modificateurJoueur = curmodificateurJoueur; } if (curmodificateurAdversaire == null) { _modificateurAdversaire = new Dictionary<string, decimal>(); } else { _modificateurAdversaire = curmodificateurAdversaire; } }
public static bool InsertTypeCarte(TypeCarte typeCarte) { return(typeCarte.persist()); }
public Carte(TypeCarte NomCarte, ValeurCarte ValeurCarte, String CheminImage) { this.TypeCarte = NomCarte; this.ValeurCarte = ValeurCarte; this.ImageCarte = CheminImage; }
public bool delete(TypeCarte typeCarte) { return(Connexion.delete(tableName, champsWhere, new object[] { typeCarte.IdTypeCarte })); }
public Carte creerCarte(TypeCarte type) { return new Carte((int)type); }
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"); } } }
private void tailleClick(object sender, RoutedEventArgs e) { tailleDemo.Style = this.FindResource("smallButton") as Style; tailleNormale.Style = this.FindResource("smallButton") as Style; taillePetite.Style = this.FindResource("smallButton") as Style; Button clicked = (Button)sender; clicked.Style = this.FindResource("smallButtonActivated") as Style; switch (clicked.Name) { case "taillePetite": taille = TypeCarte.PETITE; break; case "tailleDemo": taille = TypeCarte.DEMO; break; case "tailleNoramle": taille = TypeCarte.NORMALE; break; default: taille = TypeCarte.NORMALE; break; } j1ButtonsActivate(); }