diff --git a/Arti4/Arti4/UserControls/Jeu/UC_Recettes_Publiques.Designer.cs b/Arti4/Arti4/UserControls/Jeu/UC_Recettes_Publiques.Designer.cs index 8df434ec1e7bd9b980d29c0ebb23272a541c0555..c92ad73d9609a7883586f6214fd4f4929a1560c2 100644 --- a/Arti4/Arti4/UserControls/Jeu/UC_Recettes_Publiques.Designer.cs +++ b/Arti4/Arti4/UserControls/Jeu/UC_Recettes_Publiques.Designer.cs @@ -28,8 +28,8 @@ /// </summary> private void InitializeComponent() { - this.button4 = new System.Windows.Forms.Button(); - this.button10 = new System.Windows.Forms.Button(); + this.btnUpRevenu = new System.Windows.Forms.Button(); + this.btnDownRevenu = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.textBox5 = new System.Windows.Forms.TextBox(); @@ -37,15 +37,15 @@ this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); - this.textBox1 = new System.Windows.Forms.TextBox(); + this.txtRevenu = new System.Windows.Forms.TextBox(); this.textBox2 = new System.Windows.Forms.TextBox(); - this.textBox3 = new System.Windows.Forms.TextBox(); + this.txtBenef = new System.Windows.Forms.TextBox(); this.textBox4 = new System.Windows.Forms.TextBox(); - this.textBox6 = new System.Windows.Forms.TextBox(); - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.button3 = new System.Windows.Forms.Button(); - this.button5 = new System.Windows.Forms.Button(); + this.txtTVA = new System.Windows.Forms.TextBox(); + this.btnDownBenef = new System.Windows.Forms.Button(); + this.btnUpBenef = new System.Windows.Forms.Button(); + this.btnDownTVA = new System.Windows.Forms.Button(); + this.btnUpTVA = new System.Windows.Forms.Button(); this.pbTVA = new System.Windows.Forms.PictureBox(); this.pbBene = new System.Windows.Forms.PictureBox(); this.pbRevenu = new System.Windows.Forms.PictureBox(); @@ -54,25 +54,27 @@ ((System.ComponentModel.ISupportInitialize)(this.pbRevenu)).BeginInit(); this.SuspendLayout(); // - // button4 + // btnUpRevenu // - this.button4.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.25F); - this.button4.Location = new System.Drawing.Point(486, 329); - this.button4.Name = "button4"; - this.button4.Size = new System.Drawing.Size(44, 44); - this.button4.TabIndex = 3; - this.button4.Text = "^"; - this.button4.UseVisualStyleBackColor = true; + this.btnUpRevenu.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.25F); + this.btnUpRevenu.Location = new System.Drawing.Point(486, 329); + this.btnUpRevenu.Name = "btnUpRevenu"; + this.btnUpRevenu.Size = new System.Drawing.Size(44, 44); + this.btnUpRevenu.TabIndex = 3; + this.btnUpRevenu.Text = "^"; + this.btnUpRevenu.UseVisualStyleBackColor = true; + this.btnUpRevenu.Click += new System.EventHandler(this.btnUpRevenu_Click); // - // button10 + // btnDownRevenu // - this.button10.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.25F); - this.button10.Location = new System.Drawing.Point(436, 329); - this.button10.Name = "button10"; - this.button10.Size = new System.Drawing.Size(44, 44); - this.button10.TabIndex = 9; - this.button10.Text = "v"; - this.button10.UseVisualStyleBackColor = true; + this.btnDownRevenu.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.25F); + this.btnDownRevenu.Location = new System.Drawing.Point(436, 329); + this.btnDownRevenu.Name = "btnDownRevenu"; + this.btnDownRevenu.Size = new System.Drawing.Size(44, 44); + this.btnDownRevenu.TabIndex = 9; + this.btnDownRevenu.Text = "v"; + this.btnDownRevenu.UseVisualStyleBackColor = true; + this.btnDownRevenu.Click += new System.EventHandler(this.btnDownRevenu_Click); // // label1 // @@ -97,6 +99,7 @@ // textBox5 // this.textBox5.Enabled = false; + this.textBox5.Font = new System.Drawing.Font("Cambria", 15.70909F); this.textBox5.Location = new System.Drawing.Point(161, 329); this.textBox5.Multiline = true; this.textBox5.Name = "textBox5"; @@ -143,90 +146,105 @@ this.label7.TabIndex = 51; this.label7.Text = "Recettes Publiques\r\n"; // - // textBox1 + // txtRevenu // - this.textBox1.Enabled = false; - this.textBox1.Location = new System.Drawing.Point(292, 329); - this.textBox1.Multiline = true; - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(125, 44); - this.textBox1.TabIndex = 52; + this.txtRevenu.Font = new System.Drawing.Font("Cambria", 15.70909F); + this.txtRevenu.Location = new System.Drawing.Point(292, 329); + this.txtRevenu.Multiline = true; + this.txtRevenu.Name = "txtRevenu"; + this.txtRevenu.Size = new System.Drawing.Size(125, 44); + this.txtRevenu.TabIndex = 52; + this.txtRevenu.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtRevenu.TextChanged += new System.EventHandler(this.txtRevenu_TextChanged); + this.txtRevenu.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtTVA_KeyPress); // // textBox2 // this.textBox2.Enabled = false; + this.textBox2.Font = new System.Drawing.Font("Cambria", 15.70909F); this.textBox2.Location = new System.Drawing.Point(161, 218); this.textBox2.Multiline = true; this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(125, 44); this.textBox2.TabIndex = 53; // - // textBox3 + // txtBenef // - this.textBox3.Enabled = false; - this.textBox3.Location = new System.Drawing.Point(292, 218); - this.textBox3.Multiline = true; - this.textBox3.Name = "textBox3"; - this.textBox3.Size = new System.Drawing.Size(125, 44); - this.textBox3.TabIndex = 54; + this.txtBenef.Font = new System.Drawing.Font("Cambria", 15.70909F); + this.txtBenef.Location = new System.Drawing.Point(292, 218); + this.txtBenef.Multiline = true; + this.txtBenef.Name = "txtBenef"; + this.txtBenef.Size = new System.Drawing.Size(125, 44); + this.txtBenef.TabIndex = 54; + this.txtBenef.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtBenef.TextChanged += new System.EventHandler(this.txtBenef_TextChanged); + this.txtBenef.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtTVA_KeyPress); // // textBox4 // this.textBox4.Enabled = false; + this.textBox4.Font = new System.Drawing.Font("Cambria", 15.70909F); this.textBox4.Location = new System.Drawing.Point(161, 115); this.textBox4.Multiline = true; this.textBox4.Name = "textBox4"; this.textBox4.Size = new System.Drawing.Size(125, 44); this.textBox4.TabIndex = 55; // - // textBox6 - // - this.textBox6.Enabled = false; - this.textBox6.Location = new System.Drawing.Point(292, 115); - this.textBox6.Multiline = true; - this.textBox6.Name = "textBox6"; - this.textBox6.Size = new System.Drawing.Size(125, 44); - this.textBox6.TabIndex = 56; - // - // button1 - // - this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.25F); - this.button1.Location = new System.Drawing.Point(436, 218); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(44, 44); - this.button1.TabIndex = 58; - this.button1.Text = "v"; - this.button1.UseVisualStyleBackColor = true; - // - // button2 - // - this.button2.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.25F); - this.button2.Location = new System.Drawing.Point(486, 218); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(44, 44); - this.button2.TabIndex = 57; - this.button2.Text = "^"; - this.button2.UseVisualStyleBackColor = true; - // - // button3 - // - this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.25F); - this.button3.Location = new System.Drawing.Point(436, 114); - this.button3.Name = "button3"; - this.button3.Size = new System.Drawing.Size(44, 44); - this.button3.TabIndex = 60; - this.button3.Text = "v"; - this.button3.UseVisualStyleBackColor = true; - // - // button5 - // - this.button5.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.25F); - this.button5.Location = new System.Drawing.Point(486, 114); - this.button5.Name = "button5"; - this.button5.Size = new System.Drawing.Size(44, 44); - this.button5.TabIndex = 59; - this.button5.Text = "^"; - this.button5.UseVisualStyleBackColor = true; + // txtTVA + // + this.txtTVA.Font = new System.Drawing.Font("Cambria", 15.70909F); + this.txtTVA.Location = new System.Drawing.Point(292, 115); + this.txtTVA.Multiline = true; + this.txtTVA.Name = "txtTVA"; + this.txtTVA.Size = new System.Drawing.Size(125, 44); + this.txtTVA.TabIndex = 56; + this.txtTVA.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtTVA.TextChanged += new System.EventHandler(this.txtTVA_TextChanged); + this.txtTVA.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtTVA_KeyPress); + // + // btnDownBenef + // + this.btnDownBenef.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.25F); + this.btnDownBenef.Location = new System.Drawing.Point(436, 218); + this.btnDownBenef.Name = "btnDownBenef"; + this.btnDownBenef.Size = new System.Drawing.Size(44, 44); + this.btnDownBenef.TabIndex = 58; + this.btnDownBenef.Text = "v"; + this.btnDownBenef.UseVisualStyleBackColor = true; + this.btnDownBenef.Click += new System.EventHandler(this.btnDownBenef_Click); + // + // btnUpBenef + // + this.btnUpBenef.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.25F); + this.btnUpBenef.Location = new System.Drawing.Point(486, 218); + this.btnUpBenef.Name = "btnUpBenef"; + this.btnUpBenef.Size = new System.Drawing.Size(44, 44); + this.btnUpBenef.TabIndex = 57; + this.btnUpBenef.Text = "^"; + this.btnUpBenef.UseVisualStyleBackColor = true; + this.btnUpBenef.Click += new System.EventHandler(this.btnUpBenef_Click); + // + // btnDownTVA + // + this.btnDownTVA.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.25F); + this.btnDownTVA.Location = new System.Drawing.Point(436, 114); + this.btnDownTVA.Name = "btnDownTVA"; + this.btnDownTVA.Size = new System.Drawing.Size(44, 44); + this.btnDownTVA.TabIndex = 60; + this.btnDownTVA.Text = "v"; + this.btnDownTVA.UseVisualStyleBackColor = true; + this.btnDownTVA.Click += new System.EventHandler(this.btnDownTVA_Click); + // + // btnUpTVA + // + this.btnUpTVA.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.25F); + this.btnUpTVA.Location = new System.Drawing.Point(486, 114); + this.btnUpTVA.Name = "btnUpTVA"; + this.btnUpTVA.Size = new System.Drawing.Size(44, 44); + this.btnUpTVA.TabIndex = 59; + this.btnUpTVA.Text = "^"; + this.btnUpTVA.UseVisualStyleBackColor = true; + this.btnUpTVA.Click += new System.EventHandler(this.btnUpTVA_Click); // // pbTVA // @@ -268,15 +286,15 @@ this.Controls.Add(this.pbRevenu); this.Controls.Add(this.pbBene); this.Controls.Add(this.pbTVA); - this.Controls.Add(this.button3); - this.Controls.Add(this.button5); - this.Controls.Add(this.button1); - this.Controls.Add(this.button2); - this.Controls.Add(this.textBox6); + this.Controls.Add(this.btnDownTVA); + this.Controls.Add(this.btnUpTVA); + this.Controls.Add(this.btnDownBenef); + this.Controls.Add(this.btnUpBenef); + this.Controls.Add(this.txtTVA); this.Controls.Add(this.textBox4); - this.Controls.Add(this.textBox3); + this.Controls.Add(this.txtBenef); this.Controls.Add(this.textBox2); - this.Controls.Add(this.textBox1); + this.Controls.Add(this.txtRevenu); this.Controls.Add(this.label7); this.Controls.Add(this.label5); this.Controls.Add(this.label4); @@ -284,8 +302,8 @@ this.Controls.Add(this.textBox5); this.Controls.Add(this.label2); this.Controls.Add(this.label1); - this.Controls.Add(this.button10); - this.Controls.Add(this.button4); + this.Controls.Add(this.btnDownRevenu); + this.Controls.Add(this.btnUpRevenu); this.Name = "UC_Recettes_Publiques"; this.Size = new System.Drawing.Size(631, 449); this.Load += new System.EventHandler(this.UC_Choix_1_Load); @@ -298,8 +316,8 @@ } #endregion - private System.Windows.Forms.Button button4; - private System.Windows.Forms.Button button10; + private System.Windows.Forms.Button btnUpRevenu; + private System.Windows.Forms.Button btnDownRevenu; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox textBox5; @@ -307,15 +325,15 @@ private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label7; - private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox txtRevenu; private System.Windows.Forms.TextBox textBox2; - private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.TextBox txtBenef; private System.Windows.Forms.TextBox textBox4; - private System.Windows.Forms.TextBox textBox6; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Button button2; - private System.Windows.Forms.Button button3; - private System.Windows.Forms.Button button5; + private System.Windows.Forms.TextBox txtTVA; + private System.Windows.Forms.Button btnDownBenef; + private System.Windows.Forms.Button btnUpBenef; + private System.Windows.Forms.Button btnDownTVA; + private System.Windows.Forms.Button btnUpTVA; private System.Windows.Forms.PictureBox pbTVA; private System.Windows.Forms.PictureBox pbBene; private System.Windows.Forms.PictureBox pbRevenu; diff --git a/Arti4/Arti4/UserControls/Jeu/UC_Recettes_Publiques.cs b/Arti4/Arti4/UserControls/Jeu/UC_Recettes_Publiques.cs index c3577674e69fb70763e43f6775686b82175ca2a7..779ce9e2841a13c4ef41916245018369860d4120 100644 --- a/Arti4/Arti4/UserControls/Jeu/UC_Recettes_Publiques.cs +++ b/Arti4/Arti4/UserControls/Jeu/UC_Recettes_Publiques.cs @@ -29,6 +29,114 @@ namespace Arti4 ToolTip tltRevenu = new ToolTip(); tltRevenu.SetToolTip(pbRevenu, "Impôt sur les ménages et particuliers"); + + if (Partie.Instance.Tva_value <= 1) + { + txtTVA.Text = (Partie.Instance.Tva_value * 100).ToString(); + } + else + { + txtTVA.Text = Partie.Instance.Tva_value.ToString(); + } + + if (Partie.Instance.Impot_societe_value <= 1) + { + txtBenef.Text = (Partie.Instance.Impot_societe_value * 100).ToString(); + } + else + { + txtBenef.Text = Partie.Instance.Impot_societe_value.ToString(); + } + + if (Partie.Instance.Impot_revenue_value <= 1) + { + + txtRevenu.Text = (Partie.Instance.Impot_revenue_value * 100).ToString(); + } + else + { + txtRevenu.Text = Partie.Instance.Impot_revenue_value.ToString(); + } + + + + } + + private void btnUpTVA_Click(object sender, EventArgs e) + { + int value = 0; + if (txtTVA.Text.Length != 0) + value = int.Parse(txtTVA.Text); + txtTVA.Text = (value + 1).ToString(); + } + + private void btnDownTVA_Click(object sender, EventArgs e) + { + int value = 0; + if (txtTVA.Text.Length != 0) + value = int.Parse(txtTVA.Text); + if (value == 0) + return; + txtTVA.Text = (value - 1).ToString(); + } + + private void btnUpBenef_Click(object sender, EventArgs e) + { + int value = 0; + if (txtBenef.Text.Length != 0) + value = int.Parse(txtBenef.Text); + txtBenef.Text = (value + 1).ToString(); + } + + private void btnDownBenef_Click(object sender, EventArgs e) + { + int value = 0; + if (txtBenef.Text.Length != 0) + value = int.Parse(txtBenef.Text); + if (value == 0) + return; + txtBenef.Text = (value - 1).ToString(); + } + + private void btnUpRevenu_Click(object sender, EventArgs e) + { + int value = 0; + if (txtRevenu.Text.Length != 0) + value = int.Parse(txtRevenu.Text); + txtRevenu.Text = (value + 1).ToString(); + } + + private void btnDownRevenu_Click(object sender, EventArgs e) + { + int value = 0; + if (txtRevenu.Text.Length != 0) + value = int.Parse(txtRevenu.Text); + if (value == 0) + return; + txtRevenu.Text = (value - 1).ToString(); + } + + private void txtTVA_TextChanged(object sender, EventArgs e) + { + Partie.Instance.Tva_value = float.Parse(txtTVA.Text)/100; + } + + private void txtBenef_TextChanged(object sender, EventArgs e) + { + Partie.Instance.Impot_societe_value = float.Parse(txtBenef.Text)/100; + } + + private void txtRevenu_TextChanged(object sender, EventArgs e) + { + Partie.Instance.Impot_revenue_value = float.Parse(txtRevenu.Text)/100; + } + + private void txtTVA_KeyPress(object sender, KeyPressEventArgs e) + { + if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) || ((sender as TextBox).Text.Length>=2) && (!char.IsControl(e.KeyChar)) || ((sender as TextBox).Text.Length == 1) && (char.IsControl(e.KeyChar))) + { + e.Handled = true; + } } } } diff --git a/Arti4/Arti4/UserControls/UC_Scenario.Designer.cs b/Arti4/Arti4/UserControls/UC_Scenario.Designer.cs index 2b78e0b3b705187ab468c31e860ed116e2662451..bed6709739aa95cc5e029feb4ac6a772af2b1d4e 100644 --- a/Arti4/Arti4/UserControls/UC_Scenario.Designer.cs +++ b/Arti4/Arti4/UserControls/UC_Scenario.Designer.cs @@ -31,21 +31,23 @@ this.btnScenar1 = new System.Windows.Forms.Button(); this.btnScenar2 = new System.Windows.Forms.Button(); this.btnScenar3 = new System.Windows.Forms.Button(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // // btnScenar1 // - this.btnScenar1.Location = new System.Drawing.Point(37, 104); + this.btnScenar1.Location = new System.Drawing.Point(165, 90); this.btnScenar1.Name = "btnScenar1"; this.btnScenar1.Size = new System.Drawing.Size(190, 136); this.btnScenar1.TabIndex = 0; - this.btnScenar1.Text = "Scénario 1"; + this.btnScenar1.Text = "Scénario Tutoriel"; this.btnScenar1.UseVisualStyleBackColor = true; this.btnScenar1.Click += new System.EventHandler(this.btnScenar1_Click); // // btnScenar2 // - this.btnScenar2.Location = new System.Drawing.Point(302, 104); + this.btnScenar2.Location = new System.Drawing.Point(538, 90); this.btnScenar2.Name = "btnScenar2"; this.btnScenar2.Size = new System.Drawing.Size(190, 136); this.btnScenar2.TabIndex = 1; @@ -55,7 +57,7 @@ // // btnScenar3 // - this.btnScenar3.Location = new System.Drawing.Point(571, 104); + this.btnScenar3.Location = new System.Drawing.Point(932, 90); this.btnScenar3.Name = "btnScenar3"; this.btnScenar3.Size = new System.Drawing.Size(190, 136); this.btnScenar3.TabIndex = 2; @@ -63,15 +65,27 @@ this.btnScenar3.UseVisualStyleBackColor = true; this.btnScenar3.Click += new System.EventHandler(this.btnScenar3_Click); // + // pictureBox1 + // + this.pictureBox1.Image = global::Arti4.Properties.Resources.articaspacito; + this.pictureBox1.Location = new System.Drawing.Point(83, 286); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(1103, 404); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox1.TabIndex = 3; + this.pictureBox1.TabStop = false; + // // UC_Scenario // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.pictureBox1); this.Controls.Add(this.btnScenar3); this.Controls.Add(this.btnScenar2); this.Controls.Add(this.btnScenar1); this.Name = "UC_Scenario"; this.Size = new System.Drawing.Size(1280, 800); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); } @@ -81,5 +95,6 @@ private System.Windows.Forms.Button btnScenar1; private System.Windows.Forms.Button btnScenar2; private System.Windows.Forms.Button btnScenar3; + private System.Windows.Forms.PictureBox pictureBox1; } } diff --git a/Arti4/Arti4/UserControls/UC_Scenario.cs b/Arti4/Arti4/UserControls/UC_Scenario.cs index ae8f9de33f2f02d5d4b8ec34dce3a9fae7237178..927cede6445d8818c074c37bb39a6c0369fc02d6 100644 --- a/Arti4/Arti4/UserControls/UC_Scenario.cs +++ b/Arti4/Arti4/UserControls/UC_Scenario.cs @@ -23,7 +23,6 @@ namespace Arti4 private void btnScenar1_Click(object sender, EventArgs e) { - p.Launch(Enum.Enums.Scenario.Scenario1); UC_Jeu jeu = new UC_Jeu(form_main); @@ -32,12 +31,16 @@ namespace Arti4 private void btnScenar2_Click(object sender, EventArgs e) { + p.Launch(Enum.Enums.Scenario.Scenario2); + UC_Jeu jeu = new UC_Jeu(form_main); form_main.CollerUC(jeu); } private void btnScenar3_Click(object sender, EventArgs e) { + p.Launch(Enum.Enums.Scenario.Scenario3); + UC_Jeu jeu = new UC_Jeu(form_main); form_main.CollerUC(jeu); }