private void buttonSimpan_Click(object sender, EventArgs e) { try { int selectindexspk = comboBoxSPK.SelectedIndex; int selectindexmesin = comboBoxMesin.SelectedIndex; int selectindexpekerja = comboBoxPekerja.SelectedIndex; Pekerja p = listdaftarpekerja[selectindexpekerja]; Mesin m = listaftarmesin[selectindexmesin]; Spk s = listaftarspk[selectindexspk]; ProgresProduksi pk = new ProgresProduksi(textBoxNoDokumen.Text, s, m, p, dateTimePickerTglMulai.Value, dateTimePickerTglSelesai.Value, comboBoxStatus.Text, textBoxKeterengan.Text); //ProgresProduksi pk = new ProgresProduksi(textBoxNoDokumen.Text, comboBoxStatus.Text); string hasil = ProgresProduksi.TambahData(pk); if (hasil == "1") { MessageBox.Show("Data Telah ditambahkan"); frmDaftar.FormDaftarProgress_Load(sender, e); buttonKosongi_Click(sender, e); } else { MessageBox.Show("Error tidak bisa menambahkan data :" + hasil); } } catch (Exception ex) { MessageBox.Show("Error : " + ex); } }
private void button1_Click(object sender, EventArgs e) { try { string hasil = ProgresProduksi.HapusData(comboBoxNoDok.Text); if (hasil == "1") { MessageBox.Show("Data Berhasil Dihapus"); FormDaftarProgress frm = new FormDaftarProgress(); frm.FormDaftarProgress_Load(sender, e); } else { MessageBox.Show("Error : " + hasil); } } catch (Exception ex) { MessageBox.Show("Hasil : " + ex); } }
private void buttonSimpan_Click(object sender, EventArgs e) { try { ProgresProduksi pp = new ProgresProduksi(comboBoxNoDokumen.Text, comboBoxStatus.Text); string hasil = ProgresProduksi.UbahData(pp); if (hasil == "1") { MessageBox.Show("Data Berhasil diubah"); FormDaftarProgress frm = new FormDaftarProgress(); frm.FormDaftarProgress_Load(sender, e); buttonKosongi_Click(sender, e); } else { MessageBox.Show("Error : " + hasil); } } catch (Exception ex) { MessageBox.Show("Hasil : " + ex); } }