private void btnSave_Click(object sender, EventArgs e) { var dh = new dataset.yakkumdbTableAdapters.resep_hTableAdapter(); if (rbTanpaObat.Checked == true) { dh.UpdateTanpaObat(rbTanpaObat.Text, true, _kdresep); } else if (rbRujuk.Checked == true) { dh.UpdateTanpaObat(rbRujuk.Text, true, _kdresep); } else if (rbOpname.Checked == true) { dh.UpdateTanpaObat(rbOpname.Text, true, _kdresep); } this.DialogResult = DialogResult.Yes; this.Close(); }
private void btnFinish_Click(object sender, EventArgs e) { var dh = new dataset.yakkumdbTableAdapters.resep_hTableAdapter(); var dh2 = new dataset.yakkumdbTableAdapters.fa_rx_resep_dTableAdapter(); var jmlObat = (int)dh2.ScalarQueryJmlObat(_koderesep); //MessageBox.Show(jmlObat.ToString()); UpsertResep(); Pilihan pl = new Pilihan(); if (jmlObat == 0) { NoDrugDialog nd = new NoDrugDialog(_koderesep); var hasil = nd.ShowDialog(); if (hasil == DialogResult.Yes) { dh.UpdateStatus("ORDER", 3, DateTime.Now, _koderesep); var result2 = pl.ShowDialog(); if (result2 == DialogResult.Yes) { dh.UpdateStatus("WAITING", 2, DateTime.Now, _koderesep); } if (result2 == DialogResult.No) { dh.UpdateStatus("ORDER", 3, DateTime.Now, _koderesep); } if (cbIterResep.Checked) { dh.UpdateIter(true, (int)numIterResep.Value, _koderesep, _noreg); } insertCPPT(); insertDiagnosa(); insertProcedure(); dh.UpdateTanpaObat("", false, _koderesep); MessageBox.Show("Resep Berhasil di Simpan"); LoadHome(); } } if (jmlObat > 0) { var result = pl.ShowDialog(); if (result == DialogResult.Yes) { dh.UpdateStatus("WAITING", 2, DateTime.Now, _koderesep); } if (result == DialogResult.No) { dh.UpdateStatus("ORDER", 3, DateTime.Now, _koderesep); } if (cbIterResep.Checked) { dh.UpdateIter(true, (int)numIterResep.Value, _koderesep, _noreg); } insertCPPT(); insertDiagnosa(); insertProcedure(); dh.UpdateTanpaObat("", false, _koderesep); MessageBox.Show("Resep Berhasil di Simpan"); LoadHome(); } }