public ObservableCollection <Specializare> GetSpecializare() { SqlConnection con = DAHelper.Connection; try { SqlCommand cmd = new SqlCommand("GetSpecial", con); ObservableCollection <Specializare> result = new ObservableCollection <Specializare>(); cmd.CommandType = CommandType.StoredProcedure; con.Open(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { Specializare p = new Specializare(); p.IdSpecializare = reader.GetInt32(0); p.Descriere = reader.GetString(1).TrimEnd(); result.Add(p); } reader.Close(); return(result); } finally { con.Close(); } }
public void AddSpecializare(Specializare spec) { SqlConnection con = DAHelper.Connection; SqlCommand cmd = new SqlCommand("AddSpecializare", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter specDesc = new SqlParameter("@desc", spec.Descriere); cmd.Parameters.Add(specDesc); con.Open(); cmd.ExecuteNonQuery(); con.Close(); }
public Clasa(int id, string desc, Specializare spec) { IdClasa = id; Descriere = desc; Special = spec; }
public Clasa() { IdClasa = 0; Descriere = ""; Special = new Specializare(); }
public void ModSpecializare(Specializare spec) { specsDA.ModSpecializare(spec); }
public void AddSpecializare(Specializare spec) { specsDA.AddSpecializare(spec); }