示例#1
0
        private void guna2GradientButton1_Click(object sender, EventArgs e)
        {
            var dh = new dataset.yakkumdbTableAdapters.fa_rx_resep_dTableAdapter();

            dh.Fill(yakkumdb.fa_rx_resep_d);
            var sc           = dh.ScalarQueryNoRacikan(lblKodeRtx.Text).ToString();
            var cs           = Int32.Parse(sc) + 1;
            var _koderacikan = "RC" + _noreg + _kdokter + cs.ToString("00000");
            var _namaracikan = "Racikan " + cs.ToString("00");

            var nu   = dh.ScalarQueryMaxNoUrutResep(lblKodeRtx.Text).ToString();
            var nurs = int.Parse(nu) + 1;
            var temp = 0;
            // MessageBox.Show(nurs.ToString());
            Racikan rc     = new Racikan(0, _kodefornas, _namaracikan, _koderacikan, lblKodeRtx.Text, cs.ToString(), _kdokter, nurs, temp);
            var     result = rc.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();
            }
        }
示例#2
0
        private void load_Template()
        {
            // TODO : _template: 0 = reguler, 1 = template, 2 = edit
            //MessageBox.Show("Show");
            if (_template == 1)
            {
                // MessageBox.Show(_namaracikan.Substring(0, _namaracikan.Length - 3) + "0106");
                var dh = new dataset.yakkumdbTableAdapters.fa_rx_template_racikanTableAdapter();
                dh.FillByTempDokter(yakkumdb.fa_rx_template_racikan, _namaracikan.Substring(0, _namaracikan.Length - 3).TrimStart(), _kdokter, _kodefornas);
                DataTable dt = dh.GetDataByTempDokter(_namaracikan.Substring(0, _namaracikan.Length - 3).TrimStart(), _kdokter, _kdtemplateracikan);

                foreach (DataRow r in dt.Rows)
                {
                    //MessageBox.Show(r["nama_obat"].ToString());

                    DataGridViewRow row = (DataGridViewRow)dgvRacik.Rows[0].Clone();
                    row.Cells[1].Value = r["nama_obat"].ToString();
                    row.Cells[2].Value = r["dosis"].ToString();
                    row.Cells[3].Value = r["satuan"].ToString();
                    row.Cells[5].Value = r["kode_obat"].ToString();

                    dgvRacik.Rows.Add(row);
                }
            }
            if (_template == 2)
            {
                var     dt = new dataset.yakkumdbTableAdapters.fa_rx_racikanTableAdapter();
                var     dh = new dataset.yakkumdbTableAdapters.fa_rx_resep_dTableAdapter();
                DataRow dr = dh.GetDataByRXD(_koderxd).Rows[0];
                //Obat.Text = dr["vc_namaobat"].ToString();
                //lblkodeobat.Text = dr["vc_kode_obat"].ToString();
                txtdd1.Text         = dr["nvc_dd1"].ToString();
                txtdd2.Text         = dr["nvc_dd2"].ToString();
                txtJumlah.Text      = dr["num_jml"].ToString();
                txtSignalain.Text   = dr["vc_signalain"].ToString();
                cmbSatuanDosis.Text = dr["vc_satuan_dosis"].ToString();
                cmbSatuan.Text      = dr["vc_satuan"].ToString();

                DataTable t = dt.GetDataByKodeRD(_koderxd);
                foreach (DataRow r in t.Rows)
                {
                    DataGridViewRow row = (DataGridViewRow)dgvRacik.Rows[0].Clone();
                    row.Cells[1].Value = r["vc_nama_obat"].ToString();
                    row.Cells[2].Value = r["vc_dosis"].ToString();
                    row.Cells[3].Value = r["vc_satuan"].ToString();
                    row.Cells[5].Value = r["vc_k_obat"].ToString();

                    dgvRacik.Rows.Add(row);
                }
            }

            else
            {
                // MessageBox.Show("TEst");
            }
        }
