LAMPIRAN A : LISTING PROGRAM
1. Mainform
Created by SharpDevelop. User: User7
Date: 28092015 Time: 9:38
To change this template use Tools | Options | Coding | Edit Standard Headers.
using
System;
using
System.Collections.Generic;
using
System.Drawing;
using
System.Windows.Forms;
namespace
home1 {
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
KRITERIALAHANToolStripMenuItemClick
object sender, Event
Args e {
Form a=
new databimbingan
; a.
Show
; }
void
DATALAHANToolStripMenuItemClick
object sender, EventArgs
e {
Universitas Sumatera Utara
Form b=
new kriteriabobot
; b.
Show
; }
void
EXITToolStripMenuItemClick
object sender, EventArgs e
{ DialogResult button= MessageBox.
Show
Are you sure want to EXIT?
, EXIT
, MessageBoxButtons.Ye
sNo,MessageBoxIcon.Question, MessageBoxDefaultBut
ton.Button2;
if
button==DialogResult.Yes Application.
Exit
; }
void
ABOUTToolStripMenuItemClick
object sender, EventArgs e
{ Form c=
new about
; c.
Show
; }
void
HOMEToolStripMenuItemClick
object sender, EventArgs e
{ }
void
METODEToolStripMenuItemClick
object sender, EventArgs e
{ Form f=
new metode
; f.
Show
; }
void
Label2Click
object sender, EventArgs e
{ }
void
Label3Click
object sender, EventArgs e
{ }
void
Label1Click
object sender, EventArgs e
{ }
void
PictureBox2Click
object sender, EventArgs e
{
Universitas Sumatera Utara
} void
Label42Click
object sender, EventArgs e
{ }
} }
2. About
Created by SharpDevelop. User: User7
Date: 28092015 Time: 10:09
To change this template use Tools | Options | Coding | Edit Standard Headers.
using
System;
using
System.Drawing;
using
System.Windows.Forms;
namespace
home1 {
summary
Description of about.
summary public
partial class
about : Form {
public about
{ The InitializeComponent call is required for Windows
Forms designer support.
InitializeComponent
; TODO
: Add constructor code after the InitializeComponent call.
}
void
AboutLoad
object sender, EventArgs e
{ }
Universitas Sumatera Utara
void
Label2Click
object sender, EventArgs e
{ }
void
PictureBox2Click
object sender, EventArgs e
{ }
void
Label3Click
object sender, EventArgs e
{ }
void
Label1Click
object sender, EventArgs e
{ }
void
Label4Click
object sender, EventArgs e
{ }
void
Label6Click
object sender, EventArgs e
{ }
void
Label8Click
object sender, EventArgs e
{ }
} }
3.Metode
Created by SharpDevelop. User: User7
Date: 28092015 Time: 10:58
To change this template use Tools | Options | Coding | Edit Standard Headers.
using
System;
using
System.Collections.Generic;
using
System.Drawing;
using
System.Windows.Forms;
using
MySql.Data.MySqlClient;
Universitas Sumatera Utara
using
System.Data;
using
System.Data.OleDb;
namespace
home1 {
summary
Description of metode.
summary public
partial class
metode : Form {
MySqlConnection koneksi2 =
new MySqlConnection
server=localhost;port=3306;username=root ;password=
;
double
maxc1,maxc2,maxc3,maxc4,minc5,minc6,minc7,minc8;
double
tertinggi= ;
string lahanterbaik,temp_pm;
public metode
{ The InitializeComponent call is required for Windows
Forms designer support.
InitializeComponent
; TODO
: Add constructor code after the InitializeComponent call.
} void
Panel2Paint
object sender, PaintEventArgs e
{ }
void
Button1Click
object sender, EventArgs e
{
try
{ DateTime waktuawal,waktuakhir;
waktuawal=DateTime.Now;
double
hc1,hc2,hc3,hc4,hc5,hc6,hc7,hc8; string
MyConnection2 =
server=localhost;port=3306;username=root;password= ;
MySqlConnection MyConn2 =
new MySqlConnection
MyConnection2; MySqlCommand MyCommand2 = new MySqlCommandQuery,
MyConn2; MyConn2.
Open
; MySqlCommand command1 =
new MySqlCommand
select maxC1 from db_spk_bimbel.tb_bobot
,MyConn2;
Universitas Sumatera Utara
maxc1=Convert.
ToDouble
command1.
ExecuteScalar
.
ToStr ing
; MySqlCommand command2 =
new MySqlCommand
select maxC2 from db_spk_bimbel.tb_bobot
,MyConn2; maxc2=Convert.
ToDouble
command2.
ExecuteScalar
.
ToStr ing
; MySqlCommand command3 =
new MySqlCommand
select maxC3 from db_spk_bimbel.tb_bobot
,MyConn2; maxc3=Convert.
ToDouble
command3.
ExecuteScalar
.
ToStr ing
; MessageBox.Showmin + minc3.ToString;
MySqlCommand command4 =
new MySqlCommand
select maxC4 from db_spk_bimbel.tb_bobot
,MyConn2; maxc4=Convert.
ToDouble
command4.
ExecuteScalar
.
ToStr ing
; MySqlCommand command5 =
new MySqlCommand
select minC5 from db_spk_bimbel.tb_bobot
,MyConn2; minc5=Convert.
ToDouble
command5.
ExecuteScalar
.
ToStr ing
; MySqlCommand kueri =
new MySqlCommand
SELECT FROM db_spk_bimbel.tb_bobot
,MyConn2; string
temp; kueri.CommandText = qw;
koneksi.Open; MySqlDataReader dr;
dr = kueri.
ExecuteReader
;
while
dr.
Read
{ temp = dr[
nama ].
ToString
; matriks normalisasi
hc1 = Convert.
ToDouble
dr[ c1
]maxc1; hc2 = Convert.
ToDouble
dr[ c2
]maxc2; hc3 = Convert.
ToDouble
dr[ c3
]maxc3; hc4 = Convert.
ToDouble
dr[ c4
]maxc4; hc5 = Convert.
ToDouble
dr[ c5
]minc5; perkalian dengan w
MessageBox.Showhc1.ToString;
double
skor = hc1
0.3 +hc2
0.2 +hc3
0.15 +hc4
0.25 +hc5
0.1 ;
if
skor = tertinggi{ tertinggi=skor;
lahanterbaik=temp; }
Universitas Sumatera Utara
updateskorsaw
temp,hc1,hc2,hc3,hc4,hc5,skor; }
koneksi.Close; MyConn2.
Close
; waktuakhir=DateTime.Now;
TimeSpan lama =waktuakhir.
Subtract
waktuawal; textBox1.Text=lama.TotalMilliseconds.
ToString
+ MilliSeconds
; }
catch
Exception ex {
MessageBox.
Show
ex.Message; }
lihatperangkingan
; sawtinggi.Text=lahanterbaik;
datatertinggi_pm; }
void
lihatwpm
{
try
{ string
MyConnection2 =
server=localhost;port=3306;username=root;password= ;
Display query string
Query = select from db_spk_bimbel.tb_wpm
ORDER BY skor DESC; ;
MySqlConnection MyConn2 =
new MySqlConnection
MyConnection2; MySqlCommand MyCommand2
=
new MySqlCommand
Query, MyConn2; MyConn2.
Open
; For offline connection we weill
use MySqlDataAdapter class. MySqlDataAdapter MyAdapter
=
new MySqlDataAdapter
; MyAdapter.SelectCommand = MyCommand2;
DataTable dTable = new DataTable; DataTable dTable =
new DataTable
; MyAdapter.
Fill
dTable; dataGridView1.DataSource = dTable;
here i have assign dTable object to the dataGridView1 object to display
data. MyConn2.
Close
; }
catch
Exception ex {
MessageBox.
Show
ex.Message; }
}
Universitas Sumatera Utara
void
lihatperangkingan
{
try
{ string
MyConnection2 =
server=localhost;port=3306;username=root;password= ;
Display query string
Query = select from
db_spk_bimbel.tb_normalisasi_saw ORDER BY skor DESC; ;
MySqlConnection MyConn2 =
new MySqlConnection
MyConnection2; MySqlCommand MyCommand2
=
new MySqlCommand
Query, MyConn2; MyConn2.
Open
; For offline connection we weill
use MySqlDataAdapter class. MySqlDataAdapter MyAdapter
=
new MySqlDataAdapter
; MyAdapter.SelectCommand = MyCommand2;
DataTable dTable = new DataTable; DataTable dTable =
new DataTable
; MyAdapter.
Fill
dTable; dataGridView4.DataSource = dTable;
here i have assign dTable object to the dataGridView1 object to display
data. MyConn2.
Close
; }
catch
Exception{ MessageBox.
Show
Ada Error ;
} }
void
updateskorsaw
string nama,
double
hc1,
double
hc2,
double
h c3,
double
hc4,
double
hc5,
double
skor {
try
{ string
MyConnection2 =
datasource=localhost;port=3306;username=root;password= ;
string query2=
update db_spk_bimbel.tb_normalisasi_saw set
normalisasi_c1= + hc1+
,normalisasi_c2= +hc2+
,normalisasi_c3 =
+hc3+ ,normalisasi_c4=
+ hc4+ ,normalisasi_c5=
+ hc5+ ,
skor= + skor+
where nama= + nama+
; ;
MySqlConnection MyConn2 =
new MySqlConnection
MyConnection2; MySqlCommand MyCommand2 = new MySqlCommandQuery,
MyConn2; MySqlCommand MyCommand3
=
new MySqlCommand
query2, MyConn2; MySqlDataReader MyReader2;
MyConn2.
Open
;
Universitas Sumatera Utara
MyReader2 = MyCommand2.ExecuteReader; Here our query will be executed and data saved into the database.
MyReader2 = MyCommand3.
ExecuteReader
; MessageBox.ShowSave Data;
MyConn2.
Close
; }
catch
Exception{ MessageBox.
Show
Ada Error ;
} }
void
updateskorwpm
string nama,
double
hc1,
double
hc2,
double
h c3,
double
hc4,
double
hc5, String skor {
try
{ string
MyConnection2 =
datasource=localhost;port=3306;username=root;password= ;
string query2=
update db_spk_bimbel.tb_wpm set c1=
+ hc1+ ,c2=
+hc2+ ,c3=
+hc3+ ,c4=
+ hc4+ ,c5=
+ hc5+
,skor= + skor+
where nama=
+ nama+ ;
; MySqlConnection MyConn2
=
new MySqlConnection
MyConnection2; MySqlCommand MyCommand2 = new MySqlCommandQuery,
MyConn2; MySqlCommand MyCommand3
=
new MySqlCommand
query2, MyConn2; MySqlDataReader MyReader2;
MyConn2.
Open
; MyReader2 = MyCommand2.ExecuteReader; Here
our query will be executed and data saved into the database. MyReader2 = MyCommand3.
ExecuteReader
; MessageBox.ShowSave Data;
MyConn2.
Close
; }
catch
Exception{ MessageBox.
Show
Ada Error ;
} }
void
Button2Click
object sender, EventArgs e
{
try
{ DateTime waktuawal,waktuakhir;
waktuawal=DateTime.Now;
double
hc1,hc2,hc3,hc4,hc5,skorwpm;
double
tinggi= ;
string MyConnection2
= server=localhost;port=3306;username=root;password=
; MySqlConnection MyConn2
=
new MySqlConnection
MyConnection2; MySqlCommand MyCommand2 = new MySqlCommandQuery,
Universitas Sumatera Utara
MyConn2; MyConn2.
Open
; MySqlCommand kueri =
new MySqlCommand
SELECT FROM db_spk_bimbel.tb_bobot
,MyConn2; string
temp; kueri.CommandText = qw;
koneksi.Open; MySqlDataReader dr;
dr = kueri.
ExecuteReader
;
while
dr.
Read
{ temp = dr[
nama ].
ToString
; matriks normalisasi
hc1 =Math.
Pow
0.3 ,Convert.
ToDouble
dr[ c1
]; hc2 = Math.
Pow
0.2 ,Convert.
ToDouble
dr[ c2
]; hc3
=Math.
Pow
0.15 , Convert.
ToDouble
dr[ c3
]; hc4 =Math.
Pow
0.25 ,Convert.
ToDouble
dr[ c4
]; hc5 =Math.
Pow
0.1 , Convert.
ToDouble
dr[ c5
]; skorwpm=hc1hc2hc3hc4hc5;
String strskorwpm=skorwpm.
ToString
0. ;
MessageBox.Showskorwpm.ToString;
if
skorwpm = tinggi{ tinggi=skorwpm;
textBox2.Text=temp; }
updateskorwpm
temp,hc1,hc2,hc3,hc4,hc5,strskorwpm ;
} MyConn2.
Close
;
lihatwpm
; waktuakhir=DateTime.Now;
TimeSpan lamawpm=waktuakhir.
Subtract
waktuawal; wpm_time.Text=lamawpm.TotalMilliseconds.
ToString
+ MilliSeconds
; }
catch
Exception ex{ MessageBox.
Show
ex.Message; }
} void
MetodeLoad
object sender, EventArgs e
{ }
void
Label4Click
object sender, EventArgs e
Universitas Sumatera Utara
{ }
void
Panel1Paint
object sender, PaintEventArgs e
{ }
void
TextBox1TextChanged
object sender, EventArgs e
{ }
void
Label7Click
object sender, EventArgs e
{ }
void
DataGridView4CellContentClick
object sender, DataGridVie
wCellEventArgs e {
} }
} 4.Bobot Kriteria
Created by SharpDevelop. User: User7
Date: 28092015 Time: 9:54
To change this template use Tools | Options | Coding | Edit Standard Headers.
using
System;
using
System.Collections.Generic;
using
System.Drawing;
using
System.Linq.Expressions;
using
System.Windows.Forms;
using
MySql.Data.MySqlClient;
using
System.Data;
using
System.Data.OleDb;
namespace
home1 {
summary
Description of kriteriabobot.
summary public
partial class
kriteriabobot : Form
Universitas Sumatera Utara
{
public kriteriabobot
{ The InitializeComponent call is required for Windows
Forms designer support.
InitializeComponent
;
lihat
;
TODO
: Add constructor code after the InitializeComponent call.
} void
lihat
{ string
MyConnection2 =
server=localhost;port=3306;username=root;password= ;
Display query string
Query = select from
db_spk_bimbel.tb_kriteriabobot; ;
MySqlConnection MyConn2 =
new MySqlConnection
MyConnection2; MySqlCommand MyCommand2
=
new MySqlCommand
Query, MyConn2; MyConn2.
Open
; For offline connection we weill
use MySqlDataAdapter class. MySqlDataAdapter MyAdapter
=
new MySqlDataAdapter
; MyAdapter.SelectCommand = MyCommand2;
DataTable dTable = new DataTable; DataTable dTable =
new DataTable
; MyAdapter.
Fill
dTable; dataGridView1.DataSource = dTable;
here i have assign dTable object to the dataGridView1 object to display
data. MyConn2.
Close
; }
void
KriteriabobotLoad
object sender, EventArgs e
{ }
} }
5. Data Bimbingan