Esempio n. 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();
            }
        }
Esempio n. 2
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();
            }
        }
Esempio n. 3
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);
            }
        }