示例#3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtJumlah.Text == "")
            {
                MessageBox.Show("Masukan Jumlah Obat");
                //return false;
            }
            if (checkretriksi() == true)
            {
                var dh = new dataset.yakkumdbTableAdapters.fa_rx_resep_dTableAdapter();
                switch (_edit)
                {
                case true:
                    dh.UpdateQuery(
                        float.Parse(txtJumlah.Text),
                        lblSatuan.Text,
                        txtdd1.Text,
                        txtdd2.Text,
                        cmbSatuanDosis.Text,
                        txtSignalain.Text,
                        _norxd,
                        _nourut
                        );
                    break;

                case false:
                    dh.InsertQuery
                        (_norx,
                        _norx + _kobat,
                        _kobat,
                        "",
                        false,
                        txtSignalain.Text,
                        _btIter,
                        _jmliter,
                        _btFav,
                        Decimal.Parse(txtJumlah.Text),
                        _kdokter,
                        _nourut,
                        txtdd1.Text,
                        txtdd2.Text,
                        lblSatuan.Text,
                        Obat.Text,
                        cmbSatuanDosis.Text
                        );
                    break;
                }



                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
示例#4
0
 private void loaddataedit()
 {
     if (_edit == true)
     {
         var     dh = new dataset.yakkumdbTableAdapters.fa_rx_resep_dTableAdapter();
         DataRow dr = dh.GetDataByRXD(_norxd).Rows[0];
         Obat.Text           = dr["vc_namaobat"].ToString();
         lblkodeobat.Text    = dr["vc_kode_obat"].ToString();
         txtdd1.Text         = dr["nvc_dd1"].ToString();
         txtdd2.Text         = dr["nvc_dd2"].ToString();
         txtJumlah.Text      = dr["num_jml"].ToString();
         txtSignalain.Text   = dr["vc_signalain"].ToString();
         cmbSatuanDosis.Text = dr["vc_satuan_dosis"].ToString();
     }
 }
示例#5
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();
                    }
                }
            }
        }
示例#6
0
        private void button_MouseCliked(object sender, EventArgs e)
        {
            Guna.UI2.WinForms.Guna2Button us = (Guna.UI2.WinForms.Guna2Button)sender;
            var _filter = us.Tag.ToString();


            var dh = new dataset.yakkumdbTableAdapters.fa_rx_resep_dTableAdapter();

            dh.Fill(yakkumdb.fa_rx_resep_d);
            var sc           = dh.ScalarQueryNoRacikan(lblKodeRtx.Text).ToString();
            var cs           = Int32.Parse(sc) + 1;
            var _koderacikan = "RC" + _noreg + _kdokter + cs.ToString("00000");
            var _namaracikan = _filter.ToString().Substring(4) + " " + cs.ToString("00");

            var nu   = dh.ScalarQueryMaxNoUrutResep(lblKodeRtx.Text).ToString();
            var nurs = int.Parse(nu) + 1;

            int temp = 1;
            var kdtemplateracikan = 0;

            if (_kdpng == "323")
            {
                kdtemplateracikan = 3;
            }
            else
            {
                kdtemplateracikan = 1;
            }

            //Racikan rc = new Racikan(_kodefornas, _namaracikan, _koderacikan, lblKodeRtx.Text, cs.ToString(), _kdokter, nurs,temp);
            Racikan rc = new Racikan(kdtemplateracikan, _kodefornas, _namaracikan, _koderacikan, lblKodeRtx.Text, cs.ToString(), _kdokter, nurs, temp);

            var result = rc.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();
            }
        }
示例#7
0
        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();
            }
        }
