private List <string[]> filtrirajListu(string kriterijumZaPretragu) { List <string[]> rez = new List <string[]>(); string sql = ""; string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; try { sql = "SELECT * FROM PRIJEM_PACIJENTA,PACIJENT,LEKAR_OPSTE_MEDICINE,IZBOR_LEKARA WHERE" + " PRIJEM_PACIJENTA.JMBGP=PACIJENT.JMBGP AND PRIJEM_PACIJENTA.JMBGP=IZBOR_LEKARA.JMBGP" + " AND LEKAR_OPSTE_MEDICINE.ID_ZR=IZBOR_LEKARA.ID_ZR"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); } catch (Exception) { throw; } try { while (reader.Read()) { if ((reader["IMEP"].ToString().ToLower()).Contains(kriterijumZaPretragu.ToLower()) || (reader["PRZP"].ToString().ToLower()).Contains(kriterijumZaPretragu.ToLower()) || (reader["JMBGP"].ToString().ToLower()).Contains(kriterijumZaPretragu.ToLower()) || (reader["ID_ZR"].ToString().ToLower()).Contains(kriterijumZaPretragu.ToLower()) || (reader["IME"].ToString().ToLower()).Contains(kriterijumZaPretragu.ToLower()) || (reader["PRZ"].ToString().ToLower()).Contains(kriterijumZaPretragu.ToLower())) { String[] podaci = { reader["IMEP"].ToString(), reader["PRZP"].ToString(), reader["JMBGP"].ToString(), reader["IME"].ToString() + " " + reader["PRZ"].ToString() + " " + reader["ID_ZR"].ToString() }; rez.Add(podaci); } } } catch (Exception) { throw; } connection.Close(); } return(rez); }
private void bindingNavigatorDeleteItem_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 = "DELETE FROM ANAM WHERE NAZAN='" + dgwSpisak.SelectedRows[0].Cells[0].Value.ToString() + "'"; try { command = new OracleCommand(sql); command.Connection = connection; command.ExecuteNonQuery(); } catch (Exception) { throw; } popuniGrid(); connection.Close(); } }
private void SnimiStat_Load(object sender, EventArgs e) { string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { try { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; string sqlr = "SELECT * FROM STATUS_PREGLED"; command = new OracleCommand(sqlr); command.Connection = connection; reader = command.ExecuteReader(); while (reader.Read()) { cbObl.Items.Add(reader["OBLAST"]); } cbObl.SelectedIndex = 0; connection.Close(); } catch (Exception) { throw; } } }
private void Registracija_Load(object sender, EventArgs e) { dtpDatRodj.Text = DateTime.Today.ToString("dd-MMM-yyyy"); cbVrstaKor.SelectedIndex = 0; // cbVrstaOdel.SelectedItem = cbVrstaOdel.Items[0]; //cbDan.SelectedItem = cbDan.Items[0]; //cbMes.SelectedItem = cbMes.Items[0]; //cbGod.SelectedItem = cbGod.Items[0]; cbGrad.SelectedItem = cbGrad.Items[0]; string connectionString = DBConnection.GetConnectionString(); // label1.Text = connectionString; using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); string sql = "SELECT NAZODEL FROM VRSTA_ODELJENJA"; OracleCommand command = new OracleCommand(sql); command.Connection = connection; OracleDataReader reader = command.ExecuteReader(); while (reader.Read()) { cbVrstaOdel.Items.Add(reader[0]); cbVrstaOdel.SelectedIndex = 0; } connection.Close(); } }
private void tbLoz_Leave(object sender, EventArgs e) { string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); string sql = ""; sql = "SELECT * FROM REGISTRACIJA WHERE SIFRAZAP='" + tbLoz.Text + "'" + "AND IDZAP=" + "'" + idz + "'"; OracleCommand command = new OracleCommand(sql); command.Connection = connection; OracleDataReader reader = command.ExecuteReader(); if (!reader.Read() || tbLoz.Text.Equals("")) { tbLoz.BackColor = colErr; err.SetError(tbLoz, "Neispravna lozinka"); err.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink; button1.Enabled = false; } else { tbLoz.BackColor = colOk; err.Clear(); button1.Enabled = true; } } }
private void button1_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; } // label6.Text = sql; connection.Close(); } IzborLekara ep = new IzborLekara(mtbJmbg.Text, true); DialogResult dr = ep.ShowDialog(); this.Opacity = .70; this.Close(); this.DialogResult = DialogResult.OK; }
private void btnPrikaz_Click(object sender, EventArgs e) { string sql = ""; string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; try { sql = "SELECT count(*) FROM Recept WHERE ID_ZR ='" + idlekara + "' AND datizd BETWEEN '" + mtbDatOd.Value.ToString("dd-MMM-yyyy") + "' AND '" + mtbDatDo.Value.ToString("dd-MMM-yyyy") + "'"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); } catch (Exception) { throw; } if (reader.Read()) { lbBrRec.Text += " " + reader[0].ToString(); } try { sql = " SELECT count(*) FROM Uput WHERE ID_ZR ='" + idlekara + "' AND DAT_IZD_UPUT BETWEEN '" + mtbDatOd.Value.ToString("dd-MMM-yyyy") + "' AND '" + mtbDatDo.Value.ToString("dd-MMM-yyyy") + "'"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); } catch (Exception) { throw; } if (reader.Read()) { lbBrUp.Text += " " + reader[0].ToString(); } connection.Close(); } }
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(); } }
private void spisakRecepata() { string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; try { string sql = "SELECT DISTINCT RECEPT.SIFL,NAZLEK,OR_KOLICINA_LEKA,PROP__KOLICINA_LEKA,SIFDIJ,DATIZD FROM RECEPT,LEK WHERE LEK.SIFL=RECEPT.SIFL"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); } catch (Exception) { throw; } while (reader.Read()) { String[] podaci = { reader["SIFL"].ToString(), reader["NAZLEK"].ToString(), reader["OR_KOLICINA_LEKA"].ToString(), reader["PROP__KOLICINA_LEKA"].ToString(), reader["SIFDIJ"].ToString(), reader["DATIZD"].ToString().TrimEnd('0', ':') }; dgwRecepti.Rows.Add(podaci); } // this.pRecepti.Height += 200; // this.dgwRecepti.Height += 100; // this.pUputi.Visible = false; // this.pNalazi.Visible = false; // this.pBolovanja.Visible = false; // this.pPomagala.Visible = false; // this.dgwUputi.Visible = false; // this.dgwNalazi.Visible = false; // this.dgwBolovanja.Visible = false; // this.dgwPomagala.Visible = false; // this.Height -= pUputi.Height; // this.Height -= pNalazi.Height; // this.Height -= pBolovanja.Height; // this.Height -= pPomagala.Height/3; //// Console.WriteLine("PAREEEEEENT"+ this.Parent.ToString()); // this.Location = new Point(270, 200);// new Point(this.Parent.Location.X + this.Parent.Width / 3, this.Parent.Location.Y - this.Parent.Height*10); //Position= FormStartPosition.CenterParent; connection.Close(); } }
public static List <string> filtrirajListu(string kriterijumZaPretragu, string oblast) { List <string> rez = new List <string>(); string sql = ""; string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; try { sql = "SELECT * FROM STATUS_PREGLED WHERE OBLAST='" + oblast + "'"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); } catch (Exception) { throw; } try { while (reader.Read()) { string[] podaci = reader["STAVKE"].ToString().Split('\n'); foreach (string podatak in podaci) { if (podatak.ToLower().Contains(kriterijumZaPretragu.ToLower())) { rez.Add(podatak); } } } } catch (Exception) { throw; } connection.Close(); } return(rez); }
private void PrijemPacReg_Load(object sender, EventArgs e) { mtbDatPrijema.Text = DateTime.Today.ToString("dd-MMM-yyyy"); string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { try { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; string sqlr = "SELECT * FROM PACIJENT WHERE JMBGP='" + jmbg_pacijenta + "'"; command = new OracleCommand(sqlr); command.Connection = connection; reader = command.ExecuteReader(); while (reader.Read()) { SelItem = reader["IMEP"] + " " + reader["PRZP"] + " " + reader["JMBGP"]; } sqlr = "SELECT * FROM PACIJENT"; command = new OracleCommand(sqlr); command.Connection = connection; reader = command.ExecuteReader(); while (reader.Read()) { cbPrimPacijent.Items.Add(reader["IMEP"] + " " + reader["PRZP"] + " " + reader["JMBGP"]); cbPrimPacijent.SelectedIndex = 0; if (!jmbg_pacijenta.Equals("")) { cbPrimPacijent.SelectedItem = SelItem; } } connection.Close(); } catch (Exception) { throw; } } }
private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { SnimiAnam sa = new SnimiAnam(); 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 + "','" + sa.rezSadrzAnam + "')"; 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(); popuniGrid(); //if (drrr == DialogResult.OK) //{ // this.Opacity = 1; //} //this.DialogResult = DialogResult.OK; connection.Close(); } } }
private void popuniGrid() { string sql = ""; string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; try { sql = "SELECT * FROM PRIJEM_PACIJENTA,PACIJENT,LEKAR_OPSTE_MEDICINE,IZBOR_LEKARA WHERE PRIJEM_PACIJENTA.JMBGP=PACIJENT.JMBGP AND PRIJEM_PACIJENTA.JMBGP=IZBOR_LEKARA.JMBGP AND IZBOR_LEKARA.ID_ZR=LEKAR_OPSTE_MEDICINE.ID_ZR AND LEKAR_OPSTE_MEDICINE.ID_ZR='" + idlekara + "'"; // AND DATUM_PRIJEMA='"+mtbDatOpsta.Text+"'" command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); } catch (Exception) { throw; } try { while (reader.Read()) { lbLekar.Text = reader["IME"].ToString() + " " + reader["PRZ"].ToString() + " " + reader["ID_ZR"].ToString(); String[] podaci = { reader["IMEP"].ToString(), reader["PRZP"].ToString(), reader["JMBGP"].ToString(), reader["BRZK"].ToString() }; dgwSpisPacZaPrij.Rows.Add(podaci); } } catch (Exception) { throw; } connection.Close(); } }
private void popuniGrid() { string sql = ""; string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; try { sql = "SELECT * FROM PRIJEM_PACIJENTA,PACIJENT,LEKAR_OPSTE_MEDICINE,IZBOR_LEKARA WHERE" + " PRIJEM_PACIJENTA.JMBGP=PACIJENT.JMBGP AND PRIJEM_PACIJENTA.JMBGP=IZBOR_LEKARA.JMBGP" + " AND LEKAR_OPSTE_MEDICINE.ID_ZR=IZBOR_LEKARA.ID_ZR"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); } catch (Exception) { throw; } try { while (reader.Read()) { String[] podaci = { reader["IMEP"].ToString(), reader["PRZP"].ToString(), reader["JMBGP"].ToString(), reader["IME"].ToString() + " " + reader["PRZ"].ToString() + " " + reader["ID_ZR"].ToString() }; dgwSpisakPrimPac.Rows.Add(podaci); } } catch (Exception) { throw; } 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()) { OracleCommand command; connection.ConnectionString = connectionString; connection.Open(); string sql = ""; sql = "UPDATE REGISTRACIJA SET SIFRAZAP='" + tbNovaLoz.Text + "'WHERE IDZAP='" + idz + "'"; try { command = new OracleCommand(sql); command.Connection = connection; command.ExecuteNonQuery(); } catch (Exception) { throw; } OKIzmenaLozinke rs = new OKIzmenaLozinke(idz); // 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 OKIzmenaLozinke_Load(object sender, EventArgs e) { string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); string sql = ""; sql = "SELECT IMEZAP,PRZZAP FROM REGISTRACIJA WHERE IDZAP='" + id + "'"; OracleCommand command = new OracleCommand(sql); command.Connection = connection; OracleDataReader reader = command.ExecuteReader(); if (reader.Read()) { lbIzm.Text += "za korisnika " + reader["IMEZAP"].ToString() + " " + reader["PRZZAP"].ToString(); } } }
private void PrepRecUp_Load(object sender, EventArgs e) { string sql = ""; string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; try { sql = "SELECT * FROM LEKAR_OPSTE_MEDICINE WHERE ID_ZR='" + idlekara + "'"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); } catch (Exception) { throw; } try { if (reader.Read()) { lbLekar.Text += reader["IME"] + " " + reader["PRZ"] + " " + reader["ID_ZR"]; } } catch (Exception) { throw; } connection.Close(); } }
private void PrintRecept_Load(object sender, EventArgs e) { string connectionString = DBConnection.GetConnectionString(); // label1.Text = connectionString; using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); string sql = "SELECT * FROM RECEPT WHERE IDREC='" + idRecepta + "'"; OracleCommand command = new OracleCommand(sql); command.Connection = connection; OracleDataReader reader = command.ExecuteReader(); while (reader.Read()) { tbSifra.Text = reader["SIFL"].ToString(); tbNaziv.Text = nazLeka; tbKolicina.Text = reader["PROP__KOLICINA_LEKA"].ToString(); tbCena.Text = reader["IZNOS"].ToString(); tbDijagnoza.Text = reader["SIFDIJ"].ToString() + Environment.NewLine + nazDij; tbDatum.Text = DateTime.Parse(reader["DATIZD"].ToString()).ToString("dd-MMM-yyyy"); } sql = "SELECT * FROM PACIJENT WHERE JMBGP='" + jmbgpac + "'"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); while (reader.Read()) { lbImePac.Text += " " + reader["IMEP"].ToString() + " " + reader["PRZP"].ToString(); lbBrzk.Text += " " + reader["BRZK"].ToString(); } 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 = ""; 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 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 btnPrikaz_Click(object sender, EventArgs e) { dgwPrimPac.ClearSelection(); string sql = ""; String[] lekibrpac = new String[4]; int i = 0; string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; OracleDataReader reader1; OracleDataReader reader2; try { sql = "SELECT count(*) FROM PRIJEM_PACIJENTA WHERE DATUM_PRIJEMA BETWEEN '" + mtbDatOd.Value.ToString("dd-MMM-yyyy") + "' AND '" + mtbDatDo.Value.ToString("dd-MMM-yyyy") + "'"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); if (reader.Read()) { lbUkupno.Text += " " + reader[0].ToString(); } sql = "SELECT count(*) FROM RECEPT WHERE DATIZD BETWEEN '" + mtbDatOd.Value.ToString("dd-MMM-yyyy") + "' AND '" + mtbDatDo.Value.ToString("dd-MMM-yyyy") + "'"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); if (reader.Read()) { lbUkRec.Text += " " + reader[0].ToString(); } sql = "SELECT count(*) FROM UPUT WHERE DAT_IZD_UPUT BETWEEN '" + mtbDatOd.Value.ToString("dd-MMM-yyyy") + "' AND '" + mtbDatDo.Value.ToString("dd-MMM-yyyy") + "'"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); if (reader.Read()) { lbUkUput.Text += " " + reader[0].ToString(); } } catch (Exception) { throw; } try { sql = "SELECT DISTINCT ID_ZR FROM LEKAR_OPSTE_MEDICINE"; command = new OracleCommand(sql); command.Connection = connection; reader1 = command.ExecuteReader(); while (reader1.Read()) { sql = "SELECT * FROM LEKAR_OPSTE_MEDICINE WHERE ID_ZR='" + reader1["ID_ZR"].ToString() + "'"; command = new OracleCommand(sql); command.Connection = connection; reader2 = command.ExecuteReader(); if (reader2.Read()) { lekibrpac[i] = reader2["IME"].ToString() + " " + reader2["PRZ"].ToString(); i++; } sql = "SELECT count(*) FROM PRIJEM_PACIJENTA WHERE DATUM_PRIJEMA BETWEEN '" + mtbDatOd.Value.ToString("dd-MMM-yyyy") + "' AND '" + mtbDatDo.Value.ToString("dd-MMM-yyyy") + "'" + "AND ID_ZR='" + reader1["ID_ZR"].ToString() + "'"; command = new OracleCommand(sql); command.Connection = connection; reader2 = command.ExecuteReader(); if (reader2.Read()) { lekibrpac[i] = reader2[0].ToString(); i++; } sql = "SELECT count(*) FROM RECEPT WHERE DATIZD BETWEEN '" + mtbDatOd.Value.ToString("dd-MMM-yyyy") + "' AND '" + mtbDatDo.Value.ToString("dd-MMM-yyyy") + "'" + "AND ID_ZR='" + reader1["ID_ZR"].ToString() + "'"; command = new OracleCommand(sql); command.Connection = connection; reader2 = command.ExecuteReader(); if (reader2.Read()) { lekibrpac[i] = reader2[0].ToString(); i++; } sql = "SELECT count(*) FROM UPUT WHERE DAT_IZD_UPUT BETWEEN '" + mtbDatOd.Value.ToString("dd-MMM-yyyy") + "' AND '" + mtbDatDo.Value.ToString("dd-MMM-yyyy") + "'" + "AND ID_ZR='" + reader1["ID_ZR"].ToString() + "'"; command = new OracleCommand(sql); command.Connection = connection; reader2 = command.ExecuteReader(); if (reader2.Read()) { lekibrpac[i] = reader2[0].ToString(); i = 0; } dgwPrimPac.Rows.Add(lekibrpac); foreach (DataGridViewRow dgvr in dgwPrimPac.Rows) { if (dgvr.Cells[1].Value.ToString() == ("0") && dgvr.Cells[2].Value.ToString() == ("0") && dgvr.Cells[3].Value.ToString() == ("0")) { dgwPrimPac.Rows.Remove(dgvr); //dgvr.DefaultCellStyle.ForeColor = Color.Red; } } dgwPrimPac.ClearSelection(); } } catch (Exception) { throw; } this.Refresh(); connection.Close(); } }
private void button1_Click(object sender, EventArgs e) { if (vrsta_kor == 0) { // Console.WriteLine("admiiiiiiiiin"); string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); string sql = ""; // string idodel = ""; sql = "SELECT * FROM ADMINZK WHERE USERA='" + tbUser.Text + "' AND PASSA='" + tbPass.Text + "'"; OracleCommand command = new OracleCommand(sql); command.Connection = connection; OracleDataReader reader = command.ExecuteReader(); if (reader.Read()) { MeniAdmin rp = new MeniAdmin(); this.Opacity = .70; DialogResult dr = rp.ShowDialog(); if (dr == DialogResult.Cancel) { this.Close(); } } else { MessageBox.Show("Neispravni podaci"); } this.Opacity = 1; // label6.Text = sql; connection.Close(); //this.DialogResult = DialogResult.OK; } } else if (vrsta_kor == 1) { string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); string sql = ""; sql = "SELECT * FROM REGISTRACIJA WHERE VRSTAKOR='" + vrsta + "' AND USERZAP='" + tbUser.Text + "' AND SIFRAZAP='" + tbPass.Text + "'"; OracleCommand command = new OracleCommand(sql); command.Connection = connection; OracleDataReader reader = command.ExecuteReader(); if (reader.Read()) { if (reader["SIFRAZAP"].Equals("DZNS")) { IzmenaLozinke rp = new IzmenaLozinke(reader["IMEZAP"].ToString(), reader["PRZZAP"].ToString(), reader["IDZAP"].ToString()); this.Opacity = .70; DialogResult dr = rp.ShowDialog(); if (dr == DialogResult.Cancel) { this.Opacity = 1; } } else { MeniLekOpste meni = new MeniLekOpste(reader["IDZAP"].ToString()); meni.ShowDialog(); this.Close(); } } else { MessageBox.Show("Neispravni podaci"); } this.Opacity = 1; // label6.Text = sql; connection.Close(); //this.DialogResult = DialogResult.OK; } } else if (vrsta_kor == 2) { } else if (vrsta_kor == 3) { string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); string sql = ""; sql = "SELECT * FROM REGISTRACIJA WHERE VRSTAKOR='" + vrsta + "' AND USERZAP='" + tbUser.Text + "' AND SIFRAZAP='" + tbPass.Text + "'"; OracleCommand command = new OracleCommand(sql); command.Connection = connection; OracleDataReader reader = command.ExecuteReader(); if (reader.Read()) { if (reader["SIFRAZAP"].Equals("DZNS")) { IzmenaLozinke rp = new IzmenaLozinke(reader["IMEZAP"].ToString(), reader["PRZZAP"].ToString(), reader["IDZAP"].ToString()); this.Opacity = .70; DialogResult dr = rp.ShowDialog(); if (dr == DialogResult.Cancel) { this.Opacity = 1; } } else { MeniMedSesTeh meni = new MeniMedSesTeh(); meni.ShowDialog(); this.Close(); } } else { MessageBox.Show("Neispravni podaci"); } this.Opacity = 1; // label6.Text = sql; connection.Close(); //this.DialogResult = DialogResult.OK; } } else if (vrsta_kor == 4) { } }
private void IzborLekara_Load(object sender, EventArgs e) { button2.Text = "..."; button3.Text = "..."; mtbDatIzbora.Text = DateTime.Today.ToString("dd-MMM-yyyy"); string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { try { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; string sqlr = "SELECT * FROM PACIJENT"; command = new OracleCommand(sqlr); command.Connection = connection; reader = command.ExecuteReader(); while (reader.Read()) { cbPacijent.Items.Add(reader["IMEP"] + " " + reader["PRZP"] + " " + reader["JMBGP"]); cbPacijent.SelectedIndex = 0; } if (sa_forme_evidencija) { string sql = "SELECT * FROM PACIJENT WHERE JMBGP='" + jmbg_pacijenta + "'"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); while (reader.Read()) { // cbPacijent.Items.Add(reader["IMEP"] + " " + reader["PRZP"] + " " + reader["JMBGP"]); cbPacijent.SelectedItem = reader["IMEP"] + " " + reader["PRZP"] + " " + reader["JMBGP"]; } } sqlr = "SELECT * FROM LEKAR_OPSTE_MEDICINE"; command = new OracleCommand(sqlr); command.Connection = connection; reader = command.ExecuteReader(); while (reader.Read()) { cbLekar.Items.Add(reader["IME"] + " " + reader["PRZ"] + " " + reader["ID_ZR"]); cbLekar.SelectedIndex = 0; } sqlr = "SELECT NAZRAZL FROM RAZLOG_IZBORA"; command = new OracleCommand(sqlr); command.Connection = connection; reader = command.ExecuteReader(); while (reader.Read()) { cbRazlog.Items.Add(reader[0]); cbRazlog.SelectedIndex = 0; } connection.Close(); } catch (Exception) { throw; } } }
private void popuniGrid() { string sql = ""; string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; try { sql = "SELECT * FROM STATUS_PREGLED"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); } catch (Exception) { throw; } try { int dx = 0; int dy = 0; int triUredu = 0; bool prva = true; int brBtn = 0; DataGridView dgwTmp = new DataGridView(); Button btnDod = new Button(); Button btnDodSve = new Button(); foreach (Control ctrl2 in gbPal.Controls.Find("dgwStav", true)) { if (ctrl2 is DataGridView) { dgwTmp = (DataGridView)ctrl2; break; } } while (reader.Read()) { if (triUredu == 3) { dy += gbPal.Height; dx = 0; } splitContainer1.Panel2.SuspendLayout(); GroupBox gbOblasT = new GroupBox(); gbOblasT.Size = gbPal.Size; gbOblasT.Text = reader["OBLAST"].ToString(); gbOblasT.Location = new Point(gbPal.Location.X + dx, gbPal.Location.Y + dy); if (!prva) { this.Width += gbOblasT.Width + 3; splitContainer1.Width += gbOblasT.Width + 3; btnPotvrdi.Location = new Point(this.Width - 212, btnPotvrdi.Location.Y); btnOdustani.Location = new Point(this.Width - 122, btnOdustani.Location.Y); } dx += gbOblasT.Width + 3; splitContainer1.SplitterDistance = splitContainer1.Width - (splitContainer1.Width - splitContainer1.Panel1.Width); DataGridView dgw = null; Control ctrlTmp = new Control(); foreach (Control ctrl in gbPal.Controls) { if (!(ctrl is DataGridView)) { if (ctrl is Label) { ctrlTmp = (Label)ctrl; Label lab = new Label(); lab.Location = ctrlTmp.Location; lab.Size = ctrlTmp.Size; lab.Text = ctrlTmp.Text; gbOblasT.Controls.Add(lab); } else if (ctrl is TextBox) { ctrlTmp = (TextBox)ctrl; TextBox tb = new TextBox(); tb.Location = ctrlTmp.Location; tb.Size = ctrlTmp.Size; tb.Name = "tbPret" + brBtn; tb.TextChanged += new System.EventHandler(textBox1_TextChanged); brBtn++; gbOblasT.Controls.Add(tb); } else if (ctrl is Button) { foreach (Control ctrl2 in gbPal.Controls.Find("btnDodaj", true)) { if (ctrl2 is Button) { btnDod = (Button)ctrl2; Button btn = new Button(); btn.Location = btnDod.Location; btn.Size = btnDod.Size; btn.Text = btnDod.Text; btn.Name = "btnDod" + brBtn; brBtn++; btn.MouseClick += new MouseEventHandler(btnDodaj_Click); gbOblasT.Controls.Add(btn); break; } } foreach (Control ctrl2 in gbPal.Controls.Find("btnDodajSve", true)) { if (ctrl2 is Button) { btnDodSve = (Button)ctrl2; Button btn = new Button(); btn.Location = btnDodSve.Location; btn.Size = btnDodSve.Size; btn.Text = btnDodSve.Text; btn.Name = "btnDodSve" + brBtn; brBtn++; btn.MouseClick += new MouseEventHandler(btnDodajSve_Click); gbOblasT.Controls.Add(btn); break; } } } } else { dgw = new DataGridView(); dgw.Size = dgwTmp.Size; dgw.Location = dgwTmp.Location; DataGridViewTextBoxColumn column = new DataGridViewTextBoxColumn(); column.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dgw.Columns.Add(column); dgw.RowHeadersVisible = false; dgw.ColumnHeadersVisible = false; dgw.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCellsExceptHeaders; dgw.AllowUserToAddRows = false; dgw.AllowUserToDeleteRows = false; dgw.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dgw.MultiSelect = false; dgw.ReadOnly = true; dgw.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; dgw.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; dgw.TabIndex = 0; dgw.Name = "dgwStavke" + brBtn; brBtn++; gbOblasT.Visible = true; string[] podaci = reader["STAVKE"].ToString().Split('\n'); dgw.Rows.Clear(); foreach (string podatak in podaci) { dgw.Rows.Add(podatak); } dgw.CellClick += new DataGridViewCellEventHandler(dgwStavke_CellClick); gbOblasT.Controls.Add(dgw); dgw.ClearSelection(); } } triUredu++; prva = false; splitContainer1.Panel2.Controls.Add(gbOblasT); splitContainer1.Panel2.ResumeLayout(false); splitContainer1.Panel2.Refresh(); } } catch (Exception) { throw; } connection.Close(); } }
private void spisakBolovanja() { string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; string sql = ""; try { sql = "SELECT * FROM BOLOVANJE,VRSTA_BOLOVANJA,STATUS_BOLOVANJA WHERE BOLOVANJE.ID_VRSTE_BOL=VRSTA_BOLOVANJA.ID_VRSTE_BOL AND BOLOVANJE.ID_STATUSA_BOL=STATUS_BOLOVANJA.ID_STATUSA_BOL"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); string recidiv; string trecel; String[] podaci; while (reader.Read()) { if (reader["RECIDIV"].ToString().Equals("1")) { recidiv = "da"; } else { recidiv = "ne"; } if (reader["TRECE_LICE"].ToString().Equals("1")) { trecel = "da"; } else { trecel = "ne"; } podaci = new String[] { reader["NAZIV_VRSTE_BOL"].ToString(), reader["POC_DATUM_BOL"].ToString(), reader["KRAJ_DATUM_BOL"].ToString(), reader["NAZIV_STATUSA"].ToString(), reader["DIJAGNOZA"].ToString(), reader["NALAZ"].ToString(), reader["SPOLJ_UZROK"].ToString(), trecel, recidiv, reader["DAT_IZD_BOL"].ToString(), }; dgwBolovanja.Rows.Add(podaci); } connection.Close(); } catch (Exception) { throw; } } }
private void spisakUputa() { string connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; string sql = ""; string sql1 = ""; string sql2 = ""; try { sql = "SELECT DISTINCT NAZIV_INSTITUCIJE,NAZIV_VRSTE_UPUTA,NAZSPEC,DIJAGNOZA,RAZLOG_UPUT,DAT_IZD_UPUT FROM UPUT,VRSTA_UPUTA,SPECIJALNOST WHERE SPECIJALNOST.IDSPEC=UPUT.IDSPEC AND VRSTA_UPUTA.ID_VRSTE_UPUTA=UPUT.ID_VRSTE_UPUTA"; sql1 = "SELECT DISTINCT NAZIV_INSTITUCIJE,NAZIV_VRSTE_UPUTA,NAZIV_VRSTE_ANALIZE,DIJAGNOZA,RAZLOG_UPUT,DAT_IZD_UPUT FROM UPUT,VRSTA_UPUTA,VRSTA_ANALIZE WHERE VRSTA_ANALIZE.ID_VRSTE_ANALIZE=UPUT.ID_VRSTE_ANALIZE AND VRSTA_UPUTA.ID_VRSTE_UPUTA=UPUT.ID_VRSTE_UPUTA"; sql2 = "SELECT DISTINCT NAZIV_INSTITUCIJE,NAZIV_VRSTE_UPUTA,DIJAGNOZA,RAZLOG_UPUT,DAT_IZD_UPUT FROM UPUT,VRSTA_UPUTA WHERE VRSTA_UPUTA.ID_VRSTE_UPUTA=UPUT.ID_VRSTE_UPUTA"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); String[] podaci; // label6.Text = ""; while (reader.Read()) { //label6.Text += reader[0].ToString(); podaci = new String[] { reader["NAZIV_INSTITUCIJE"].ToString(), reader["NAZIV_VRSTE_UPUTA"].ToString(), reader["NAZSPEC"].ToString(), "-", //reader["NAZIV_VRSTE_ANALIZE"].ToString(), reader["DIJAGNOZA"].ToString(), reader["RAZLOG_UPUT"].ToString(), reader["DAT_IZD_UPUT"].ToString().TrimEnd('0', ':') }; dgwUputi.Rows.Add(podaci); } command = new OracleCommand(sql1); command.Connection = connection; reader = command.ExecuteReader(); while (reader.Read()) { podaci = new String[] { reader["NAZIV_INSTITUCIJE"].ToString(), reader["NAZIV_VRSTE_UPUTA"].ToString(), "-", reader["NAZIV_VRSTE_ANALIZE"].ToString(), reader["DIJAGNOZA"].ToString(), reader["RAZLOG_UPUT"].ToString(), reader["DAT_IZD_UPUT"].ToString().TrimEnd('0', ':') }; dgwUputi.Rows.Add(podaci); } command = new OracleCommand(sql2); command.Connection = connection; reader = command.ExecuteReader(); while (reader.Read()) { podaci = new String[] { reader["NAZIV_INSTITUCIJE"].ToString(), reader["NAZIV_VRSTE_UPUTA"].ToString(), "-", "-", reader["DIJAGNOZA"].ToString(), reader["RAZLOG_UPUT"].ToString(), reader["DAT_IZD_UPUT"].ToString().TrimEnd('0', ':') }; dgwUputi.Rows.Add(podaci); } connection.Close(); } catch (Exception) { throw; } } }
private void Bolovanje_Load(object sender, EventArgs e) { //cbStatBol.Items.Clear(); //cbVrstaBol.Items.Clear(); mtbDatIzd.Text = DateTime.Today.ToString("dd-MMM-yyyy"); string connectionString = GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { try { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; string sqlr = "SELECT NAZIV_VRSTE_BOL FROM VRSTA_BOLOVANJA"; command = new OracleCommand(sqlr); command.Connection = connection; reader = command.ExecuteReader(); while (reader.Read()) { cbVrstaBol.Items.Add(reader[0]); cbVrstaBol.SelectedIndex = 0; } sqlr = "SELECT NAZIV_STATUSA FROM STATUS_BOLOVANJA"; command = new OracleCommand(sqlr); command.Connection = connection; reader = command.ExecuteReader(); while (reader.Read()) { cbStatBol.Items.Add(reader[0]); cbStatBol.SelectedIndex = 0; } connection.Close(); } catch (Exception) { throw; } } string sql = ""; connectionString = DBConnection.GetConnectionString(); using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); OracleCommand command; OracleDataReader reader; try { sql = "SELECT * FROM PACIJENT WHERE PACIJENT.JMBGP='" + id_pacijenta + "'"; command = new OracleCommand(sql); command.Connection = connection; reader = command.ExecuteReader(); } catch (Exception) { throw; } try { if (reader.Read()) { tbPac.Text = reader["IMEP"].ToString() + " " + reader["PRZP"].ToString(); mtbDatRodj.Text = reader["DATRP"].ToString(); } } catch (Exception) { throw; } connection.Close(); } }
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(); } } } }