LAMPIRAN A : LISTING PROGRAM
1. Mainform
/*
* Created by SharpDevelop. * User: User7
* Date: 28/09/2015 * 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)
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 Label42Click(object sender, EventArgs e) {
} } }
2. About
/*
* Created by SharpDevelop. * User: User7
* Date: 28/09/2015 * 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) {
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: 28/09/2015 * 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 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=0;
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 MySqlCommand(Query, MyConn2);
MyConn2.Open();
maxc1=Convert.ToDouble(command1.ExecuteScalar().ToStr ing());
MySqlCommand command2 = new MySqlCommand("select max(C2) from db_spk_bimbel.tb_bobot",MyConn2);
maxc2=Convert.ToDouble(command2.ExecuteScalar().ToStr ing());
MySqlCommand command3 = new MySqlCommand("select max(C3) from db_spk_bimbel.tb_bobot",MyConn2);
maxc3=Convert.ToDouble(command3.ExecuteScalar().ToStr ing());
//MessageBox.Show("min" + minc3.ToString());
MySqlCommand command4 = new MySqlCommand("select max(C4) from db_spk_bimbel.tb_bobot",MyConn2);
maxc4=Convert.ToDouble(command4.ExecuteScalar().ToStr ing());
MySqlCommand command5 = new MySqlCommand("select min(C5) 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.Show(hc1.ToString());
double skor
= (hc1*0.3)+(hc2*0.2)+(hc3*0.15)+(hc4*0.25)+(hc5*0.1);
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); }
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 MySqlCommand(Query, MyConn2);
MySqlCommand MyCommand3 = new MySqlCommand(query2, MyConn2);
//MyReader2 = MyCommand2.ExecuteReader(); // Here our query will be executed and data saved into the database.
MyReader2 = MyCommand3.ExecuteReader(); // MessageBox.Show("Save 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 MySqlCommand(Query, 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.Show("Save 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=0;
string MyConnection2
= "server=localhost;port=3306;username=root;password="; MySqlConnection MyConn2
= new MySqlConnection(MyConnection2);
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=hc1*hc2*hc3*hc4*hc5;
String
strskorwpm=skorwpm.ToString("0.####################"); //MessageBox.Show(skorwpm.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 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: 28/09/2015 * 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 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
/*
* Date: 28/09/2015 * Time: 9:53
*
* 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 datalahan.
/// </summary>
public partial class databimbingan : Form {
double c1,c2,c3,c4,c5,c6,c7,c8,c9,c10;
double c1_pm,c2_pm,c3_pm,c4_pm,c5_pm,c6_pm,c7_pm,c8_pm; double c1_pm_ideal,c2_pm_ideal,c3_pm_ideal,c4_pm_ideal,c5_pm_ ideal,c6_pm_ideal,c7_pm_ideal,c8_pm_ideal;
double c1_pm_gap,c2_pm_gap,c3_pm_gap,c4_pm_gap,c5_pm_gap,c6_p m_gap,c7_pm_gap,c8_pm_gap;
double cf,sf,skor; public databimbingan() {
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void Button1Click(object sender, EventArgs e) {
try {
string MyConnection2
db_spk_bimbel.data_bimbel(nama,biaya,fasilitas,jumlah_pertemuan,jumla h_lulus_PTN,jumlah_pengajar)
values('" +this.namabimbel.Text+ "','" +this.c1_biaya.Text+ "','" +th is.c2_fasilitas.Text+ "','" +this.c3_jlh_pert.Text+ "','" +this.c4_jl h_lls.Text+ "','" +this.c5_jlh_peng.Text+ "');";
MySqlConnection MyConn2 = new MySqlConnection(MyConnection2); MySqlCommand MyCommand2 = new MySqlCommand(Query, MyConn2);
//MySqlCommand MyCommand3 = new MySqlCommand(query2, MyConn2);
MySqlDataReader MyReader2; MyConn2.Open();
MyReader2 = MyCommand2.ExecuteReader(); // ekskusi kueri masuk ke database.
// MyReader2 = MyCommand3.ExecuteReader();
MessageBox.Show("Data Tersimpan"); MyConn2.Close();
insertbobot();
insertsaw_normalisasi(); insertwpm();
resetisi();
}
catch (Exception ex) {
MessageBox.Show(ex.Message); } }
void insertbobot() {
try {
string MyConnection2
= "datasource=localhost;port=3306;username=root;password="; //string Query = "insert into
db_padi.padisawah(nama,C1,C2,C3,C4,C5) values('"
+this.namapadisawah.Text+ "','" +c1+ "','" +c2+ "','" +c3+ "','" +c4+ "','" +c5+ "');";
string query2="insert into db_spk_bimbel.tb_bobot(nama,c1,c2,c3,c4,c5)
values('" +this.namabimbel.Text+ "','" +c1+ "','" +c2+ "','" +c3+ "', '" +c4+ "','" +c5+ "');";
//MySqlCommand MyCommand2 = new MySqlCommand(Query, 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.Show("Save Data");
MyConn2.Close(); }
catch (Exception ex) {
MessageBox.Show(ex.Message); }
}
void insertsaw_normalisasi() {
try {
string MyConnection2
= "datasource=localhost;port=3306;username=root;password="; //string Query = "insert into
db_padi.padisawah(nama,C1,C2,C3,C4,C5) values('"
+this.namapadisawah.Text+ "','" +c1+ "','" +c2+ "','" +c3+ "','" +c4+ "','" +c5+ "');";
string query2="insert into
db_spk_bimbel.tb_normalisasi_saw(nama,normalisasi_c1,normalisasi_c2,n ormalisasi_c3,normalisasi_c4,normalisasi_c5,skor)
values('" +this.namabimbel.Text+ "','" +c1+ "','" +c2+ "','" +c3+ "', '" +c4+ "','" +c5+ "','" +0+ "');";
MySqlConnection MyConn2 = new MySqlConnection(MyConnection2);
//MySqlCommand MyCommand2 = new MySqlCommand(Query, 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.Show("Save Data");
MyConn2.Close(); }
MessageBox.Show(ex.Message); }
}
void insertwpm() {
try {
string MyConnection2
= "datasource=localhost;port=3306;username=root;password="; //string Query = "insert into
db_padi.padisawah(nama,C1,C2,C3,C4,C5) values('"
+this.namapadisawah.Text+ "','" +c1+ "','" +c2+ "','" +c3+ "','" +c4+ "','" +c5+ "');";
string query2="insert into db_spk_bimbel.tb_wpm(nama,c1,c2,c3,c4,c5,skor)
values('" +this.namabimbel.Text+ "','" +c1+ "','" +c2+ "','" +c3+ "', '" +c4+ "','" +c5+ "','" +0+ "');";
MySqlConnection MyConn2 = new MySqlConnection(MyConnection2);
//MySqlCommand MyCommand2 = new MySqlCommand(Query, 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.Show("Save Data");
MyConn2.Close(); }
catch (Exception ex) {
MessageBox.Show(ex.Message); }
}
void Unsur1SelectedIndexChanged(object sender, EventArgs e) {
if (c2_fasilitas.SelectedIndex==0){ c2=1;
}
c2=1.5;
}
else if (c2_fasilitas.SelectedIndex==2){ c2=3;
}
else if (c2_fasilitas.SelectedIndex==3){ c2=5;
} }
void Unsur2SelectedIndexChanged(object sender, EventArgs e) {
if (c3_jlh_pert.SelectedIndex==0){ c3=1;
}
else if (c3_jlh_pert.SelectedIndex==1){ c3=2;
}
else if (c3_jlh_pert.SelectedIndex==2){ c3=2.5;
}
else if (c3_jlh_pert.SelectedIndex==3){ c3=3;
}
else if (c3_jlh_pert.SelectedIndex==4){ c3=4;
} }
void Unsur3SelectedIndexChanged(object sender, EventArgs e) {
if (c4_jlh_lls.SelectedIndex==0){ c4=1;
}
else if (c4_jlh_lls.SelectedIndex==1){ c4=1.5;
}
else if (c4_jlh_lls.SelectedIndex==2){ c4=2;
}
else if (c4_jlh_lls.SelectedIndex==3){ c4=4;
}
else if (c4_jlh_lls.SelectedIndex==4){ c4=5;
} }
void Button4Click(object sender, EventArgs e) {
try {
string MyConnection2
= "server=localhost;port=3306;username=root;password="; //Display query
string Query = "select * from db_spk_bimbel.data_bimbel;";
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);
data.
MyConn2.Close();
string MyConnectionpm
= "server=localhost;port=3306;username=root;password="; //Display query
string Querypm = "select * from db_spk_bimbel.tb_bobot;";
MySqlConnection MyConnpm = new MySqlConnection(MyConnectionpm); MySqlCommand MyCommandpm
= new MySqlCommand(Querypm, MyConnpm); MyConnpm.Open();
//For offline connection we weill use MySqlDataAdapter class.
MySqlDataAdapter MyAdapterpm = new MySqlDataAdapter();
MyAdapterpm.SelectCommand = MyCommandpm; //DataTable dTable = new DataTable();
DataTable dTablepm = new DataTable(); MyAdapterpm.Fill(dTablepm);
dataGridView2.DataSource = dTablepm; // here i have assign dTable object to the dataGridView1 object to display data.
MyConnpm.Close(); resetisi();
}
catch (Exception ex) {
MessageBox.Show(ex.Message); } }
void Button2Click(object sender, EventArgs e) {
resetisi(); }
void resetisi(){
namabimbel.Text=""; c1_biaya.Text=null; c2_fasilitas.Text=null; c3_jlh_pert.Text=null; c4_jlh_lls.Text=null; c5_jlh_peng.Text=null; }
{
try {
string MyConnection2
= "datasource=localhost;port=3306;username=root;password=";
string Query = "delete from db_spk_bimbel.data_bimbel where nama='" + this.namabimbel.Text + "';";
MySqlConnection MyConn2 = new MySqlConnection(MyConnection2); MySqlCommand MyCommand2 = new MySqlCommand(Query, MyConn2);
MySqlDataReader MyReader2; MyConn2.Open();
MyReader2 = MyCommand2.ExecuteReader(); MessageBox.Show("Data Deleted");
MyConn2.Close(); deletebobot(); deletesaw(); deletewpm(); resetisi(); }
catch (Exception ex) {
MessageBox.Show(ex.Message); } }
void deletebobot(){ try
{
string MyConnection2
= "datasource=localhost;port=3306;username=root;password=";
string Query = "delete from db_spk_bimbel.tb_bobot where nama='" + this.namabimbel.Text + "';";
MySqlConnection MyConn2 = new MySqlConnection(MyConnection2); MySqlCommand MyCommand2 = new MySqlCommand(Query, MyConn2);
MySqlDataReader MyReader2; MyConn2.Open();
MyReader2 = MyCommand2.ExecuteReader(); //MessageBox.Show("Data Deleted");
MyConn2.Close();
}
catch (Exception ex) {
MessageBox.Show(ex.Message); }
}
void deletesaw(){ try
{
string MyConnection2
= "datasource=localhost;port=3306;username=root;password="; string Query = "delete from
db_spk_bimbel.tb_normalisasi_saw where nama='" + this.namabimbel.Text + "';"; MySqlConnection MyConn2 = new MySqlConnection(MyConnection2); MySqlCommand MyCommand2 = new MySqlCommand(Query, MyConn2);
MySqlDataReader MyReader2; MyConn2.Open();
MyReader2 = MyCommand2.ExecuteReader(); //MessageBox.Show("Data Deleted");
MyConn2.Close();
}
catch (Exception ex) {
MessageBox.Show(ex.Message); }
}
void deletewpm(){ try
{
string MyConnection2
= "datasource=localhost;port=3306;username=root;password="; string Query = "delete from db_spk_bimbel.tb_wpm where nama='" + this.namabimbel.Text + "';";
MySqlConnection MyConn2 = new MySqlConnection(MyConnection2); MySqlCommand MyCommand2 = new MySqlCommand(Query, MyConn2);
MySqlDataReader MyReader2; MyConn2.Open();
MyReader2 = MyCommand2.ExecuteReader(); // MessageBox.Show("Data Deleted");
MyConn2.Close();
}
catch (Exception ex) {
}
void statusBiayaSelectedIndexChanged(object sender, EventArgs e)
{
if (c1_biaya.SelectedIndex==0){ c1=5;
}
else if (c1_biaya.SelectedIndex==1){ c1=3;
}
else if (c1_biaya.SelectedIndex==2){ c1=2.5;
}else if (c1_biaya.SelectedIndex==3){ c1=2;
}else if (c1_biaya.SelectedIndex==4){ c1=1;
} }
void jlhpengajarSelectedIndexChanged(object sender, EventArgs e)
{
if (c5_jlh_peng.SelectedIndex==0){ c5=1;
}
else if (c5_jlh_peng.SelectedIndex==1){ c5=2;
}
else if (c5_jlh_peng.SelectedIndex==2){ c5=2.5;
}
else if (c5_jlh_peng.SelectedIndex==3){ c5=3.5;
}
else if (c5_jlh_peng.SelectedIndex==3){ c5=4;
}
else if (c5_jlh_peng.SelectedIndex==4){ c5=5;
} }
void DataGridView1CellContentClick(object sender, DataGridVie wCellEventArgs e)
{
namabimbel.Text=
dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); }
void DataGridView2CellContentClick(object sender, DataGridVie wCellEventArgs e)
{
namabimbel.Text=
dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
}
void DatabimbinganLoad(object sender, EventArgs e) {
}
void GroupBox2Enter(object sender, EventArgs e) {