Esempio n. 1
0
        private void txtCariObat_KeyDown(object sender, KeyEventArgs e)
        {
            // TODO : Cek Retensi dari Sini
            if (e.KeyCode == Keys.Enter)
            {
                List <string> daftarobat   = new List <string>();
                var           dh           = new dataset.yakkumdbTableAdapters.view_rse_fa_obatTableAdapter();
                var           _resepdetail = new dataset.yakkumdbTableAdapters.fa_rx_resep_dTableAdapter();
                dh.Fill(yakkumdb.view_rse_fa_obat);
                DataTable dt = dh.GetData();
                foreach (DataRow r in dt.Rows)
                {
                    daftarobat.Add(r.Field <string>(4));
                }
                _listobat = daftarobat.ToArray();

                _resepdetail.FillByNoRx(yakkumdb.fa_rx_resep_d, lblKodeRtx.Text);
                DataTable     dta         = _resepdetail.GetDataByNoRx(lblKodeRtx.Text);
                List <string> obatdiresep = new List <string>();
                foreach (DataRow rs in dta.Rows)
                {
                    obatdiresep.Add(rs.Field <string>(1));
                }
                _listobatdetil = obatdiresep.ToArray();
                if (_listobat.Contains(txtCariObat.Text.ToUpper()) == false)
                {
                    MessageBox.Show("Pastikan Nama Obat Sesuai !!", "Important Message");
                }
                //else if (_listobatdetil.Contains(txtCariObat.Text.ToUpper()) == false)
                //{ MessageBox.Show("Obat Sudah Berada di Resep, Edit untuk melakukan perubahan."); }
                else
                {
                    var _maxno = (int)_resepdetail.ScalarQueryMaxNoUrutResep(lblKodeRtx.Text) + 1;
                    //MessageBox.Show(_maxno.ToString());
                    _kodeobat = txtCariObat.Text;
                    dosis ds     = new dosis(_kodeobat, lblKodeRtx.Text, _kdokter, _maxno, _kodefornas, "", false);
                    var   result = ds.ShowDialog();
                    if (result == DialogResult.OK)
                    {
                        this.view_resepTableAdapter.Fill(this.yakkumdb.view_resep, lblKodeRtx.Text);
                        bs_view_resep.Filter = "vc_kode_rx = '" + lblKodeRtx.Text + "'";
                        dgvResep.Update();
                        dgvResep.Refresh();
                    }
                }
            }
        }
Esempio n. 2
0
        private void dosis_Load(object sender, EventArgs e)
        {
            this.view_rse_fa_obatTableAdapter.FillByNamaObat(this.yakkumdb.view_rse_fa_obat, _nmobat);

            dataset.yakkumdbTableAdapters.view_rse_fa_obatTableAdapter da = new dataset.yakkumdbTableAdapters.view_rse_fa_obatTableAdapter();

            DataTable dt = da.GetDataByNamaObat(_nmobat);

            foreach (DataRow r in dt.Rows)
            {
                switch (_kfornas)
                {
                case 0:
                    _retriksi = 999;
                    _kobat    = r.Field <string>(3);
                    break;

                case 3:
                    _retriksi = r.Field <decimal>(0);
                    _kobat    = r.Field <string>(3);
                    break;

                case 2:
                    _retriksi = r.Field <decimal>(0);
                    _kobat    = r.Field <string>(3);
                    break;
                }

                if (_retriksi == 999)
                {
                    retensi.Visible = false;
                }
                else
                {
                }
            }
            bsObat.Filter = "vc_namaobat = '" + Obat.Text + "'";
            retensi.Text  = "Retriksi : " + retensi.Text + " / kasus";

            this.fa_rx_resep_dTableAdapter.FillByKrxD(this.yakkumdb.fa_rx_resep_d, _norx + _kobat);
            loaddataedit();
        }