示例#1
0
        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();
            }
        }
示例#2
0
        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();
        }
示例#3
0
 public Clasa(int id, string desc, Specializare spec)
 {
     IdClasa   = id;
     Descriere = desc;
     Special   = spec;
 }
示例#4
0
 public Clasa()
 {
     IdClasa   = 0;
     Descriere = "";
     Special   = new Specializare();
 }
示例#5
0
 public void ModSpecializare(Specializare spec)
 {
     specsDA.ModSpecializare(spec);
 }
示例#6
0
 public void AddSpecializare(Specializare spec)
 {
     specsDA.AddSpecializare(spec);
 }