Header Ads

Header ADS

Salary Calculate Application in C#

Salary Calculate Application in C#

Develop an application with one screen that calculates the monthly salary of an employee. Your application should satisfy the following requirements:

1.      Make sure you use all of the following components:
Label, TextBox, RadioButton, ComboBox, CheckBox, ListBox, Button, GroupBox
2.      Employee Name: (TextBox)
3.      Employee Grade Level: (ComboBox)
Director, Manager, Project Manager, Programmer
4.      Basic Salary: (RadioButton)
30,000, 40,000, 50,000, 100,000
Basic Salary value should be read only and automatically selected based on the selected Employee Grade Level
5.      Benefits: (CheckBox)
Housing Allowance, Conveyance Allowance, Other Benefit 1, Other Benefit 2
(20000, 15000, 10000, 10000 respectively)
6.      Bonuses: (ListBox)
Project Completion Bonus, Year End Bonus, Performance Bonus, Customer appreciation Bonus
(20000, 30000, 25000, 15000)
7.      Deductions: TextBox
Provident Fund Deduction, Medical Deduction
8.      Calculate the Salary based on the user input regarding above features and display the result

9.      An Exit button.

Code

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;
using ClassLibrary1;


namespace lab3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            cal.Enabled = false;
        }

        private void Ext_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void cal_Click(object sender, EventArgs e)
        {


            int sal = 0;

            sal += int.Parse(cb2.Text);

            if (c1.Checked == true)
                sal += 5000;
            if (c2.Checked == true)
                sal += 5000;
            if (c3.Checked == true)
                sal += 5000;
            if (c4.Checked == true)
                sal += 5000;
            sal += (10000 * lb1.SelectedIndices.Count);
            if (c5.Checked == true)
                sal -= 1500;

            if (c6.Checked == true)
                sal -= 2500;
            tb2.Text = sal.ToString();


        }

        private void cb2_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (tb1.Text != "" && cb1.SelectedIndex >= 0 && (r1.Checked == true || r2.Checked == true)
             && cb2.SelectedIndex >= 0 && lb1.SelectedIndices.Count > 0)
                cal.Enabled = true;
        }

        private void cb1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cb1.SelectedIndex == 0)
                cb2.SelectedIndex = 4;
            if (cb1.SelectedIndex == 1)
                cb2.SelectedIndex = 3;
            if (cb1.SelectedIndex == 2)
                cb2.SelectedIndex = 2;
            if (cb1.SelectedIndex == 3)
                cb2.SelectedIndex = 1;
            if (tb1.Text != "" && cb1.SelectedIndex >= 0 && (r1.Checked == true || r2.Checked == true)
             && cb2.SelectedIndex >= 0 && lb1.SelectedIndices.Count > 0)
                cal.Enabled = true;

        }

        private void tb1_TextChanged(object sender, EventArgs e)
        {
            if (tb1.Text != "" && cb1.SelectedIndex >= 0 && (r1.Checked == true || r2.Checked == true)
              && cb2.SelectedIndex >= 0 && lb1.SelectedIndices.Count > 0)
                cal.Enabled = true;
        }

        private void gb1_Enter(object sender, EventArgs e)
        {
        }

        private void lb1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (tb1.Text != "" && cb1.SelectedIndex >= 0 && (r1.Checked == true || r2.Checked == true)
             && cb2.SelectedIndex >= 0 && lb1.SelectedIndices.Count > 0)
                cal.Enabled = true;
        }

        private void r1_CheckedChanged(object sender, EventArgs e)
        {
            if (tb1.Text != "" && cb1.SelectedIndex >= 0 && (r1.Checked == true || r2.Checked == true)
             && cb2.SelectedIndex >= 0 && lb1.SelectedIndices.Count > 0)
                cal.Enabled = true;
        }

        private void r2_CheckedChanged(object sender, EventArgs e)
        {
            if (tb1.Text != "" && cb1.SelectedIndex >= 0 && (r1.Checked == true || r2.Checked == true)
             && cb2.SelectedIndex >= 0 && lb1.SelectedIndices.Count > 0)
                cal.Enabled = true;
        }


        private void button1_Click(object sender, EventArgs e)
        {
            Class1 asd = new Class1();
            int x = asd.fn(3);
            tb1.Text = x.ToString();
        }

    }
}

Screen Shot

                         Visit :http://bel4solutions.com/

3 comments:

  1. where are radiobuttons in the above mentioned program, and what is lb1 and cal??

    ReplyDelete
  2. The great blog about salary advance apps.Thanks for sharing the blog,seems to be interesting and informative too.Could you help me to find more detail about salary advance apps

    ReplyDelete

Powered by Blogger.