private void button1_Click(object sender, EventArgs e) { string connectionString = GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); string sql = ""; OracleCommand command = new OracleCommand(sql); command.Connection = connection; String sss = RandomString(12); Console.WriteLine(sss); idRecepta = RandomString(12); sql = "insert into RECEPT(SIFDIJ, DATIZD, IDREC, JMBGZR, ID_ZR, JMBGP, SIFL, PROP__KOLICINA_LEKA,IZNOS) VALUES (" + "'" + tbSifDij.Text + "','" + mtbDatRec.Value.ToString("dd-MMM-yyyy") + "','" + idRecepta + "','" + jmbglek + "', '" + idlek + "','" + jmbgpac + "','" + textBox4.Text + "','" + cbPropKut.SelectedItem.ToString() + "','" + tbPropCena.Text + "')"; try { command = new OracleCommand(sql); command.Connection = connection; command.ExecuteNonQuery(); } catch (Exception) { throw; } ReceptSnim rs = new ReceptSnim("Uspešno kreiran recept"); // rs.ShowDialog(); this.Opacity = .70; DialogResult dr = rs.ShowDialog(); if (dr == DialogResult.OK) { PrintRecept stampa = new PrintRecept(idRecepta, tbNazDij.Text, textBox2.Text, jmbgpac); stampa.ShowDialog(); //this.Opacity = 1; //this.Close(); } // label6.Text = sql; connection.Close(); //this.DialogResult = DialogResult.OK; } }
private void btnSnimAnam_Click(object sender, EventArgs e) { SnimiAnam sa = new SnimiAnam(rtbAnamneza.Text); DialogResult dr = sa.ShowDialog(); if (dr == DialogResult.OK) { string rez = sa.rezNazivAnam; 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 ANAM (NAZAN, OPISAN) values ('" + rez + "','" + rtbAnamneza.Text + "')"; try { command = new OracleCommand(sql); command.Connection = connection; command.ExecuteNonQuery(); } catch (Exception) { throw; } ReceptSnim rss = new ReceptSnim("Uspešno snimljeni podaci", true); // rs.ShowDialog(); //this.Opacity = .70; rss.ShowDialog(); //if (drrr == DialogResult.OK) //{ // this.Opacity = 1; //} //this.DialogResult = DialogResult.OK; connection.Close(); } } }
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(); } }
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; } }
private void btnSac_Click(object sender, EventArgs e) { OracleCommand command; OracleDataReader reader; string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); string sql = ""; string jmbgpac = ""; string idlek = ""; string jmbglek = ""; string idrazl = ""; idlek = cbLekar.SelectedItem.ToString().Split(' ').Last(); // Console.WriteLine("IDLEK "+idlek); jmbgpac = cbPacijent.SelectedItem.ToString().Split(' ').Last(); // Console.WriteLine("JMBGP " + jmbgpac); sql = "SELECT JMBGZR FROM LEKAR_OPSTE_MEDICINE WHERE ID_ZR='" + idlek + "'"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); while (reader.Read()) { jmbglek = (String)reader[0]; } sql = "SELECT IDRAZL FROM RAZLOG_IZBORA WHERE NAZRAZL='" + cbRazlog.SelectedItem.ToString() + "'"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); while (reader.Read()) { idrazl = (String)reader[0]; } sql = "INSERT INTO IZBOR_LEKARA (JMBGZR, ID_ZR, JMBGP, IDRAZL, DATUM_IZBORA) values('" + jmbglek + "','" + idlek + "','" + jmbgpac + "','" + idrazl + "','" + mtbDatIzbora.Value.ToString("dd-MMM-yyyy") + "')"; try { command = new OracleCommand(sql); command.Connection = connection; command.ExecuteNonQuery(); } catch (Exception) { throw; } ReceptSnim rs = new ReceptSnim("Uspešno snimljeni podaci o pacijentu"); // rs.ShowDialog(); this.Opacity = .70; DialogResult dr = rs.ShowDialog(); if (dr == DialogResult.Cancel) { //this.Opacity = 1; this.Close(); } // label6.Text = sql; connection.Close(); //this.DialogResult = DialogResult.OK; } }
private void button1_Click(object sender, EventArgs e) { string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); string sql = ""; string idodel = ""; sql = "SELECT IDODEL FROM VRSTA_ODELJENJA WHERE NAZODEL='" + cbVrstaOdel.SelectedItem.ToString() + "'"; OracleCommand command = new OracleCommand(sql); command.Connection = connection; OracleDataReader reader = command.ExecuteReader(); while (reader.Read()) { idodel = (String)reader[0]; } sql = "INSERT INTO REGISTRACIJA(VRSTAKOR,IDODEL,IDZAP,IMEZAP,PRZZAP,JMBGZAP,TELZAP,ADRZAP,GRADZAP,DRZZAP,USERZAP,SIFRAZAP) VALUES" + "('" + cbVrstaKor.SelectedItem.ToString() + "','" + idodel + "','" + tbIdZap.Text + "','" + tbIme.Text + "','" + tbPrez.Text + "','" + mtbJmbg.Text + "','" + tbTel.Text + "','" + tbAdr.Text + "','" + cbGrad.SelectedItem.ToString() + "','Srbija','" + tbUsr.Text + "','" + tbPass.Text + "')"; //('Lekar specijalista','UGN','AAABBBCC','Filip','Filipovic','1210980502010','0038121543365','Kosovska 1a','Novi Sad', 'Srbija','user','user')"; sql1 = "INSERT INTO ZDRAVSTVENI_RADNIK (IME, PRZ, JMBGZR, TEL_ZR, ADR_ZR, ZANIMANJE_ZR,ID_ZR, IDZU,DAT_RODJ) VALUES" + "('" + tbIme.Text + "','" + tbPrez.Text + "','" + mtbJmbg.Text + "','" + tbTel.Text + "','" + tbAdr.Text + ", " + cbGrad.SelectedItem.ToString() + "','" + cbVrstaKor.SelectedItem.ToString() + "','" + tbIdZap.Text + "','" + DBConnection.idzu + "','" + dtpDatRodj.Value.ToString("dd-MMM-yyyy") + "')"; if (cbVrstaKor.SelectedItem.ToString().Equals("Lekar opšte medicine")) { sql2 = "INSERT INTO SOBNI_LEKAR (IME, PRZ, JMBGZR, TEL_ZR, ADR_ZR, ZANIMANJE_ZR,ID_ZR, IDZU,ZDR_IDZU,DAT_RODJ) VALUES" + "('" + tbIme.Text + "','" + tbPrez.Text + "','" + mtbJmbg.Text + "','" + tbTel.Text + "','" + tbAdr.Text + ", " + cbGrad.SelectedItem.ToString() + "','" + cbVrstaKor.SelectedItem.ToString() + "','" + tbIdZap.Text + "','" + DBConnection.idzu + "','" + idodel + "','" + dtpDatRodj.Value.ToString("dd-MMM-yyyy") + "')"; sql3 = "INSERT INTO LEKAR_OPSTE_MEDICINE(JMBGZR, ID_ZR, IDZU, IME, PRZ, TEL_ZR, ADR_ZR, ZANIMANJE_ZR,DAT_RODJ) VALUES" + "('" + mtbJmbg.Text + "','" + tbIdZap.Text + "','" + DBConnection.idzu + "','" + tbIme.Text + "','" + tbPrez.Text + "','" + tbTel.Text + "','" + tbAdr.Text + ", " + cbGrad.SelectedItem.ToString() + "','" + cbVrstaKor.SelectedItem.ToString() + "','" + dtpDatRodj.Value.ToString("dd-MMM-yyyy") + "')"; } else if (cbVrstaKor.SelectedItem.ToString().Equals("Lekar specijalista")) { sql2 = "INSERT INTO SOBNI_LEKAR (IME, PRZ, JMBGZR, TEL_ZR, ADR_ZR, ZANIMANJE_ZR,ID_ZR, IDZU,ZDR_IDZU,DAT_RODJ) VALUES" + "('" + tbIme.Text + "','" + tbPrez.Text + "','" + mtbJmbg.Text + "','" + tbTel.Text + "','" + tbAdr.Text + ", " + cbGrad.SelectedItem.ToString() + "','" + cbVrstaKor.SelectedItem.ToString() + "','" + tbIdZap.Text + "','" + DBConnection.idzu + "','" + idodel + "','" + dtpDatRodj.Value.ToString("dd-MMM-yyyy") + "')"; sql3 = "INSERT INTO LEKAR_SPECIJALISTA (JMBGZR, ID_ZR, IDZU, IME, PRZ, TEL_ZR, ADR_ZR,ZANIMANJE_ZR,DAT_RODJ) VALUES " + "('" + mtbJmbg.Text + "','" + tbIdZap.Text + "','" + DBConnection.idzu + "','" + tbIme.Text + "','" + tbPrez.Text + "','" + tbTel.Text + "','" + tbAdr.Text + ", " + cbGrad.SelectedItem.ToString() + "','" + cbVrstaKor.SelectedItem.ToString() + "','" + dtpDatRodj.Value.ToString("dd-MMM-yyyy") + "')"; } else if (cbVrstaKor.SelectedItem.ToString().Equals("Medicinska sestra/tehničar")) {// (JMBGZR, ID_ZR, IME, PRZ, TEL_ZR, ADR_ZR, ZANIMANJE_ZR, IDZU, TIP_SR_KADRA) sql2 = "INSERT INTO SREDNJI_MEDICINSKI_KADAR (JMBGZR, ID_ZR, IDZU, IME, PRZ, TEL_ZR, ADR_ZR,ZANIMANJE_ZR,TIP_SR_KADRA,DAT_RODJ) VALUES " + "('" + mtbJmbg.Text + "','" + tbIdZap.Text + "','" + DBConnection.idzu + "','" + tbIme.Text + "','" + tbPrez.Text + "','" + tbTel.Text + "','" + tbAdr.Text + ", " + cbGrad.SelectedItem.ToString() + "','" + "Srednji med.kadar" + "','" + cbVrstaKor.SelectedItem.ToString() + "','" + dtpDatRodj.Value.ToString("dd-MMM-yyyy") + "')"; } else if (cbVrstaKor.SelectedItem.ToString().Equals("Laborant")) { } try { command = new OracleCommand(sql1); command.Connection = connection; command.ExecuteNonQuery(); } catch (Exception) { throw; } try { command = new OracleCommand(sql2); command.Connection = connection; command.ExecuteNonQuery(); } catch (Exception) { throw; } try { if (!sql3.Equals("")) { command = new OracleCommand(sql3); command.Connection = connection; command.ExecuteNonQuery(); } } catch (Exception) { throw; } try { command = new OracleCommand(sql); command.Connection = connection; command.ExecuteNonQuery(); } catch (Exception) { throw; } ReceptSnim rs = new ReceptSnim("Uspešno registrovan korisnik"); // rs.ShowDialog(); this.Opacity = .70; DialogResult dr = rs.ShowDialog(); if (dr == DialogResult.Cancel) { //this.Opacity = 1; this.Close(); } // label6.Text = sql; connection.Close(); //this.DialogResult = DialogResult.OK; } }
private void btnSnimStat_Click(object sender, EventArgs e) { SnimiStat sa = new SnimiStat(); DialogResult dr = sa.ShowDialog(); if (dr == DialogResult.OK) { if (!sa.stara) { string rez = sa.rezNazivStat; 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 STATUS_PREGLED (OBLAST, STAVKE) values ('" + rez + "','" + rtbStatPreg.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(); } } else { string rez = sa.rezNazivStat; string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); string sql = ""; OracleCommand command = new OracleCommand(sql); command.Connection = connection; OracleDataReader reader; string oldValRow = ""; try { sql = "SELECT STAVKE FROM STATUS_PREGLED WHERE OBLAST='" + rez + "'"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); if (reader.Read()) { oldValRow = reader[0].ToString(); } } catch (Exception) { throw; } sql = "UPDATE STATUS_PREGLED SET stavke='" + oldValRow + "\n" + rtbStatPreg.Text + "'" + "WHERE oblast='" + rez + "'"; 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(); } } } }
private void btnSac_Click(object sender, EventArgs e) { OracleCommand command; string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); string sql = ""; string pol = ""; if (rbM.Checked) { pol = "m"; } else { pol = "z"; } int particip; if (chbParticip.Checked) { particip = 1; } else { particip = 0; } sql = "INSERT INTO PACIJENT(IMEP, PRZP, JMBGP, ADRP, DATRP, POLP, DRZP, ZANIMANJEP, POSAOP, BRTELP,BRZK, NOSOSIG, LBO, PARTICIP, FAKTURA) VALUES ('" + tbIme.Text + "','" + tbPrz.Text + "','" + mtbJmbg.Text + "','" + tbAdr.Text + " " + tbGrad.Text + "','" + mtbDatRodj.Value.ToString("dd-MMM-yyyy") + "','" + pol + "','" + tbDrz.Text + "','" + tbZanimanje.Text + "','" + tbPosao.Text + "','" + tbTel.Text + "','" + mtbZK.Text + "','" + tbNosOsig.Text + "','" + mtbLbo.Text + "','" + particip + "','" + tbFakt.Text + "')"; try { command = new OracleCommand(sql); command.Connection = connection; command.ExecuteNonQuery(); } catch (Exception) { throw; } ReceptSnim rs = new ReceptSnim("Uspešno snimljeni podaci o pacijentu"); // rs.ShowDialog(); this.Opacity = .70; DialogResult dr = rs.ShowDialog(); if (dr == DialogResult.Cancel) { //this.Opacity = 1; this.Close(); } // label6.Text = sql; connection.Close(); if (saForme.Equals("sa_protokola")) { Protokol.jmbg_pac = mtbJmbg.Text; } this.DialogResult = DialogResult.OK; } }
private void button1_Click(object sender, EventArgs e) { string connectionString = GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); string sql = "";//= "SELECT IME FROM SOBNI_LEKAR WHERE ID_ZR='" + textBox4.Text + "'"; sql = "SELECT ID_VRSTE_UPUTA FROM VRSTA_UPUTA WHERE NAZIV_VRSTE_UPUTA='" + cbVrstaUputa.Text + "'"; OracleCommand command = new OracleCommand(sql); command.Connection = connection; OracleDataReader reader = command.ExecuteReader(); while (reader.Read()) { ids_vrsta_uputa = (String)reader[0]; Console.WriteLine(ids_vrsta_uputa); } if (spec_an) { if (cbVrstaUputa.SelectedItem.ToString().Equals("Uput lekaru specijalisti")) { sql = "SELECT IDSPEC FROM SPECIJALNOST WHERE NAZSPEC='" + cbSpecAn.Text + "'"; } else if (cbVrstaUputa.SelectedItem.ToString().Equals("Uput za laboratoriju")) { sql = "SELECT ID_VRSTE_ANALIZE FROM VRSTA_ANALIZE WHERE NAZIV_VRSTE_ANALIZE='" + cbSpecAn.Text + "'"; } command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); while (reader.Read()) { if (cbVrstaUputa.Text.Equals("Uput lekaru specijalisti")) { ids_vrsta_spec_an = ""; ids_vrsta_spec_an1 = (String)reader[0]; } else if (cbVrstaUputa.Text.Equals("Uput za laboratoriju")) { ids_vrsta_spec_an = (String)reader[0]; ids_vrsta_spec_an1 = ""; } } } sql = "insert into UPUT (ID_UPUTA, ID_VRSTE_ANALIZE, IDSPEC, id_vrste_uputa,JMBGZR, ID_ZR, JMBGP, DIJAGNOZA,RAZLOG_UPUT, DAT_IZD_UPUT,NAZIV_INSTITUCIJE) VALUES (" + "'" + RandomString(6) + "','" + ids_vrsta_spec_an + "','" + ids_vrsta_spec_an1 + "','" + ids_vrsta_uputa + "','" + jmbglek + "', '" + idlek + "','" + jmbgpac + "','" + tbSifDijag.Text + "','" + rtbRazlog.Text + "','" + mtbDat.Value.ToString("dd-MMM-yyyy") + "','" + tbNazInstit.Text + "')"; try { command = new OracleCommand(sql); command.Connection = connection; command.ExecuteNonQuery(); } catch (Exception) { throw; } ReceptSnim rs = new ReceptSnim("Uspešno kreiran uput"); // 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; } }