Example #1
0
        private void btnSimpan_Click(object sender, EventArgs e)
        {
            var dt = new yakkumdbTableAdapters.fa_rx_tindakanTableAdapter();

            for (int i = 0; i < dgvTindakan.RowCount - 1; i++)
            {
                // if (dgvTindakan.Rows[i].Cells[1].Value.Equals(null))

                if (dgvTindakan.Rows[i].Cells[1].Value != null)
                {
                    dt.DeleteTindakan(_koderx);
                    dt.InsertQuery(
                        _koderx,
                        dgvTindakan.Rows[i].Cells[1].Value.ToString()
                        );
                }
                else
                {
                }
            }

            var dh = new yakkumdbTableAdapters.resep_waitingTableAdapter();

            dh.UpdateQuery(_koderx);
            MessageBox.Show("Data Berhasil di Simpan");
            this.Controls.Clear();
        }
Example #2
0
        private void populateItems()
        {
            flpNotif.Controls.Clear();
            var ds = new yakkumdbTableAdapters.resep_waitingTableAdapter();

            ds.Fill(yakkumdb.resep_waiting, lblKklinik.Text);
            DataTable dt = ds.GetData(lblKklinik.Text);

            foreach (DataRow r in dt.Rows)
            {
                var uc = new CardResep
                {
                    Tag        = r["vc_nid"].ToString() + r["vc_kode_rx"].ToString(),
                    NoRM       = r["vc_no_rm"].ToString(),
                    Nama       = r["vc_nama_Peserta"].ToString(),
                    NoResep    = r["vc_kode_rx"].ToString(),
                    namaklinik = r["vc_kode_poli_bpjs"].ToString(),
                    Dokter     = r["dokter"].ToString(),
                    SEP        = r["vc_no_sep"].ToString(),
                    kdokter    = r["vc_nid"].ToString()
                };

                if (flpNotif.Controls.Count < 0)
                {
                    flpNotif.Controls.Clear();
                }

                else
                {
                    flpNotif.Controls.Add(uc);
                    uc.Click += uc_MouseCliked;
                }
            }
        }
Example #3
0
        private void InputBMHP_Load(object sender, EventArgs e)
        {
            //insert paket gigi
            var dt        = new yakkumdbTableAdapters.bmhpTableAdapter();
            var dt2       = new yakkumdbTableAdapters.resep_waitingTableAdapter();
            var statpaket = dt2.ScalarQueryStatPaket(_koderx);
            var nourut    = (int)dt.ScalarNoUrut(_koderx) + 1;

            if (_kdokter.Substring(0, 2) == "12")
            {
                if (statpaket != "PAKET")
                {
                    this.bmhpTableAdapter.InsertQueryPaketGigi(_koderx, nourut, _kdokter);
                    this.resep_waitingTableAdapter.UpdateQueryStatPaket(_koderx);
                }
            }

            SqlDataReader dReader;
            SqlConnection conn = new SqlConnection();

            conn.ConnectionString = rse.app.desk.rx.nurse.Properties.Settings.Default.yakkumdatabaseConnectionString;
            SqlCommand cmd = new SqlCommand();

            cmd.Connection  = conn;
            cmd.CommandType = CommandType.Text;
            cmd.CommandText =
                "Select  [vc_namaobat],[vc_kodeobat] from [dbo].[view_rse_fa_obat]" +
                "where [kodefornas] >= " + 3 + "and [vc_golongan] = '31'" +
                "or [vc_kodeobat] = '002241'or [vc_kodeobat] = '002769'or [vc_kodeobat] = '002071'" +
                " order by [vc_namaobat] asc";
            conn.Open();
            dReader = cmd.ExecuteReader();
            if (dReader.HasRows == true)
            {
                while (dReader.Read())
                {
                    namesCollection.Add(dReader["vc_namaobat"].ToString());
                }
            }
            else
            {
                MessageBox.Show("Data not found");
            }

            dReader.Close();
            conn.Close();

            txtcariBMHP.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
            txtcariBMHP.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txtcariBMHP.AutoCompleteCustomSource = namesCollection;

            this.resep_waitingTableAdapter.FillByKoderesep(this.yakkumdb.resep_waiting, _koderx);

            this.bmhpTableAdapter.Fill(this.yakkumdb.bmhp, _koderx);
            dgvBMHP.Update();
            dgvBMHP.Refresh();

            this.fa_rx_tindakanTableAdapter.Fill(this.yakkumdb.fa_rx_tindakan, _koderx);
            dgvTindakan.Update();
            dgvTindakan.Refresh();
        }