コード例 #1
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);
            }
        }