示例#8
0
        private void uc_cpyResepClik(object sender, EventArgs e)
        {
            Guna.UI2.WinForms.Guna2Button us = (Guna.UI2.WinForms.Guna2Button)sender;
            var _cpyNoResep = us.Tag.ToString();

            //MessageBox.Show(_cpyNoResep);
            var       dh = new dataset.yakkumdbTableAdapters.fa_rx_resep_dTableAdapter();
            var       dt = new dataset.yakkumdbTableAdapters.fa_rx_racikanTableAdapter();
            DataTable ds = dh.GetDataByKodeRXonlyRX(_cpyNoResep);

            foreach (DataRow r in ds.Rows)
            {
                var nu = (int)dh.ScalarQueryMaxNoUrutResep(lblKodeRtx.Text) + 1;
                var sc = (int)dh.ScalarQueryNoRacikan(lblKodeRtx.Text) + 1;

                var _koderacikan = "RC" + _noreg + _kdokter + sc.ToString("00000");
                //MessageBox.Show(_koderacikan);
                if ((Boolean)r["bt_racikan"] == true)
                {
                    dh.InsertQuery
                        (lblKodeRtx.Text,
                        _koderacikan,
                        "999999",
                        sc.ToString(),
                        true,
                        r["vc_signalain"].ToString(),
                        (Boolean)r["bt_iter"],
                        (Decimal)r["num_jmliter"],
                        (Boolean)r["bt_fav"],
                        (Decimal)r["num_jml"],
                        _kdokter,
                        nu,
                        r["nvc_dd1"].ToString(),
                        r["nvc_dd2"].ToString(),
                        r["vc_satuan"].ToString(),
                        r["vc_nama_obat"].ToString(),
                        r["vc_satuan_dosis"].ToString()

                        );
                    DataTable tt = dt.GetDataByKodeRD(r["vc_kode_rx_d"].ToString());
                    foreach (DataRow t in tt.Rows)
                    {
                        dt.InsertQuery(
                            _koderacikan,
                            (int)t["in_no_urut"],
                            t["vc_k_obat"].ToString(),
                            t["vc_nama_obat"].ToString(),
                            t["vc_dosis"].ToString(),
                            t["vc_satuan"].ToString()
                            );
                    }
                }
                else
                {
                    dh.InsertQuery
                        (lblKodeRtx.Text,
                        lblKodeRtx.Text + r["vc_kode_obat"].ToString(),
                        r["vc_kode_obat"].ToString(),
                        "",
                        false,
                        r["vc_signalain"].ToString(),
                        (Boolean)r["bt_iter"],
                        (Decimal)r["num_jmliter"],
                        (Boolean)r["bt_fav"],
                        (Decimal)r["num_jml"],
                        _kdokter,
                        nu,
                        r["nvc_dd1"].ToString(),
                        r["nvc_dd2"].ToString(),
                        r["vc_satuan"].ToString(),
                        r["vc_nama_obat"].ToString(),
                        r["vc_satuan_dosis"].ToString()
                        );
                }
            }

            this.view_resepTableAdapter.Fill(this.yakkumdb.view_resep, lblKodeRtx.Text);
            bs_view_resep.Filter = "vc_kode_rx = '" + lblKodeRtx.Text + "'";
            dgvResep.Update();
            dgvResep.Refresh();

            hrclose();
            //AddData ef = new AddData(_filter, _kodeKlinik, _kodeDokter) { Dock = DockStyle.Fill, TopLevel = false, TopMost = true };
            //this.Controls.Clear();
            //this.Controls.Add(ef);
            //ef.Show();
        }
示例#9
0
        private void dgvResep_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            //MessageBox.Show(e.ColumnIndex.ToString());
            string bt_racikan = this.dgvResep[8, e.RowIndex].Value.ToString();
            var    rxd        = new dataset.yakkumdbTableAdapters.fa_rx_resep_dTableAdapter();
            var    dtracikan  = new dataset.yakkumdbTableAdapters.fa_rx_racikanTableAdapter();
            var    _kdrxd     = this.dgvResep[5, e.RowIndex].Value.ToString();

            if (e.RowIndex < 0)
            {
                return;
            }

            //I suposed you want to handle the event for column at index 1
            if (e.ColumnIndex == 9)
            {
                _kodeobat = this.dgvResep[1, e.RowIndex].Value.ToString();


                if (bt_racikan == "False")
                {
                    dosis ds = new dosis
                                   (_kodeobat,
                                   lblKodeRtx.Text,
                                   _kdokter,
                                   (int)this.dgvResep[7, e.RowIndex].Value,
                                   _kodefornas,
                                   _kdrxd,
                                   true);
                    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();
                    }
                }
                if (bt_racikan == "True")
                {
                    //MessageBox.Show("Edit Racikan");
                    var temp = 2;

                    // MessageBox.Show(nurs.ToString());
                    Racikan rc = new Racikan(
                        0,
                        _kodefornas,
                        _kodeobat,
                        _kdrxd,
                        lblKodeRtx.Text,
                        this.dgvResep[7, e.RowIndex].Value.ToString(),
                        _kdokter,
                        (int)this.dgvResep[7, e.RowIndex].Value,
                        temp);
                    var result = rc.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();
                    }
                }

                //MessageBox.Show(this.dgvResep[11, e.RowIndex].Value.ToString());
                // TODO : Edit Event
                //var kdrxd = this.dgvResep[8, e.RowIndex].Value.ToString();
                //var kdrx = this.dgvResep[9, e.RowIndex].Value.ToString();
                //var nourut = Int32.Parse(this.dgvResep[10, e.RowIndex].Value.ToString());
                //var namaobat = this.dgvResep[1, e.RowIndex].Value.ToString();
                //MessageBox.Show(namaobat + kdrx+_kdokter+nourut);
                //dosis ds = new dosis(namaobat, kdrx, _kdokter, nourut);
                //var result = ds.ShowDialog();
                //if (result == DialogResult.OK)
                //{
                //    this.view_resepTableAdapter.Fill(this.yakkumdb.view_resep, lblKodeRtx.Text);
                //    dgvResep.Update();
                //    dgvResep.Refresh();
                //}
            }

            if (e.ColumnIndex == 10)
            {
                // Deleted event
                var val     = this.dgvResep[5, e.RowIndex].Value.ToString();
                var no_urut = Int32.Parse(this.dgvResep[7, e.RowIndex].Value.ToString());
                rxd.DeleteObat(val, no_urut);
                if (bt_racikan == "True")
                {
                    dtracikan.DeleteQueryByKodeRXD(_kdrxd);
                }

                this.view_resepTableAdapter.Fill(this.yakkumdb.view_resep, lblKodeRtx.Text);
                dgvResep.Update();
                dgvResep.Refresh();
                // MessageBox.Show("Deleted! " + val);
            }
        }
