Beispiel #1
0
        protected void btnDodaj_Click(object sender, EventArgs e)
        {
            try
            {
                proxy = new BolnicaService.Service1Client();
                BolnicaService.PacijentDoktor pd = new BolnicaService.PacijentDoktor();
                pd.DoktorKorisnickiRacunID = Convert.ToInt32(ddlOdabirDoktora.SelectedValue);
                if (sender == ddlOdabirPacijenta)
                {
                    pd.PacijentKorisnickiRacunID = Convert.ToInt32(ddlOdabirPacijenta.SelectedValue);
                }
                else
                {
                    pd.PacijentKorisnickiRacunID = Convert.ToInt32(txtIDKorisnickiRacun.Text);
                }


                proxy.AddPacijentDoktorVeza(pd);

                lblStatus.Text = "Dodavanje uspješno izvršeno";

                FillGridViewPacijentiByDoktor();
            }
            catch (Exception ex)
            {
                lblStatus.Text = ("Operacija nije izvršena, greška: " + ex);
            }
        }
Beispiel #2
0
        //dodaj ddlTerapija selectedindex changed za enablanje dodaj tipke

        protected void btnDodaj_Click(object sender, EventArgs e)
        {
            try
            {
                proxy = new BolnicaService.Service1Client();
                BolnicaService.PlanTerapije pt = new BolnicaService.PlanTerapije();


                if (Request.Params["idDoktora"] != null)
                {
                    pt.PacijentID = Convert.ToInt32(txtPacijent.Text);
                }
                else
                {
                    pt.PacijentID = Convert.ToInt32(GridViewPacijent.DataKeys[GridViewPacijent.SelectedRow.RowIndex].Value);
                }


                pt.DoktorID     = Convert.ToInt32(txtDoktor.Text);
                pt.TerapijaID   = Convert.ToInt32(ddlTerapija.SelectedValue);
                pt.DatumPocetka = Convert.ToDateTime(txtDatumPocetka.Text);

                proxy.AddPlanTerapije(pt);
                lblStatusPacijenti.Text = "Terapija dodana";
                FillGridViewTerapija();
                ddlTerapija.SelectedValue = "";
                txtDatumPocetka.Text      = "";
            }
            catch (Exception ex)
            {
                lblStatusPacijenti.Text = ("Pogreška kod dodavanja terapije, greška: " + ex);
            }
        }
