Exemple #1
0
 internal void AddAlergeni(Alergeni alergen)
 {
     if (String.IsNullOrEmpty(alergen.Denumire))
     {
         return;
     }
     alergeniDAL.AddAlergeni(alergen);
     //UserList.Add(user);
 }
Exemple #2
0
 internal void DeleteAlergeni(Alergeni alergeni)
 {
     using (SqlConnection connection = DALHelper.Connection)
     {
         SqlCommand cmd = new SqlCommand("spAlergeni_Delete", connection);
         cmd.CommandType = System.Data.CommandType.StoredProcedure;
         SqlParameter paramDenumire = new SqlParameter("@Denumire", alergeni.Denumire);
         cmd.Parameters.Add(paramDenumire);
         connection.Open();
         cmd.ExecuteNonQuery();
     }
 }
Exemple #3
0
 internal ObservableCollection <Preparate> GetPreparateForAlergen(Alergeni alergen)
 {
     using (SqlConnection connection = DALHelper.Connection)
     {
         SqlCommand cmd = new SqlCommand("spPreparateCuAlergeni_GetDenumirePreparat", connection);
         ObservableCollection <Preparate> result = new ObservableCollection <Preparate>();
         cmd.CommandType = System.Data.CommandType.StoredProcedure;
         SqlParameter paramDenumire = new SqlParameter("@Denumire", alergen.Denumire);
         cmd.Parameters.Add(paramDenumire);
         connection.Open();
         SqlDataReader reader = cmd.ExecuteReader();
         while (reader.Read())
         {
             result.Add(
                 new Preparate()
             {
                 Denumire = reader["denumire"].ToString()
             });
         }
         reader.Close();
         return(result);
     }
 }
Exemple #4
0
 internal void DeleteAlergeni(Alergeni alergen)
 {
     alergeniDAL.DeleteAlergeni(alergen);
 }
Exemple #5
0
 internal ObservableCollection <Preparate> GetPreparatForAlergen(Alergeni alergen)
 {
     return(preparateDAL.GetPreparateForAlergen(alergen));
 }