Exemplo n.º 1
0
        private void btnSac_Click(object sender, EventArgs e)
        {
            string           idlek   = "";
            string           jmbglek = "";
            OracleCommand    command;
            OracleDataReader reader;
            string           connectionString = DBConnection.GetConnectionString();

            using (OracleConnection connection = new OracleConnection())
            {
                connection.ConnectionString = connectionString;
                connection.Open();
                string sql = "";

                string jmbgpac = cbPrimPacijent.SelectedItem.ToString().Split(' ').Last();

                sql = "SELECT ID_ZR,JMBGZR FROM IZBOR_LEKARA WHERE JMBGP='" + jmbgpac + "'";

                command            = new OracleCommand(sql);
                command.Connection = connection;
                reader             = command.ExecuteReader();

                while (reader.Read())
                {
                    idlek   = reader["ID_ZR"].ToString();
                    jmbglek = reader["JMBGZR"].ToString();
                }

                sql = "insert into PRIJEM_PACIJENTA (JMBGP,DATUM_PRIJEMA,ID_PRIJEMA,JMBGZR, ID_ZR) values('"
                      + jmbgpac + "','" + mtbDatPrijema.Value.ToString("dd-MMM-yyyy") + "','"
                      + DBConnection.RandomString(5) + "','" + jmbglek + "','" + idlek + "')";
                try
                {
                    command            = new OracleCommand(sql);
                    command.Connection = connection;
                    command.ExecuteNonQuery();
                }
                catch (Exception)
                {
                    throw;
                }



                //  ReceptSnim rs = new ReceptSnim("Uspešno snimljeni podaci o prijemu pacijenta");
                //   rs.ShowDialog();
                //  this.Opacity = .70;
                //DialogResult dr = rs.ShowDialog();
                //if (dr == DialogResult.Cancel)
                //{
                this.Close();
                // }

                this.DialogResult = DialogResult.OK;
                connection.Close();
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string connectionString = DBConnection.GetConnectionString();

            using (OracleConnection connection = new OracleConnection())
            {
                connection.ConnectionString = connectionString;
                connection.Open();
                string sql = "";

                OracleCommand command = new OracleCommand(sql);
                command.Connection = connection;

                sql = "insert into ZDRAVSTVENI_KARTON (BR_ZK, IDREC, ID_NALAZA, ID_POMAGALA, ID_UPUTA, JMBGZR, ID_ZR, JMBGP, ANAMNEZA, STATUS_PREGLEDA,"
                      + " TERAPIJA,DIJAGNOZA, HRONICNA_DIJAG_, DAT_KONTROLE, NAPOMENA, DAT_POSETE,ZNAK_UPOZ) values ("
                      + "'" + DBConnection.RandomString(6) + "','','','','','"
                      + jmbg_lekara + "','" + id_lekara + "','" + id_pacijenta + "','" + rtbAnamneza.Text + "','" + rtbStatPreg.Text + "','"
                      + rtbTerapija.Text + "','" + mtbSifDij.Text + " " + tbDijag.Text + "','" + rtbHronDijag.Text + "','" + mtbDatKon.Value.ToString("dd-MMM-yyyy") + "','"
                      + rtbNapomena.Text + "','" + mtbDatPos.Value.ToString("dd-MMM-yyyy") + "','" + rtbZnakUpoz.Text + "')";

                try
                {
                    command            = new OracleCommand(sql);
                    command.Connection = connection;
                    command.ExecuteNonQuery();
                }
                catch (Exception)
                {
                    throw;
                }

                ReceptSnim rss = new ReceptSnim("Uspešno snimljeni podaci");
                //   rs.ShowDialog();
                //this.Opacity = .70;
                rss.ShowDialog();
                //if (drrr == DialogResult.OK)
                //{
                //    this.Opacity = 1;
                //}

                //this.DialogResult = DialogResult.OK;
                connection.Close();
            }
        }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            string connectionString = DBConnection.GetConnectionString();

            using (OracleConnection connection = new OracleConnection())
            {
                connection.ConnectionString = connectionString;
                connection.Open();
                string sql = "";

                sql = "SELECT ID_VRSTE_BOL FROM VRSTA_BOLOVANJA WHERE NAZIV_VRSTE_BOL='" + cbVrstaBol.SelectedItem.ToString() + "'";
                OracleCommand command = new OracleCommand(sql);
                command.Connection = connection;
                OracleDataReader reader = command.ExecuteReader();

                while (reader.Read())
                {
                    ids_vrsta_bol = (String)reader[0];
                    //Console.WriteLine(ids_vrsta_uputa);
                }

                sql                = "SELECT ID_STATUSA_BOL FROM STATUS_BOLOVANJA WHERE NAZIV_STATUSA='" + cbStatBol.SelectedItem.ToString() + "'";
                command            = new OracleCommand(sql);
                command.Connection = connection;
                reader             = command.ExecuteReader();

                while (reader.Read())
                {
                    ids_statusa_bol = (String)reader[0];
                    //Console.WriteLine(ids_vrsta_uputa);
                }

                int recidiv;
                if (chbRecidiv.Checked)
                {
                    recidiv = 1;
                }
                else
                {
                    recidiv = 0;
                }

                int trecel;
                if (chbTreceLice.Checked)
                {
                    trecel = 1;
                }
                else
                {
                    trecel = 0;
                }

                /*insert into BOLOVANJE (JMBGZR, ID_ZR, JMBGP, ID_OBRASCA, ID_STATUSA_BOL, ID_VRSTE_BOL, POC_DATUM_BOL, KRAJ_DATUM_BOL, SPOLJ_UZROK, DIJAGNOZA, NALAZ, RECIDIV, TRECE_LICE, DAT_IZD_BOL)*/

                sql = "insert into BOLOVANJE(JMBGZR, ID_ZR, JMBGP, ID_OBRASCA, ID_STATUSA_BOL, ID_VRSTE_BOL, POC_DATUM_BOL, KRAJ_DATUM_BOL, SPOLJ_UZROK, DIJAGNOZA, NALAZ, RECIDIV, TRECE_LICE, DAT_IZD_BOL) VALUES ("
                      + "'" + "0307956152401', 'DFHKLPR9','1107954152487'" + ",'" + DBConnection.RandomString(6) + "','" + ids_statusa_bol + "','" + ids_vrsta_bol + "','" + mtbPocDat.Value.ToString("dd-MMM-yyyy") + "','" + mtbKrajDat.Value.ToString("dd-MMM-yyyy") + "','"
                      + tbSpoljUzrok.Text + "','" + tbDijag.Text + "','" + rtNalaz.Text + "','" + recidiv + "','" + trecel + "','" + mtbDatIzd.Value.ToString("dd-MMM-yyyy") + "')";

                //('0307956152401', 'DFHKLPR9','1107954152487','623327','1','00','02-jun-2012','21-jun-2012','d','dd','ddd','0','1','01-jun-2012')";

                try
                {
                    command            = new OracleCommand(sql);
                    command.Connection = connection;
                    command.ExecuteNonQuery();
                }
                catch (Exception)
                {
                    throw;
                }



                ReceptSnim rs = new ReceptSnim("Uspešno kreirano bolovanje");
                //   rs.ShowDialog();
                this.Opacity = .70;
                DialogResult dr = rs.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    //this.Opacity = 1;
                    this.Close();
                }

                // label6.Text = sql;
                connection.Close();
                //this.DialogResult = DialogResult.OK;
            }
        }