Beispiel #3
0
        protected void GridViewPacijentiByDoktor_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            try
            {
                //odmah puca čim probam dohvatit podatak iz tablice
                //a na isti način radim select i tamo mi sve funkcionira
                // otkrio sam da ovaj kod radi ako prvi put kada dođem na formu odaberem bilo koji select, nakon toga mogu bilo koji delete odabrat i sve radi


                int veza = Convert.ToInt32((GridViewPacijentiByDoktor.SelectedRow.FindControl("lblPacijentDoktorVeza") as Label).Text);

                proxy = new BolnicaService.Service1Client();
                proxy.DeletePacijentDoktorVeza(Convert.ToInt32(veza));
                lblStatus.Text = ("Uspješno izbrisano");
                FillGridViewPacijentiByDoktor();

                btnSave.Enabled   = true;
                btnDodaj.Enabled  = false;
                btnDodaj2.Enabled = false;
                btnUpdate.Enabled = false;
            }
            catch (Exception ex)
            {
                lblStatus.Text = ("Došlo je do pogreške ili nije moguće obrisati podatke" + ex);
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    proxy = new BolnicaService.Service1Client();
                    BolnicaService.Korisnik k = new BolnicaService.Korisnik();

                    BolnicaService.PacijentDoktor pd = new BolnicaService.PacijentDoktor();



                    try
                    {
                        k.Username          = txtUsername.Text;
                        k.Password          = txtPassword.Text;
                        k.IDKorisnickaGrupa = 3;
                        k.Ime      = txtIme.Text;
                        k.Prezime  = txtPrezime.Text;
                        k.OIB      = txtOIB.Text;
                        k.Telefon  = txtTelefon.Text;
                        k.Email    = txtEmail.Text;
                        k.Adresa   = txtAdresa.Text;
                        k.Grad     = txtGrad.Text;
                        k.PTTBroj  = txtPTTbroj.Text;
                        k.DrzavaID = Convert.ToInt32(ddlDrzava.SelectedValue);

                        pd.DoktorKorisnickiRacunID = Convert.ToInt32(hfDoktorID);


                        pd.PacijentKorisnickiRacunID = proxy.AddKorisnik(k);
                        proxy.AddPacijentDoktorVeza(pd);

                        lblStatus.Text = "Operacija uspješno spremljena";
                    }
                    catch (Exception ex)
                    {
                        lblStatus.Text = ("Operacija nije izvršena, greška: " + ex);
                    }



                    ClearAll();
                }
                catch (Exception ex)
                {
                    lblStatus.Text = ("Pogreška kod pristupa wfc service-u, greška: " + ex);
                }

                FillGridView();

                btnSave.Enabled   = true;
                btnDelete.Enabled = false;
                btnUpdate.Enabled = false;
            }
        }
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    proxy = new BolnicaService.Service1Client();
                    BolnicaService.Korisnik k = new BolnicaService.Korisnik();


                    try
                    {
                        k.IDKorisnickiRacun = Convert.ToInt32(txtIDKorisnickiRacun.Text);
                        k.Username          = txtUsername.Text;
                        k.Password          = txtPassword.Text;
                        k.IDKorisnickaGrupa = 3;
                        k.Ime      = txtIme.Text;
                        k.Prezime  = txtPrezime.Text;
                        k.OIB      = txtOIB.Text;
                        k.Telefon  = txtTelefon.Text;
                        k.Email    = txtEmail.Text;
                        k.Adresa   = txtAdresa.Text;
                        k.Grad     = txtGrad.Text;
                        k.PTTBroj  = txtPTTbroj.Text;
                        k.DrzavaID = Convert.ToInt32(ddlDrzava.SelectedValue);

                        proxy.UpdateKorisnik(k);

                        lblStatus.Text = "Podaci uspješno izmjenjeni";

                        ClearAll();

                        btnSave.Enabled   = true;
                        btnDelete.Enabled = false;
                        btnUpdate.Enabled = false;
                    }
                    catch (Exception ex)
                    {
                        lblStatus.Text = ("Operacija nije izvršena, greška u pristupu kod baze podataka: " + ex);

                        btnSave.Enabled   = false;
                        btnDelete.Enabled = true;
                        btnUpdate.Enabled = true;
                    }
                }
                catch (Exception ex)
                {
                    lblStatus.Text = ("Pogreška kod pristupa wfc service-u, greška: " + ex);
                }

                FillGridView();
                btnSave.Enabled   = true;
                btnDelete.Enabled = false;
                btnUpdate.Enabled = false;
            }
        }
Beispiel #6
0
 private void FillDdlDrzava()
 {
     try
     {
         proxy = new BolnicaService.Service1Client();
         ddlDrzava.DataSource = proxy.GetDrzava();
         ddlDrzava.DataBind();
     }
     catch (Exception ex)
     {
         lblStatus.Text = ("Pogreška pri učitavanju podataka, greška: " + ex);
     }
 }
Beispiel #7
0
 private void FillGridViewLijek(int idTerapije)
 {
     try
     {
         proxy = new BolnicaService.Service1Client();
         GridviewLijek.DataSource = proxy.GetLijekByTerapija(Convert.ToInt32(idTerapije));
         GridviewLijek.DataBind();
     }
     catch (Exception ex)
     {
         lblStatus.Text = ("Pogreška pri učitavanju podataka, greška: " + ex);
     }
 }
