Vous êtes sur la page 1sur 8

PEMROGRAMAN VISUAL NET

DISUSUN OLEH :

YOSLIN BUAPASEDAN

142233

SEKOLAH TINGGI MANAJEMEN INFORMATIKA DAN KOMPUTER


(STMIK) DIPANEGARA
MAKASSAR
2016

using
using
using
using

System;
System.Collections.Generic;
System.Drawing;
System.Windows.Forms;

namespace yoslin
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm : Form
{
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer
support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void MainFormLoad(object sender, EventArgs e)

{
}
void DataPegawaiToolStripMenuItemClick(object sender, EventArgs e)
{
Form2 f2 = new Form2();
f2.ShowDialog ();
f2.Focus();
}
void NewToolStripMenuItemClick(object sender, EventArgs e)
{
}
void FormToolStripMenuItemClick(object sender, EventArgs e)
{
Form1 f1 = new Form1();
f1.ShowDialog ();
f1.Focus();
}
void ExitToolStripMenuItemClick(object sender, EventArgs e)
{
Application.Exit();
}
}
}

/*
* Created by SharpDevelop.
* User: root
* Date: 5/11/2016
* Time: 9:44 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Drawing;
using System.Windows.Forms;
namespace yoslin
{
/// <summary>
/// Description of Form2.
/// </summary>
public partial class Form2 : Form
{
public Form2()
{
//
// The InitializeComponent() call is required for Windows Forms designer
support.
//
InitializeComponent();

//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void Form2Load(object sender, EventArgs e)
{
txtNIP.Focus();
txtGaPok.Enabled=true;
rbPria.Checked=false;
rbWanita.Checked=false;
cmbGol.Items.Add("A");
cmbGol.Items.Add("B");
Tanggal.Text=DateTime.Now.ToString("dd/MM/yyyy");//Untuk menampilkan
Tanggal
Waktu.Text=DateTime.Now.ToString("hh:mm:ss");//Untuk menampilkan
Waktu
}
void CmbGolSelectedIndexChanged(object sender, EventArgs e)
{
double GaPok;
if(cmbGol.Text=="A")
{
if(rbPria.Checked==true)&(rbMenikah.Checked==true);
{
GaPok=3500000;
txtGaPok.Text="Rp."+GaPok.ToString();
}
else
{
GaPok=3000000;
txtGaPok.Text="Rp."+GaPok.ToString();
}
}
else if(cmbGol.Text=="B")
{
if(rbPria.Checked & rbMenikah.Checked==true)
{
txtGaPok=3000000;
txtGaPok.Text="Rp."+txtGaPok.ToString();
}
else

{
txtGaPok=2500000;
txtGaPok.Text="Rp."+txtGaPok.ToString();
}
}
}
}
void BtneditClick(object sender, EventArgs e)
{
txtNIP.Clear();
txtNama.Clear();
txtGaPok.Clear();
rbPria.Checked=false;
rbWanita.Checked=false;
cbMenikah.Checked=false;
cbSingle.Checked=false;
cmbGol.Text="";
listDataPegawai.Items.Clear();
txtNIP.Focus();
}
void BtnkeluarClick(object sender, EventArgs e)
{
this.Close();
}
void BtnsimpanClick(object sender, EventArgs e)
{
listDataPegawai.Items.Add("NIP\t\t:"+txtNIP.Text);
listDataPegawai.Items.Add("Nama\t\t:"+txtNama.Text);
if(rbPria.Checked==true)
{
listDataPegawai.Items.Add("Jenis Kelamin\t:"+rbPria.Text);
}
else
{
listDataPegawai.Items.Add("Jenis Kelamin\t:"+rbWanita.Text);
}
if(cbMenikah.Checked==true)
{
listDataPegawai.Items.Add("Status\t\t:"+cbMenikah.Text);
}
else

{
listDataPegawai.Items.Add("Jenis Kelamin\t\t:"+cbSingle.Text);
}
listDataPegawai.Items.Add("Golongan\t:"+cmbGol.Text);
listDataPegawai.Items.Add("Gaji Pokok\t:"+txtGaPok.Text);
}
}
}

Vous aimerez peut-être aussi