Sie sind auf Seite 1von 3

/*

* Created by SharpDevelop.
* User: Lenovo
* Date: 07-May-19
* Time: 9:43 AM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Drawing;
using System.Windows.Forms;

namespace praktikum6a
{
/// <summary>
/// Description of FormInputPegawai.
/// </summary>
public partial class FormInputPegawai : Form
{
string gol, nmGol, status;
double gapok, tIstri, tAnak, gaber, jAnak;

public FormInputPegawai()
{
//
// The InitializeComponent() call is required for Windows Forms
designer support.
//
InitializeComponent();
isicomboBox();
enabledObject();
comboBox1.SelectedIndex=0;

//
// TODO: Add constructor code after the InitializeComponent()
call.
//
}
void isicomboBox()
{
comboBox1.Items.Add("3A");
comboBox1.Items.Add("3B");
comboBox1.Items.Add("3C");
comboBox1.Items.Add("3D");
}
void enabledObject()
{
textBox3.Enabled=false;
textBox4.Enabled=false;
textBox5.Enabled=false;
textBox6.Enabled=false;
textBox7.Enabled=false;
button1.Enabled=false;
button2.Enabled=false;
}
void hitung(object sender, EventArgs e)
{
gapok=double.Parse(textBox3.Text);
tIstri=double.Parse(textBox4.Text);
tAnak=double.Parse(textBox5.Text);

gaber=gapok + tIstri + tAnak;

textBox6.Text=Convert.ToString(gaber);
button1.Enabled=true;
}

void tampil(object sender, EventArgs e)


{
ListBox.Items.Add("NIP : " + textBox1.Text);
ListBox.Items.Add("Nama : " + textBox2.Text);
ListBox.Items.Add("Golongan : " + textBox7.Text);
ListBox.Items.Add("Gaji Pokok : " + gapok);
ListBox.Items.Add("Tunjangan Istri : " + tIstri);
ListBox.Items.Add("Tunjangan Anak : " + tAnak);
ListBox.Items.Add("Status : " + status);
ListBox.Items.Add("Jumlah Anak : " + jAnak);
ListBox.Items.Add("Gaji Bersih : " + gaber);

button2.Enabled=true;

}
void status(object sender, EventArgs e)
{
if(radioButton1.Checked)
{
label1.Text="Status : Kawin\n";
}
if(radioButton2.Checked)
{
label1.Text="Status : Belum Kawin\n";
}
}

void clear(object sender, EventArgs e)


{
textBox1.Text=" ";
textBox2.Text=" ";
textBox3.Text=" ";
textBox4.Text=" ";
textBox5.Text=" ";
textBox6.Text=" ";
textBox7.Text=" ";

}
void exit(object sender, EventArgs e)
{
this.Close();
}
void gantiPilihan(object sender, EventArgs e)
{
gol=Convert.ToString(comboBox1.SelectedItem);
if(gol=="3A")
{
nmGol="Penata";
gapok=1000000;
textBox7.Text=nmGol;
textBox3.Text=Convert.ToDouble(gapok);
}
if(gol=="3B")
{
nmGol="Penata Muda";
gapok=2000000;
textBox7.Text=nmGol;
textBox3.Text=Convert.ToDouble(gapok);
}
if(gol=="3C")
{
nmGol="Pembina";
gapok=3000000;
textBox7.Text=nmGol;
textBox3.Text=Convert.ToDouble(gapok);
}
if(gol=="3D")
{
nmGol="Pembina Muda";
gapok=4000000;
textBox7.Text=nmGol;
textBox3.Text=Convert.ToDouble(gapok);
}

}
}

Das könnte Ihnen auch gefallen