Beispiel #8
0
 private void FillGridViewPacijent()
 {
     try
     {
         proxy = new BolnicaService.Service1Client();
         GridViewPacijent.DataSource = proxy.GetPacijentByDoktorID(Convert.ToInt32(txtDoktor.Text));
         GridViewPacijent.DataBind();
     }
     catch (Exception ex)
     {
         lblStatusPacijenti.Text = ("Pogreška pri učitavanju podataka, greška: " + ex);
     }
 }
Beispiel #9
0
 private void FillGridViewDoktor()
 {
     try
     {
         proxy = new BolnicaService.Service1Client();
         GridViewDoktor.DataSource = proxy.GetDoktorByPacijent(Convert.ToInt32(hfPacijentID.Value));
         GridViewDoktor.DataBind();
     }
     catch (Exception ex)
     {
         lblStatus.Text = ("Pogreška pri učitavanju podataka, greška: " + ex);
     }
 }
Beispiel #10
0
 private void FillGridView()
 {
     try
     {
         proxy = new BolnicaService.Service1Client();
         GridViewProizvodjac.DataSource = proxy.GetProizvodjac();
         GridViewProizvodjac.DataBind();
     }
     catch (Exception ex)
     {
         lblStatus.Text = ("Pogreška pri učitavanju podataka, greška: " + ex);
     }
 }
Beispiel #11
0
 private void FillGridViewPacijentiByDoktor()
 {
     try
     {
         proxy = new BolnicaService.Service1Client();
         int IDdoktor = Convert.ToInt32(ddlOdabirDoktora.SelectedValue);
         GridViewPacijentiByDoktor.DataSource = proxy.GetPacijentByDoktorID(IDdoktor);
         GridViewPacijentiByDoktor.DataBind();
     }
     catch (Exception ex)
     {
         lblStatus.Text = ("Pogreška pri učitavanju podataka, greška: " + ex);
     }
 }
Beispiel #12
0
 private void FillGridViewTerapija()
 {
     try
     {
         int idPacijent = Convert.ToInt32(GridViewPacijent.DataKeys[GridViewPacijent.SelectedRow.RowIndex].Value);
         proxy = new BolnicaService.Service1Client();
         GridViewTerapija.DataSource = proxy.GetPlanTerapije(idPacijent);
         GridViewTerapija.DataBind();
     }
     catch (Exception ex)
     {
         lblStatusPacijenti.Text = ("Pogreška pri učitavanju podataka, greška: " + ex);
     }
 }
Beispiel #13
0
        protected void GridViewPacijentiByDoktor_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                //najprije mi ovo nije radilo a kad sam dodao delete link button onda je ovo proradilo a link button mi ne radi
                int veza = Convert.ToInt32((GridViewPacijentiByDoktor.SelectedRow.FindControl("lblPacijentKorisnickiRacunID") as Label).Text);

                proxy = new BolnicaService.Service1Client();
                var korisnik = proxy.GetPacijentByVeza(veza);

                foreach (var kor in korisnik)
                {
                    txtIDKorisnickiRacun.Text = Convert.ToString(kor.IDKorisnickiRacun);

                    txtUsername.Text = kor.Username;

                    txtPassword.Text = kor.Password;

                    txtIme.Text = kor.Ime;

                    txtPrezime.Text = kor.Prezime;

                    txtOIB.Text = kor.OIB;

                    txtTelefon.Text = kor.Telefon;

                    txtEmail.Text = kor.Email;

                    txtAdresa.Text = kor.Adresa;

                    txtGrad.Text = kor.Grad;

                    txtPTTbroj.Text = kor.PTTBroj;

                    ddlDrzava.SelectedValue = kor.DrzavaID.ToString();
                }
                btnSave.Enabled   = false;
                btnDodaj.Enabled  = false;
                btnDodaj2.Enabled = true;
                btnUpdate.Enabled = true;
            }
            catch (Exception ex)
            {
                lblStatus.Text = ("Došlo je do greške: " + ex);
            }
        }