示例#10
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            switch (cekkelengkapan())
            {
            case false:
                //MessageBox.Show("Salah");
                break;

            case true:
                //MessageBox.Show("Benar");
                var dt = new dataset.yakkumdbTableAdapters.fa_rx_racikanTableAdapter();
                dt.DeleteQueryByKodeRXD(_koderxd);
                for (int i = 0; i < dgvRacik.RowCount - 1; i++)
                {
                    dt.InsertQuery(
                        _koderxd,
                        i + 1,
                        dgvRacik.Rows[i].Cells[5].Value.ToString(),
                        dgvRacik.Rows[i].Cells[1].Value.ToString(),
                        dgvRacik.Rows[i].Cells[2].Value.ToString(),
                        dgvRacik.Rows[i].Cells[3].Value.ToString()
                        );
                    //if (dgvRacik.Rows[i].Cells[2].Value.ToString() == "" || string.IsNullOrEmpty(dgvRacik.Rows[i].Cells[3].Value as string))
                    //{
                    //    MessageBox.Show("Masukan Obat Racikan");
                    //}
                    //else
                    //{
                    //dt.InsertQuery(
                    //   _koderxd,
                    //   i + 1,
                    //   dgvRacik.Rows[i].Cells[5].Value.ToString(),
                    //   dgvRacik.Rows[i].Cells[1].Value.ToString(),
                    //   dgvRacik.Rows[i].Cells[2].Value.ToString(),
                    //   dgvRacik.Rows[i].Cells[3].Value.ToString()
                    //);
                    //}
                }
                var dh = new dataset.yakkumdbTableAdapters.fa_rx_resep_dTableAdapter();
                if (_template == 2)
                {
                    dh.UpdateQuery(
                        Double.Parse(txtJumlah.Text),
                        cmbSatuan.Text,
                        txtdd1.Text,
                        txtdd2.Text,
                        cmbSatuanDosis.Text,
                        txtSignalain.Text,
                        _koderxd,
                        _nourut
                        );
                }
                else
                {
                    dh.InsertQuery
                        (_koderx,
                        _koderxd,
                        "999999",
                        _kracik,
                        true,
                        txtSignalain.Text,
                        _btIter,
                        _jmliter,
                        false,
                        Int32.Parse(txtJumlah.Text),
                        _kdokter,
                        _nourut,
                        txtdd1.Text,
                        txtdd2.Text,
                        cmbSatuan.Text,
                        _namaracikan,
                        cmbSatuanDosis.Text

                        );
                }
                this.DialogResult = DialogResult.OK;
                this.Close();
                break;
            }


            //if(cekkelengkapan() == false) { MessageBox.Show("Salah"); }
            //if (cekkelengkapan() == true)
            //{

            //}
            ////if (txtJumlah.Text == "")
            ////{
            ////    MessageBox.Show("Masukkan Jumlah Racikan");
            ////}
            ////if(cmbSatuanDosis.SelectedIndex == -1)
            ////{
            ////    MessageBox.Show("Pilih Satuan Dosis");
            ////}
            //else
            //{

            //}
        }