[thread split from here]

Hi i have the same problem but instead of console app i need to make a gui one

this is what i have so far 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TubeSales
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
              // string inputString;
            char response;
            // inputString = Console.ReadLine();

            double saleAmount;
            double salesAmount_A;
            double salesAmount_B;
            double salesAmount_E;
            const double COMMISSION = 0.10;
            response = Convert.ToChar(textBox1.Text);
            saleAmount = Convert.ToDouble(textBox2.Text);
            salesAmount_A= Convert.ToDouble(label3.Text);
            salesAmount_B = Convert.ToDouble(label3.Text);
            salesAmount_E = Convert.ToDouble(label3.Text);






            do
            {
                if (response == 'A' || response == 'a')

                    saleAmount = saleAmount + (saleAmount * COMMISSION);
                    salesAmount_A += saleAmount;
                    label3.Text += salesAmount_A;
                    label3.Text = string.Format("your commission is:" +saleAmount.ToString("C2") + salesAmount_A.ToString("C2"));
                

                if (response == 'B' || response == 'b')

                    saleAmount = saleAmount + (saleAmount * COMMISSION);
                    salesAmount_B += saleAmount;

                    label3.Text = string.Format("your commission is:" + saleAmount.ToString("C2") + salesAmount_B.ToString("C2"));
                
                if (response == 'E' || response == 'e')

                    saleAmount = saleAmount + (saleAmount * COMMISSION);
                    salesAmount_E += saleAmount;
                    label3.Text = string.Format("your commission is:" + saleAmount.ToString("C2") + salesAmount_E.ToString("C2"));
                
            } while (response != 'Z' || response != 'z');
                  label3.Text = string.Format("invalid");
        }
    }
}

Edited 5 Years Ago by Nick Evan: Added [CODE] tags, thread split

What problem do you have? Can you be specific?

i an not get one salesperson to accumulate his data i used switch

but after that i can only see each salesperson individual commission

This article has been dead for over six months. Start a new discussion instead.