示例#1
0
        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;
        }
示例#2
0
        private void button4_Click(object sender, EventArgs e)
        {
            IzborLekara  ep = new IzborLekara();
            DialogResult dr = ep.ShowDialog();

            if (dr == DialogResult.Cancel)
            {
                this.Opacity = 1;
            }
        }