internal void AddAlergeni(Alergeni alergen) { if (String.IsNullOrEmpty(alergen.Denumire)) { return; } alergeniDAL.AddAlergeni(alergen); //UserList.Add(user); }
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(); } }
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); } }
internal void DeleteAlergeni(Alergeni alergen) { alergeniDAL.DeleteAlergeni(alergen); }
internal ObservableCollection <Preparate> GetPreparatForAlergen(Alergeni alergen) { return(preparateDAL.GetPreparateForAlergen(alergen)); }