Beispiel #14
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    proxy = new BolnicaService.Service1Client();
                    BolnicaService.PlanTerapije pt = new BolnicaService.PlanTerapije();


                    try
                    {
                        pt.IDPlanTerapije = Convert.ToInt32(GridViewTerapija.DataKeys[GridViewTerapija.SelectedRow.RowIndex].Value);

                        pt.PacijentID   = Convert.ToInt32(GridViewPacijent.DataKeys[GridViewPacijent.SelectedRow.RowIndex].Value);
                        pt.DoktorID     = Convert.ToInt32(ddlDoktor.SelectedValue);
                        pt.TerapijaID   = Convert.ToInt32(ddlTerapija.SelectedValue);
                        pt.DatumPocetka = Convert.ToDateTime(txtDatumPocetka.Text);

                        proxy.UpdatePlanTerapije(pt);

                        lblStatusPacijenti.Text = "Operacija uspješno spremljena";
                        FillGridViewTerapija();
                    }
                    catch (Exception ex)
                    {
                        lblStatusPacijenti.Text = ("Operacija nije izvršena, greška: " + ex);
                    }



                    ClearAll();
                }
                catch (Exception ex)
                {
                    lblStatusPacijenti.Text = ("Pogreška kod pristupa wfc service-u, greška: " + ex);
                }

                FillGridViewTerapija();

                btnDodaj.Enabled = true;

                btnUpdate.Enabled = false;
            }
        }
Beispiel #15
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    proxy = new BolnicaService.Service1Client();
                    BolnicaService.Proizvodjac p = new BolnicaService.Proizvodjac();


                    try
                    {
                        p.IDProizvodjac = Convert.ToInt32(txtIDProizvodjac.Text);
                        p.Naziv         = txtNazivProizvodjac.Text;
                        proxy.UpdateProizvodjac(p);
                        FillGridView();

                        lblStatus.Text = "Podaci uspješno izmjenjeni";

                        ClearAll();

                        btnSave.Enabled   = true;
                        btnDelete.Enabled = false;
                        btnUpdate.Enabled = false;
                    }
                    catch (Exception ex)
                    {
                        lblStatus.Text = ("Operacija nije izvršena, greška u pristupu kod baze podataka: " + ex);

                        btnSave.Enabled   = false;
                        btnDelete.Enabled = true;
                        btnUpdate.Enabled = true;
                    }
                }
                catch (Exception ex)
                {
                    lblStatus.Text = ("Pogreška kod pristupa wfc service-u, greška: " + ex);
                }

                FillGridView();
                btnSave.Enabled   = true;
                btnDelete.Enabled = false;
                btnUpdate.Enabled = false;
            }
        }
Beispiel #16
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    proxy = new BolnicaService.Service1Client();
                    BolnicaService.Terapija t = new BolnicaService.Terapija();


                    try
                    {
                        t.IDTerapija = Convert.ToInt32(txtIDTerapija.Text);

                        t.Naziv        = txtNaziv.Text;
                        t.DaniTrajanja = Convert.ToInt32(txtDaniTrajanja.Text);
                        t.BolestID     = Convert.ToInt32(ddlBolesti.SelectedValue);

                        proxy.UpdateTerapija(t);

                        lblStatus.Text = "Operacija uspješno spremljena";
                        FillGridView();
                    }
                    catch (Exception ex)
                    {
                        lblStatus.Text = ("Operacija nije izvršena, greška: " + ex);
                    }



                    ClearAll();
                }
                catch (Exception ex)
                {
                    lblStatus.Text = ("Pogreška kod pristupa wfc service-u, greška: " + ex);
                }

                FillGridView();

                btnSave.Enabled   = true;
                btnDelete.Enabled = false;
                btnUpdate.Enabled = false;
            }
        }
