Please would someone able to explain to me why this application isn't showing out its operation , i am quit new to programing and everything i have the done on this app is due to help from sites like this. but now i am stuck.

attached the is zip file of the payroll app

code written

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

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

        
        
        string name;
        int employeeNumber;
        double hours;
        const double hourlyWage = 8.5;
        double gross;
        double tax;
        double insurance;
        double deduction;
        double Net;
        

        private void btnCompute_Click(object sender, EventArgs e)
        {
            if (txtName.Text == "")
            {
                MessageB.Text = "Enter Name";
            }
            else if (txtPNumber.Text.Length < 6)
            {
                MessageB.Text = "Enter Employee Number";
            }
            else if (txtHoursWork.Text == "")
            {
                MessageB.Text = "Enter Hours";
            }
            else if (btnCompute.Text == "Compute")
            {
                name = txtName.Text;
                employeeNumber = Convert.ToInt32(txtPNumber.Text);
                hours = Convert.ToDouble(txtHoursWork.Text);
                gross = hours * hourlyWage;
                txtGrossPay.Text = "£" + Convert.ToString(gross);
                tax = gross / 100 * 20;

                txtIncomeTax.Text = "£" + Convert.ToString(tax);

                insurance = gross / 100 * 7;

                txtNI.Text = "£" + Convert.ToString(insurance);
                deduction = tax + insurance;
                txtTotalDeduction.Text = "£" + Convert.ToString(deduction);
                Net = gross - tax - insurance;
                txtNetPay.Text = "£" + Convert.ToString(Net);


                

                



            }
            else
            {
                txtName.Text = "";
                txtPNumber.Text = "";
                txtHoursWork.Text = "";
                txtGrossPay.Text = "";
                txtIncomeTax.Text = "";
                txtNI.Text = "";
                txtTotalDeduction.Text = "";
                btnCompute.Text = "Compute";

                

            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Close();
        }
      
    }
}

thanks in advance for your help.

Use simple If statements instead of If..else..if.

private void btnCompute_Click(object sender, EventArgs e)
        {
            if (txtName.Text == "")
            {
                MessageB.Text = "Enter Name";
                return;
            }
           if (txtPNumber.Text.Length < 6)
            {
                MessageB.Text = "Enter Employee Number";
                return;
            }
             if (txtHoursWork.Text == "")
            {
                MessageB.Text = "Enter Hours";
                return;
            }
             if (btnCompute.Text == "Compute")
            {
                name = txtName.Text; 
              .....
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.