• Tidak ada hasil yang ditemukan

Implementasi Metode Smart (Simple Multi Attribute Rating Technique) dan Metode WP (Weighted Product) pada Sistem Pendukung Keputusan dalam Menentukan Paket Internet

N/A
N/A
Protected

Academic year: 2017

Membagikan "Implementasi Metode Smart (Simple Multi Attribute Rating Technique) dan Metode WP (Weighted Product) pada Sistem Pendukung Keputusan dalam Menentukan Paket Internet"

Copied!
19
0
0

Teks penuh

(1)

LISTING PROGRAM

Main.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using MySql.Data.MySqlClient;

namespace SpkInternet {

public partial class Main : Form {

string connectionSQL = "server=localhost;database=internet; uid=root;password=;";

public Main() {

InitializeComponent(); this.FormBorderStyle =

System.Windows.Forms.FormBorderStyle.FixedSingle; this.MinimizeBox = false;

}

private void pilihPaketToolStripMenuItem_Click(object sender, EventArgs e)

{

Form input = new Input(); input.Show();

}

private void metodeSMARTToolStripMenuItem_Click(object sender,

EventArgs e)

{

Form metodeSmart = new smart(); metodeSmart.Show();

}

private void inputToolStripMenuItem_Click(object sender, EventArgs e) {

Form input = new Input(); input.Show();

}

private void metodeWeihtedProductToolStripMenuItem_Click(object sender,

EventArgs e)

{

Form wp = new wp(); wp.Show();

}

private void kesimpulanToolStripMenuItem_Click(object sender, EventArgs e)

{

Form hasil = new kesimpulan(); hasil.Show();

(2)

private void Main_FormClosed(object sender, FormClosedEventArgs e) {

MySqlConnection db = new MySqlConnection(connectionSQL); MySqlCommand delete = db.CreateCommand();

string commend = "delete from spk where kuota>1;"; db.Open();

delete.CommandText = commend;

MySqlDataReader reader = delete.ExecuteReader(); db.Close();

commend = "delete from smart where total>0;"; db.Open();

delete.CommandText = commend; reader = delete.ExecuteReader(); db.Close();

commend = "delete from wp where total>0;"; db.Open();

delete.CommandText = commend; reader = delete.ExecuteReader(); db.Close();

commend = "delete from waktu where waktu>0;"; db.Open();

delete.CommandText = commend; reader = delete.ExecuteReader(); db.Close();

} } }

Input.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using MySql.Data.MySqlClient;

namespace SpkInternet {

public partial class Input : Form {

string connectionSQL = "server=localhost;database=internet; uid=root;password=;";

string[,] n = new string[99,5]; int[] volume = new int[99]; int[] price = new int[99]; int[] periode = new int[99]; int[] speed = new int[99];

public Input() {

InitializeComponent();

(3)

this.FormBorderStyle =

System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; }

private void simpatiToolStripMenuItem1_Click(object sender, EventArgs e)

{

Form simpati = new Simpati(); simpati.Show();

}

private void asToolStripMenuItem_Click(object sender, EventArgs e) {

Form KartuAs = new As(); KartuAs.Show();

}

private void indosatToolStripMenuItem1_Click(object sender, EventArgs e)

{

Form indosat = new Indosat(); indosat.Show();

}

private void hotrodToolStripMenuItem_Click(object sender, EventArgs e) {

Form xlhotroad = new xl(); xlhotroad.Show();

}

private void hotrod4GToolStripMenuItem_Click(object sender, EventArgs e)

{

Form xlhotrod4g = new xl4g(); xlhotrod4g.Show();

}

private void regulerToolStripMenuItem_Click(object sender, EventArgs e) {

Form _3reg = new _3reguler(); _3reg.Show();

}

private void toolStripMenuItem3_Click(object sender, EventArgs e) {

Form _3tambah = new _3plus(); _3tambah.Show();

}

private void kendoToolStripMenuItem_Click(object sender, EventArgs e) {

Form _3kend = new _3kendo(); _3kend.Show();

}

(4)

MySqlConnection db = new MySqlConnection(connectionSQL); MySqlCommand command = db.CreateCommand();

command.CommandText = "SELECT * FROM picked"; db.Open();

DataSet ds = new DataSet();

MySqlDataAdapter da = new MySqlDataAdapter(command); da.Fill(ds, "data");

dataGridView1.DataSource = ds; dataGridView1.DataMember = "data"; db.Close();

}

private void button1_Click(object sender, EventArgs e) {

MySqlConnection db = new MySqlConnection(connectionSQL); MySqlCommand command = db.CreateCommand();

command.CommandText = "SELECT * FROM picked"; db.Open();

DataSet ds = new DataSet();

MySqlDataAdapter da = new MySqlDataAdapter(command); da.Fill(ds, "data");

dataGridView1.DataSource = ds; dataGridView1.DataMember = "data"; db.Close();

for (int rows = 0; rows < dataGridView1.Rows.Count; rows++) {

for (int col = 0; col < dataGridView1.Rows[rows].Cells.Count; col++)

{

n[rows, col] =

dataGridView1.Rows[rows].Cells[col].Value.ToString(); }

}

for (int i = 0; i < dataGridView1.Rows.Count; i++) {

if (Convert.ToDouble(n[i, 1]) <= 500) volume[i] = 20;

else if (Convert.ToDouble(n[i, 1]) > 500 &&

Convert.ToDouble(n[i, 1]) <= 1000)

volume[i] = 40;

else if (Convert.ToDouble(n[i, 1]) > 1000 &&

Convert.ToDouble(n[i, 1]) <= 5000)

volume[i] = 60;

else if (Convert.ToDouble(n[i, 1]) > 5000 &&

Convert.ToDouble(n[i, 1]) <= 10000)

volume[i] = 80; else

volume[i] = 100; }

for (int i = 0; i < dataGridView1.Rows.Count; i++) {

(5)

else if (Convert.ToInt32(n[i, 2]) > 25000 &&

Convert.ToInt32(n[i, 2]) <= 50000)

price[i] = 80;

else if (Convert.ToInt32(n[i, 2]) > 50000 &&

Convert.ToInt32(n[i, 2]) <= 10000)

price[i] = 60;

else if (Convert.ToInt32(n[i, 2]) > 100000 &&

Convert.ToInt32(n[i, 2]) <= 250000)

price[i] = 40; else

price[i] = 20; }

for (int i = 0; i < dataGridView1.Rows.Count; i++) {

if (Convert.ToInt32(n[i, 3]) <= 7) periode[i] = 60;

else if (Convert.ToInt32(n[i, 3]) > 7 && Convert.ToInt32(n[i, 3]) <= 30)

periode[i] = 80; else

periode[i] = 100; }

for (int i = 0; i < dataGridView1.Rows.Count; i++) {

if (n[i, 4] == "3,5 G") speed[i] = 70; else

speed[i] = 100; }

}

private void button2_Click(object sender, EventArgs e) {

MySqlConnection db = new MySqlConnection(connectionSQL); db.Open();

DialogResult button = MessageBox.Show("Yakin menghapus data ini?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Question,

MessageBoxDefaultButton.Button2);

if (button == DialogResult.Yes) {

MySqlCommand delete = db.CreateCommand();

string commend = "delete from picked where kuota>1;"; delete.CommandText = commend;

MySqlDataReader reader = delete.ExecuteReader(); db.Close();

} }

private void button3_Click(object sender, EventArgs e) {

dataGridView2.Rows.Clear(); dataGridView2.Refresh(); button1.PerformClick();

(6)

dataGridView2.Columns[0].Name = "Nama"; dataGridView2.Columns[1].Name = "Kuota"; dataGridView2.Columns[2].Name = "Harga"; dataGridView2.Columns[3].Name = "Masa Aktif"; dataGridView2.Columns[4].Name = "Jaringan";

string[] row = new string[99];

for (int i = 0;i < dataGridView1.Rows.Count;i++) {

row = new string[] { string.Concat(n[i, 0], " ", n[i, 1]),

Convert.ToString(volume[i]), Convert.ToString(price[i]),

Convert.ToString(periode[i]), Convert.ToString(speed[i]) };

dataGridView2.Rows.Add(row); }

}

private void button4_Click(object sender, EventArgs e) {

DialogResult button = MessageBox.Show("Yakin untuk menyimpan data?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Question,

MessageBoxDefaultButton.Button2);

if (button == DialogResult.Yes) {

for (int i = 0; i < dataGridView1.Rows.Count; i++) {

MySqlConnection db = new MySqlConnection(connectionSQL); db.Open();

MySqlCommand input = db.CreateCommand(); string commend = "insert into

spk(nama,kuota,harga,masaaktif,jaringan) values('" + string.Concat(n[i, 0], " ", n[i, 1]) + "'," + volume[i] + "," + price[i]

+ "," + periode[i] + "," + speed[i] + ");";

input.CommandText = commend;

MySqlDataReader reader = input.ExecuteReader(); }

} } } }

smart.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using MySql.Data.MySqlClient;

using System.Diagnostics;

namespace SpkInternet {

(7)

{

string[,] Total = new string[99, 6];

string connectionSQL = "server=localhost;database=internet; uid=root;password=;";

double total,n1,n2,n3,n4; double[] volume = new double[99]; double[] price = new double[99]; double[] periode = new double[99];

private void smart_Load(object sender, EventArgs e) {

label12.Text = ""; label13.Text = ""; label15.Text = ""; label16.Text = ""; label18.Text = ""; label19.Text = ""; label21.Text = ""; label22.Text = "";

}

double[] speed = new double[99];

double[] bobot_evaluasi = new double[99]; public smart()

{

InitializeComponent(); this.FormBorderStyle =

System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false;

}

private void button1_Click(object sender, EventArgs e) {

Stopwatch sw = Stopwatch.StartNew();

total = Convert.ToDouble(paket.Text) + Convert.ToDouble(harga.Text)

+ Convert.ToDouble(masaaktif.Text) + Convert.ToDouble(jaringan.Text);

label12.Text = string.Concat(paket.Text, " / ",

Convert.ToString(total));

label15.Text = string.Concat(harga.Text, " / ",

Convert.ToString(total));

label18.Text = string.Concat(masaaktif.Text, " / ",

Convert.ToString(total));

label21.Text = string.Concat(jaringan.Text, " / ",

Convert.ToString(total));

n1 = System.Math.Round((Convert.ToDouble(paket.Text) / total), 3); n2 = System.Math.Round((Convert.ToDouble(harga.Text) / total), 3); n3 = System.Math.Round((Convert.ToDouble(masaaktif.Text) / total), 3);

n4 = System.Math.Round((Convert.ToDouble(jaringan.Text) / total), 3);

(8)

label19.Text = Convert.ToString(n3); label22.Text = Convert.ToString(n4);

MySqlConnection db = new MySqlConnection(connectionSQL); MySqlCommand command = db.CreateCommand();

command.CommandText = "SELECT * FROM spk"; db.Open();

DataSet ds = new DataSet();

MySqlDataAdapter da = new MySqlDataAdapter(command); da.Fill(ds, "data");

dataGridView1.DataSource = ds; dataGridView1.DataMember = "data"; db.Close();

for (int rows = 0; rows < dataGridView1.Rows.Count-1; rows++) {

for (int col = 0; col < dataGridView1.Rows[rows].Cells.Count; col++)

{

Total[rows, col] =

this.dataGridView1.Rows[rows].Cells[col].Value.ToString(); }

}

string[] row = new string[99];

for (int i= 0 ; i < dataGridView1.Rows.Count - 1; i++) {

volume[i] = Convert.ToInt32(Total[i, 2]) * n1; price[i] = Convert.ToInt32(Total[i, 3]) * n2; periode[i] = Convert.ToInt32(Total[i, 4]) * n3; speed[i] = Convert.ToInt32(Total[i, 5]) * n4;

dataGridView3.ColumnCount = 5;

dataGridView3.Columns[0].Name = "Nama"; dataGridView3.Columns[1].Name = "Kuota"; dataGridView3.Columns[2].Name = "Harga"; dataGridView3.Columns[3].Name = "Masa Aktif";

dataGridView3.Columns[4].Name = "Jaringan";

row = new string[] { Total[i,1], Convert.ToString(volume[i]),

Convert.ToString(price[i]), Convert.ToString(periode[i]),

Convert.ToString(speed[i]) };

dataGridView3.Rows.Add(row);

}

for (int i = 0; i < dataGridView1.Rows.Count-1; i++) {

bobot_evaluasi[i] = volume[i] + price[i] + periode[i] + speed[i];

db.Open();

MySqlCommand input = db.CreateCommand();

string commend = "insert into smart values('" + Total[i,1] + "'," + bobot_evaluasi[i] + ");";

(9)

MySqlDataReader reader = input.ExecuteReader(); db.Close();

}

MySqlCommand command2 = db.CreateCommand();

command2.CommandText = "SELECT * FROM smart order by total desc"; db.Open();

DataSet ds2 = new DataSet();

MySqlDataAdapter da2 = new MySqlDataAdapter(command2); da2.Fill(ds2, "data");

dataGridView2.DataSource = ds2; dataGridView2.DataMember = "data"; db.Close();

sw.Stop();

label7.Text= "Waktu Eksekusi : " + sw.Elapsed.TotalMilliseconds + " ms";

db.Open();

MySqlCommand inputwaktu = db.CreateCommand();

string commend1 = "insert into waktu values('smart'," + sw.Elapsed.TotalMilliseconds + "); ";

inputwaktu.CommandText = commend1;

MySqlDataReader reader2 = inputwaktu.ExecuteReader(); db.Close();

} } }

wp.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using MySql.Data.MySqlClient;

using System.Diagnostics;

namespace SpkInternet {

public partial class wp : Form {

string[,] Total = new string[99, 6];

string connectionSQL = "server=localhost;database=internet; uid=root;password=;";

double total, n1, n2, n3, n4, totalvektorS=0; double[] volume = new double[99];

double[] price = new double[99]; double[] periode = new double[99];

private void wp_Load(object sender, EventArgs e) {

(10)

label15.Text = ""; label16.Text = ""; label18.Text = ""; label19.Text = ""; label21.Text = ""; label22.Text = ""; }

double[] speed = new double[99]; double[] vektorV = new double[99]; double[] vektorS = new double[99];

public wp() {

InitializeComponent(); this.FormBorderStyle =

System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false;

}

private void button1_Click(object sender, EventArgs e) {

Stopwatch sw = Stopwatch.StartNew();

total = Convert.ToDouble(paket.Text) + Convert.ToDouble(harga.Text)

+ Convert.ToDouble(masaaktif.Text) + Convert.ToDouble(jaringan.Text);

label12.Text = string.Concat(paket.Text, " / ",

Convert.ToString(total));

label15.Text = string.Concat(harga.Text, " / ",

Convert.ToString(total));

label18.Text = string.Concat(masaaktif.Text, " / ",

Convert.ToString(total));

label21.Text = string.Concat(jaringan.Text, " / ",

Convert.ToString(total));

n1 = System.Math.Round((Convert.ToDouble(paket.Text) / total), 3); n2 = System.Math.Round((Convert.ToDouble(harga.Text) / total), 3); n3 = System.Math.Round((Convert.ToDouble(masaaktif.Text) / total), 3);

n4 = System.Math.Round((Convert.ToDouble(jaringan.Text) / total), 3);

label13.Text = Convert.ToString(n1); label16.Text = Convert.ToString(n2); label19.Text = Convert.ToString(n3); label22.Text = Convert.ToString(n4);

dataGridView1.Visible = false;

MySqlConnection db = new MySqlConnection(connectionSQL); MySqlCommand command = db.CreateCommand();

(11)

DataSet ds = new DataSet();

MySqlDataAdapter da = new MySqlDataAdapter(command); da.Fill(ds, "data");

dataGridView1.DataSource = ds; dataGridView1.DataMember = "data"; db.Close();

for (int rows = 0; rows < dataGridView1.Rows.Count - 1; rows++) {

for (int col = 0; col < dataGridView1.Rows[rows].Cells.Count; col++)

{

Total[rows, col] =

this.dataGridView1.Rows[rows].Cells[col].Value.ToString(); }

}

string[] row = new string[99];

for (int i = 0; i < dataGridView1.Rows.Count - 1; i++) {

volume[i] =

System.Math.Round(Math.Pow(Convert.ToDouble(Total[i, 2]),n1),3);

price[i] = System.Math.Round(Math.Pow(Convert.ToDouble(Total[i, 3]),n2),3);

periode[i] =

System.Math.Round(Math.Pow(Convert.ToDouble(Total[i, 4]),n3),3); speed[i] = System.Math.Round(

Math.Pow(Convert.ToDouble(Total[i, 5]),n4),3);

dataGridView3.ColumnCount = 5;

dataGridView3.Columns[0].Name = "Nama"; dataGridView3.Columns[1].Name = "Kuota"; dataGridView3.Columns[2].Name = "Harga"; dataGridView3.Columns[3].Name = "Masa Aktif"; dataGridView3.Columns[4].Name = "Jaringan";

row = new string[] { Total[i, 1], Convert.ToString(volume[i]),

Convert.ToString(price[i]), Convert.ToString(periode[i]),

Convert.ToString(speed[i]) };

dataGridView3.Rows.Add(row);

}

for (int i = 0; i < dataGridView1.Rows.Count - 1; i++) {

vektorS[i] = volume[i] * price[i] * periode[i] * speed[i]; totalvektorS += vektorS[i];

}

for (int i = 0; i < dataGridView1.Rows.Count - 1; i++) {

vektorV[i] = System.Math.Round((vektorS[i] / totalvektorS),3);

db.Open();

(12)

string commend = "insert into wp values('" + Total[i, 1] + "'," + vektorV[i] + ");";

input.CommandText = commend;

MySqlDataReader reader = input.ExecuteReader(); db.Close();

}

MySqlCommand command2 = db.CreateCommand();

command2.CommandText = "SELECT * FROM wp order by total desc"; db.Open();

DataSet ds2 = new DataSet();

MySqlDataAdapter da2 = new MySqlDataAdapter(command2); da2.Fill(ds2, "data");

dataGridView2.DataSource = ds2; dataGridView2.DataMember = "data"; db.Close();

sw.Stop();

label7.Text = "Waktu Eksekusi : " + sw.Elapsed.TotalMilliseconds + " ms";

db.Open();

MySqlCommand inputwaktu = db.CreateCommand();

string commend1 = "insert into waktu values('wp'," + sw.Elapsed.TotalMilliseconds + "); ";

inputwaktu.CommandText = commend1;

MySqlDataReader reader2 = inputwaktu.ExecuteReader(); db.Close();

} } }

Simpati.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using MySql.Data.MySqlClient;

namespace SpkInternet {

public partial class Simpati : Form {

string connectionSQL = "server=localhost;database=internet; uid=root;password=;";

public Simpati() {

InitializeComponent(); this.FormBorderStyle =

(13)

this.MaximizeBox = false; this.MinimizeBox = false; }

private void label1_Click(object sender, EventArgs e) {

MySqlConnection db = new MySqlConnection(connectionSQL); db.Open();

DialogResult button = MessageBox.Show("Yakin memilih paket ini?", "WARNING", MessageBoxButtons.YesNo,MessageBoxIcon.Question,

MessageBoxDefaultButton.Button2);

if (button == DialogResult.Yes) {

MySqlCommand input = db.CreateCommand(); string commend = "insert into picked values('simpati',15,3750,1,'3,5 G');";

input.CommandText = commend;

MySqlDataReader reader = input.ExecuteReader(); label11.Visible = true;

}

}

private void label10_Click(object sender, EventArgs e) {

MySqlConnection db = new MySqlConnection(connectionSQL); db.Open();

DialogResult button = MessageBox.Show("Yakin memilih paket ini?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Question,

MessageBoxDefaultButton.Button2);

if (button == DialogResult.Yes) {

MySqlCommand input = db.CreateCommand(); string commend = "insert into picked values('simpati',30,5000,2,'3,5 G');";

input.CommandText = commend;

MySqlDataReader reader = input.ExecuteReader(); label12.Visible = true;

} }

private void label8_Click(object sender, EventArgs e) {

MySqlConnection db = new MySqlConnection(connectionSQL); db.Open();

DialogResult button = MessageBox.Show("Yakin memilih paket ini?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Question,

MessageBoxDefaultButton.Button2);

if (button == DialogResult.Yes) {

MySqlCommand input = db.CreateCommand(); string commend = "insert into picked values('simpati',50,9000,7,'3,5 G');";

input.CommandText = commend;

MySqlDataReader reader = input.ExecuteReader(); label13.Visible = true;

(14)

}

private void label9_Click(object sender, EventArgs e) {

MySqlConnection db = new MySqlConnection(connectionSQL); db.Open();

DialogResult button = MessageBox.Show("Yakin memilih paket ini?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Question,

MessageBoxDefaultButton.Button2);

if (button == DialogResult.Yes) {

MySqlCommand input = db.CreateCommand(); string commend = "insert into picked values('simpati',100,14000,7,'3,5 G');";

input.CommandText = commend;

MySqlDataReader reader = input.ExecuteReader(); label14.Visible = true;

} }

private void label7_Click(object sender, EventArgs e) {

MySqlConnection db = new MySqlConnection(connectionSQL); db.Open();

DialogResult button = MessageBox.Show("Yakin memilih paket ini?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Question,

MessageBoxDefaultButton.Button2);

if (button == DialogResult.Yes) {

MySqlCommand input = db.CreateCommand(); string commend = "insert into picked values('simpati',300,28000,7,'3,5 G');";

input.CommandText = commend;

MySqlDataReader reader = input.ExecuteReader(); label15.Visible = true;

} }

private void label3_Click(object sender, EventArgs e) {

MySqlConnection db = new MySqlConnection(connectionSQL); db.Open();

DialogResult button = MessageBox.Show("Yakin memilih paket ini?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Question,

MessageBoxDefaultButton.Button2);

if (button == DialogResult.Yes) {

MySqlCommand input = db.CreateCommand(); string commend = "insert into picked values('simpati',600,47500,30,'3,5 G');";

input.CommandText = commend;

MySqlDataReader reader = input.ExecuteReader(); label16.Visible = true;

} }

(15)

{

MySqlConnection db = new MySqlConnection(connectionSQL); db.Open();

DialogResult button = MessageBox.Show("Yakin memilih paket ini?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Question,

MessageBoxDefaultButton.Button2);

if (button == DialogResult.Yes) {

MySqlCommand input = db.CreateCommand(); string commend = "insert into picked values('simpati',2000,87500,30,'3,5 G');";

input.CommandText = commend;

MySqlDataReader reader = input.ExecuteReader(); label17.Visible = true;

} }

private void label4_Click(object sender, EventArgs e) {

MySqlConnection db = new MySqlConnection(connectionSQL); db.Open();

DialogResult button = MessageBox.Show("Yakin memilih paket ini?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Question,

MessageBoxDefaultButton.Button2);

if (button == DialogResult.Yes) {

MySqlCommand input = db.CreateCommand(); string commend = "insert into picked values('simpati',4500,140000,30,'3,5 G');";

input.CommandText = commend;

MySqlDataReader reader = input.ExecuteReader(); label18.Visible = true;

} }

private void label6_Click(object sender, EventArgs e) {

MySqlConnection db = new MySqlConnection(connectionSQL); db.Open();

DialogResult button = MessageBox.Show("Yakin memilih paket ini?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Question,

MessageBoxDefaultButton.Button2);

if (button == DialogResult.Yes) {

MySqlCommand input = db.CreateCommand(); string commend = "insert into picked values('simpati',8000,275000,30,'3,5 G');";

input.CommandText = commend;

MySqlDataReader reader = input.ExecuteReader(); label19.Visible = true;

} }

private void label5_Click(object sender, EventArgs e) {

(16)

DialogResult button = MessageBox.Show("Yakin memilih paket ini?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Question,

MessageBoxDefaultButton.Button2);

if (button == DialogResult.Yes) {

MySqlCommand input = db.CreateCommand(); string commend = "insert into picked values('simpati',14000,480000,30,'3,5 G');";

input.CommandText = commend;

MySqlDataReader reader = input.ExecuteReader(); label20.Visible = true;

} }

private void Simpati_Load(object sender, EventArgs e) {

label11.Visible = false; label12.Visible = false; label13.Visible = false; label14.Visible = false; label15.Visible = false; label16.Visible = false; label17.Visible = false; label18.Visible = false; label19.Visible = false; label20.Visible = false; }

} }

kesimpulan.cs

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using MySql.Data.MySqlClient;

namespace SpkInternet {

public partial class kesimpulan : Form {

string connectionSQL = "server=localhost;database=internet; uid=root;password=;";

public kesimpulan() {

InitializeComponent(); this.FormBorderStyle =

System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false;

}

private void kesimpulan_Load(object sender, EventArgs e) {

(17)

MySqlConnection db = new MySqlConnection(connectionSQL); MySqlCommand command = db.CreateCommand();

command.CommandText = "SELECT * FROM smart order by total desc"; db.Open();

DataSet ds = new DataSet();

MySqlDataAdapter da = new MySqlDataAdapter(command); da.Fill(ds, "data");

dataGridView1.DataSource = ds; dataGridView1.DataMember = "data"; db.Close();

MySqlCommand command2 = db.CreateCommand();

command2.CommandText = "SELECT * FROM wp order by total desc"; db.Open();

DataSet ds2 = new DataSet();

MySqlDataAdapter da2 = new MySqlDataAdapter(command2); da2.Fill(ds2, "data");

dataGridView2.DataSource = ds2; dataGridView2.DataMember = "data"; db.Close();

MySqlCommand command3 = db.CreateCommand();

command3.CommandText = "SELECT * FROM waktu where id='smart'"; db.Open();

var r = command3.ExecuteReader(); if (r.HasRows)

{

r.Read();

label5.Text = r[1].ToString(); }

db.Close();

MySqlCommand command4 = db.CreateCommand();

command4.CommandText = "SELECT * FROM waktu where id='wp'"; db.Open();

var r2 = command4.ExecuteReader(); if (r2.HasRows)

{

r2.Read();

label6.Text = r2[1].ToString(); }

db.Close();

}

private void button1_Click(object sender, EventArgs e) {

MySqlConnection db = new MySqlConnection(connectionSQL); DialogResult button = MessageBox.Show("Semua data akan pada proses ini dihapus, apakah anda yakin?", "WARNING", MessageBoxButtons.YesNo,

MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

(18)

{

MySqlCommand delete = db.CreateCommand();

string commend = "delete from picked where kuota>1;"; db.Open();

delete.CommandText = commend;

MySqlDataReader reader = delete.ExecuteReader(); db.Close();

MySqlCommand delete2 = db.CreateCommand(); commend = "delete from spk where kuota>1;"; db.Open();

delete.CommandText = commend; reader = delete.ExecuteReader(); db.Close();

MySqlCommand delete3 = db.CreateCommand(); commend = "delete from smart where total>0;"; db.Open();

delete.CommandText = commend; reader = delete.ExecuteReader(); db.Close();

MySqlCommand delete4 = db.CreateCommand(); commend = "delete from wp where total>0;"; db.Open();

delete.CommandText = commend; reader = delete.ExecuteReader(); db.Close();

MySqlCommand delete5 = db.CreateCommand(); commend = "delete from waktu where waktu>0;"; db.Open();

delete.CommandText = commend; reader = delete.ExecuteReader(); db.Close();

this.Close(); }

(19)

DAFTAR RIWAYAT HIDUP

Nama

: Farid AG Hasyim

Tempat, Tanggal Lahir

: Padang Panjang, 15 Agustus 1993

Jenis Kelamin

: Laki-Laki

Alamat Sekarang

: Jl. Sembada XII No. 16 Medan

Alamat Orang Tua

: Jorong Baruah Pandai Sikek, Tanah Datar

Hp

: 085362304333

Email

: ag.faridh@gmail.com

PENDIDIKAN FORMAL

2011

2016 : S1 Ilmu Komputer Universitas Sumatera Utara, Medan

2008

2011 : SMK Negeri 2 Padang Panjang

2005

2008 : MTs Negeri Padang Panjang

1999

2005 : SD Negeri 2 Baruah Pandai Sikek

Referensi

Dokumen terkait

5 Ketika mahasiswa masuk ke dalam akunnya, secara langsung mahasiswa dapat melihat pencapaian poin yang telah mereka capai, terdapat 2 jenis kegiatan yang ada di Universitas

Tes untuk mengetahui peningkatan hasil kemampuan siswa selama dalam menulis yang diberikan di setiap akhir tindakan (siklus). Hasil kemampuan akhir siswa dapat

Walisongo, 2013), hlm.. tujuan yang sama dalam penggaruhnya terhadap akhlak. Membaca Al-Qur‟an dapat menenangkan jiwa peserta didik ketika kegiatan belajar berlangsung

Berdasarkan hasil uji statistik deskriptif pada tabel 3 variabel dependen dalam penelitian ini adalah nilai perusahaan yang di ukur dengan Tobin’s Q menunjukkan nilai

[r]

BOPO adalah rasio yang digunakan untuk mengukur kemampuan bank dalam. mengelola biaya operasional dalam rangka mendapatkan

Karena Pada umumnya pria memang tertarik dulu secara fisik, dan wanita dengan payudara yg besar dan ideal akan selalu di kejar dan di buru pria, jadi bagi anda wanita yang mempunyai

ditunjukkan dengan signifikansi (p) sebesar 0,007 lebih kecil dari taraf kesalahan 5% (0.05) sehingga dapat disimpulkan bahwa hanya faktor pemasaran yang dominan