private void buttonBuat_Click(object sender, EventArgs e) { string hasils = "1"; for (int i = 0; i < listHasilData[comboBoxKode.SelectedIndex].Listpemesanan.Count; i++) { List <DetailPemesananBahanBaku> kk = new List <DetailPemesananBahanBaku>(); int p = (int)dataGridViewBarang.Rows[i].Cells[0].Value; string hasil = DetailPemesananBahanBaku.Confirm(p, dateTimePicker1.Value); if (hasil != "1") { MessageBox.Show("Pemesanan gagal dikonfirmasi. Pesan : " + hasil); hasils = "0"; break; } } if (hasils == "1") { MessageBox.Show("Pemesanan telah berhasil di konfirmasi. Bahan Baku telah ditambah"); for (int i = 0; i < s[0].Listpemesanan.Count; i++) { BahanBaku.TambahStok(s[0].Listpemesanan[i].IDbahan.Id, s[0].Listpemesanan[i].Jumlah); } FormDetailPemesananBahanBaku k = (FormDetailPemesananBahanBaku)this.Owner; k.FormDetailPemesananBahanBaku_Load(sender, e); FormUbahPemesananBahanBaku_Load(sender, e); } }
private void button1_Click(object sender, EventArgs e) { FormDetailPemesananBahanBaku k = new FormDetailPemesananBahanBaku(); k.Owner = this; k.Show(); }