示例#1
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;
            }
        }