Beispiel #17
0
        protected void btnDodaj_Click(object sender, EventArgs e)
        {
            try
            {
                proxy = new BolnicaService.Service1Client();
                BolnicaService.TerapijaLijek tl = new BolnicaService.TerapijaLijek();


                tl.TerapijaID = Convert.ToInt32(GridViewTerapija.DataKeys[GridViewTerapija.SelectedRow.RowIndex].Value);
                tl.LijekID    = Convert.ToInt32(ddlLijek.SelectedValue);
                proxy.AddTerapijaLijek(tl);
                lblStatusDodavanja.Text = "Lijek uspješno dodan terapiji";
                FillGridViewLijek();
            }
            catch (Exception ex)
            {
                lblStatusDodavanja.Text = ("Pogreška kod dodavanja lijeka u terapiju, greška: " + ex);
            }
        }
Beispiel #18
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    proxy = new BolnicaService.Service1Client();
                    BolnicaService.Bolest b = new BolnicaService.Bolest();


                    try
                    {
                        b.IDBolest      = Convert.ToInt32(txtIDBolest.Text);
                        b.NazivBolesti  = txtNazivBolesti.Text;
                        b.GodinaOtkrica = Convert.ToInt32(txtGodinaOtkrica.Text);
                        b.OpasnostID    = Convert.ToInt32(ddlOpasnosti.SelectedValue);

                        proxy.UpdateBolest(b);

                        lblStatus.Text = "Operacija uspješno spremljena";
                        FillGridView();
                    }
                    catch (Exception ex)
                    {
                        lblStatus.Text = ("Operacija nije izvršena, greška: " + ex);
                    }



                    ClearAll();
                }
                catch (Exception ex)
                {
                    lblStatus.Text = ("Pogreška kod pristupa wfc service-u, greška: " + ex);
                }

                FillGridView();

                btnSave.Enabled   = true;
                btnDelete.Enabled = false;
                btnUpdate.Enabled = false;
            }
        }
Beispiel #19
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    proxy = new BolnicaService.Service1Client();
                    BolnicaService.Lijek l = new BolnicaService.Lijek();


                    try
                    {
                        l.IDLijek       = Convert.ToInt32(txtNazivLijek.Text);
                        l.BrojOdobrenja = txtBrojOdobrenja.Text;
                        l.ProizvodjacID = Convert.ToInt32(ddlProizvodjac.SelectedValue);

                        proxy.UpdateLijek(l);

                        lblStatus.Text = "Operacija uspješno spremljena";
                        FillGridView();
                    }
                    catch (Exception ex)
                    {
                        lblStatus.Text = ("Operacija nije izvršena, greška: " + ex);
                    }



                    ClearAll();
                }
                catch (Exception ex)
                {
                    lblStatus.Text = ("Pogreška kod pristupa wfc service-u, greška: " + ex);
                }

                FillGridView();

                btnSave.Enabled   = true;
                btnDelete.Enabled = false;
                btnUpdate.Enabled = false;
            }
        }
Beispiel #20
0
        private void FillPacijent()
        {
            try
            {
                int veza = Convert.ToInt32(hfPacijentID.Value);

                proxy = new BolnicaService.Service1Client();
                var korisnik = proxy.GetPacijentByID(veza);

                foreach (var kor in korisnik)
                {
                    txtIDKorisnickiRacun.Text = Convert.ToString(kor.IDKorisnickiRacun);

                    txtUsername.Text = kor.Username;

                    txtPassword.Text = kor.Password;

                    txtIme.Text = kor.Ime;

                    txtPrezime.Text = kor.Prezime;

                    txtOIB.Text = kor.OIB;

                    txtTelefon.Text = kor.Telefon;

                    txtEmail.Text = kor.Email;

                    txtAdresa.Text = kor.Adresa;

                    txtGrad.Text = kor.Grad;

                    txtPTTbroj.Text = kor.PTTBroj;

                    ddlDrzava.SelectedValue = kor.DrzavaID.ToString();
                }
                btnUpdate.Enabled = true;
            }
            catch (Exception ex)
            {
                lblStatus.Text = ("Došlo je do greške: " + ex);
            }
        }
        protected void btnDodaj_Click(object sender, EventArgs e)
        {
            try
            {
                proxy = new BolnicaService.Service1Client();
                BolnicaService.PacijentDoktor p = new BolnicaService.PacijentDoktor();


                p.PacijentKorisnickiRacunID = Convert.ToInt32(ddlPacijent.SelectedValue);
                p.DoktorKorisnickiRacunID   = Convert.ToInt32(hfDoktorID.Value);

                proxy.AddPacijentDoktorVeza(p);
                lblStatus.Text = "Pacijent dodan";
                FillGridView();
            }
            catch (Exception ex)
            {
                lblStatus.Text = ("Pogreška kod dodavanja terapije, greška: " + ex);
            }
        }
