public static ObservableCollection <DodatnaUsluga> Sort(Prikaz p, NacinSortiranja nn)
        {
            var du = new ObservableCollection <DodatnaUsluga>();

            switch (p)
            {
            case Prikaz.Naziv:
                using (var con = new SqlConnection(ConfigurationManager.ConnectionStrings["POP"].ConnectionString))
                {
                    SqlCommand cmd = con.CreateCommand();
                    if (nn == NacinSortiranja.asc)
                    {
                        cmd.CommandText = "SELECT * FROM DodatnaUsluga WHERE Obrisan=0 Order by Naziv";
                    }
                    else
                    {
                        cmd.CommandText = "SELECT * FROM DodatnaUsluga WHERE Obrisan=0 Order by Naziv desc";
                    }


                    DataSet        ds = new DataSet();
                    SqlDataAdapter da = new SqlDataAdapter();

                    da.SelectCommand = cmd;
                    da.Fill(ds, "DodatnaUsluga");     // Query se izvrsava
                    foreach (DataRow row in ds.Tables["DodatnaUsluga"].Rows)
                    {
                        var d = new DodatnaUsluga();
                        d.Id      = int.Parse(row["Id"].ToString());
                        d.Naziv   = row["Naziv"].ToString();
                        d.Obrisan = bool.Parse(row["Obrisan"].ToString());
                        d.Cena    = double.Parse(row["Cena"].ToString());
                        du.Add(d);
                    }
                }
                break;

            case Prikaz.Cena:
                using (var con = new SqlConnection(ConfigurationManager.ConnectionStrings["POP"].ConnectionString))
                {
                    SqlCommand cmd = con.CreateCommand();
                    if (nn == NacinSortiranja.asc)
                    {
                        cmd.CommandText = "SELECT * FROM DodatnaUsluga WHERE Obrisan=0 Order by Cena";
                    }
                    else
                    {
                        cmd.CommandText = "SELECT * FROM DodatnaUsluga WHERE Obrisan=0 Order by Cena desc";
                    }


                    DataSet        ds = new DataSet();
                    SqlDataAdapter da = new SqlDataAdapter();

                    da.SelectCommand = cmd;
                    da.Fill(ds, "DodatnaUsluga");     // Query se izvrsava
                    foreach (DataRow row in ds.Tables["DodatnaUsluga"].Rows)
                    {
                        var d = new DodatnaUsluga();
                        d.Id      = int.Parse(row["Id"].ToString());
                        d.Naziv   = row["Naziv"].ToString();
                        d.Obrisan = bool.Parse(row["Obrisan"].ToString());
                        d.Cena    = double.Parse(row["Cena"].ToString());
                        du.Add(d);
                    }
                }
                break;
            }
            return(du);
        }
 public static void Delete(DodatnaUsluga d)
 {
     d.Obrisan = true;
     Update(d);
 }