Beispiel #22
0
        protected void lbDelete_Command(object sender, CommandEventArgs e)
        {
            try
            {
                int veza = Convert.ToInt32(e.CommandArgument);

                proxy = new BolnicaService.Service1Client();
                proxy.DeletePlanTerapije(veza);
                lblStatusPacijenti.Text = ("Uspješno izbrisano");
                FillGridViewTerapija();


                btnDodaj.Enabled  = false;
                btnUpdate.Enabled = false;
            }
            catch (Exception ex)
            {
                lblStatusPacijenti.Text = ("Došlo je do pogreške ili nije moguće obrisati podatke" + ex);
            }
        }
Beispiel #23
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(txtIDProizvodjac.Text);

            try
            {
                proxy = new BolnicaService.Service1Client();
                proxy.DeleteProizvodjac(id);
                lblStatus.Text = "Svi podaci uspješno izbrisani";
                ClearAll();
                FillGridView();

                btnSave.Enabled   = true;
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
            }
            catch (Exception ex)
            {
                lblStatus.Text = ("Podaci nisu izbrisani zbog greške: " + ex);
            }
        }
Beispiel #24
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    proxy = new BolnicaService.Service1Client();
                    BolnicaService.Proizvodjac p = new BolnicaService.Proizvodjac();


                    try
                    {
                        p.Naziv = txtNazivProizvodjac.Text;
                        proxy.AddProizvodjac(p);
                        FillGridView();


                        lblStatus.Text = "Operacija uspješno spremljena";
                    }
                    catch (Exception ex)
                    {
                        lblStatus.Text = ("Operacija nije izvršena, greška: " + ex);
                    }



                    ClearAll();
                }
                catch (Exception ex)
                {
                    lblStatus.Text = ("Pogreška kod pristupa wfc service-u, greška: " + ex);
                }

                FillGridView();

                btnSave.Enabled   = true;
                btnDelete.Enabled = false;
                btnUpdate.Enabled = false;
            }
        }
Beispiel #25
0
        protected void ValidateUser(object sender, EventArgs e)
        {
            //ovdje ubaciti logiku provjere cookia



            int    UserId  = 0;
            string roles   = String.Empty;
            string prezime = String.Empty;



            try
            {
                proxy = new BolnicaService.Service1Client();
                BolnicaService.Korisnik korisnik = new BolnicaService.Korisnik();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            var kor = proxy.LoginKorisnikProvjera(Login1.UserName, Login1.Password);

            foreach (var k in kor)
            {
                UserId  = k.IDKorisnickiRacun;
                roles   = k.Grupa;
                prezime = k.Prezime;
            }

            this.Session["TrenutniKorisnik"] = UserId;
            this.Session["Prezime"]          = prezime;


            switch (UserId)
            {
            case -1:
                Login1.FailureText = "Username and/or password is incorrect.";
                break;

            default:
                FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, Login1.UserName, DateTime.Now, DateTime.Now.AddMinutes(2880), Login1.RememberMeSet, roles, FormsAuthentication.FormsCookiePath);
                string     hash   = FormsAuthentication.Encrypt(ticket);
                HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, hash);



                if (ticket.IsPersistent)
                {
                    cookie.Expires = ticket.Expiration;
                }


                //HttpCookie podaciKorisnika = new HttpCookie("userInfo");
                //podaciKorisnika["UserId"] = UserId;
                //podaciKorisnika["prezime"] = prezime;
                //podaciKorisnika["username"] = userName;
                //podaciKorisnika["password"] = paswword;

                Response.Cookies.Add(cookie);
                // ovdje eventualno možemo odrediti gdje želimo da role ode nakon login-a
                Response.Redirect(FormsAuthentication.GetRedirectUrl(Login1.UserName, Login1.RememberMeSet));
                break;
            }
        }
        protected void GridViewKorisnik_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                int veza = Convert.ToInt32(Convert.ToInt32(GridViewKorisnik.DataKeys[GridViewKorisnik.SelectedRow.RowIndex].Value));
                proxy = new BolnicaService.Service1Client();
                var korisnik = proxy.GetPacijentByVeza(veza);

                foreach (var kor in korisnik)
                {
                    txtIDKorisnickiRacun.Text = Convert.ToString(kor.IDKorisnickiRacun);

                    txtUsername.Text = kor.Username;

                    txtPassword.Text = kor.Password;

                    txtIme.Text = kor.Ime;

                    txtPrezime.Text = kor.Prezime;

                    txtOIB.Text = kor.OIB;

                    txtTelefon.Text = kor.Telefon;

                    txtEmail.Text = kor.Email;

                    txtAdresa.Text = kor.Adresa;

                    txtGrad.Text = kor.Grad;

                    txtPTTbroj.Text = kor.PTTBroj;

                    ddlDrzava.SelectedValue = kor.DrzavaID.ToString();
                }
                btnSave.Enabled = false;

                btnUpdate.Enabled = true;
            }
            catch (Exception ex)
            {
                lblStatus.Text = ("Došlo je do greške: " + ex);
            }


            //txtIDKorisnickiRacun.Text = GridViewKorisnik.DataKeys[GridViewKorisnik.SelectedRow.RowIndex].Value.ToString();

            //txtUsername.Text = (GridViewKorisnik.SelectedRow.FindControl("lblUsername") as Label).Text;

            //txtPassword.Text = (GridViewKorisnik.SelectedRow.FindControl("lblPassword") as Label).Text;



            //txtIme.Text = (GridViewKorisnik.SelectedRow.FindControl("lblIMe") as Label).Text;

            //txtPrezime.Text = (GridViewKorisnik.SelectedRow.FindControl("lblPrezime") as Label).Text;

            //txtOIB.Text = (GridViewKorisnik.SelectedRow.FindControl("lblOIB") as Label).Text;

            //txtTelefon.Text = (GridViewKorisnik.SelectedRow.FindControl("lblTelefon") as Label).Text;

            //txtEmail.Text = (GridViewKorisnik.SelectedRow.FindControl("lblEmail") as Label).Text;

            //txtAdresa.Text = (GridViewKorisnik.SelectedRow.FindControl("lblAdresa") as Label).Text;

            //txtGrad.Text = (GridViewKorisnik.SelectedRow.FindControl("lblGrad") as Label).Text;

            //txtPTTbroj.Text = (GridViewKorisnik.SelectedRow.FindControl("lblPTTbroj") as Label).Text;

            //string probaProizvodjac = (GridViewKorisnik.SelectedRow.FindControl("lblDrzavaID") as Label).Text.Trim();
            //if (probaProizvodjac == "")
            //{
            //    ddlDrzava.SelectedValue = "";
            //}
            //else
            //{
            //    ddlDrzava.SelectedValue = (GridViewKorisnik.SelectedRow.FindControl("lblDrzavaID") as Label).Text.Trim();

            //}

            btnSave.Enabled   = false;
            btnDelete.Enabled = true;
            btnUpdate.Enabled = true;
        }
Beispiel #27
0
 private void FillGridViewTerapija()
 {
     proxy = new BolnicaService.Service1Client();
     GridViewTerapija.DataSource = proxy.GetPlanTerapije(Convert.ToInt32(hfPacijentID.Value));
     GridViewTerapija.DataBind();
 }