コード例 #1
0
        public bool VoegArtiestToeAanFeest(int feestId, int artiestId, Feest.MuziekKeuze keuze)
        {
            using (SqlCommand command = new SqlCommand("dbo.spAddArtiest", ConnectionString))
            {
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.AddWithValue("@ArtiestId", artiestId);
                command.Parameters.AddWithValue("@FeestId", feestId);
                command.Parameters.AddWithValue("@MuziekKeuze", keuze);


                try
                {
                    ConnectionString.Open();
                    int result = command.ExecuteNonQuery();

                    if (result == 0)
                    {
                        ConnectionString.Close();

                        return(false);
                    }

                    ConnectionString.Close();
                    return(true);
                }
                catch (Exception errorException)
                {
                    throw errorException;
                }
            }
        }
コード例 #2
0
        public IActionResult Muziek(int ArtiestId, int FeestId, Feest.MuziekKeuze Muziek)
        {
            FeestLogic logic = new FeestLogic();

            logic.VoegArtiestToeAanFeest(FeestId, ArtiestId, Muziek);
            return(RedirectToAction("Index", "Home"));
        }
コード例 #3
0
 public bool VoegArtiestToeAanFeest(int feestId, int artiestId, Feest.MuziekKeuze keuze)
 {
     if (keuze == Feest.MuziekKeuze.Niks || keuze == Feest.MuziekKeuze.Zaal)
     {
         artiestId = 0;
     }
     return(_feestContext.VoegArtiestToeAanFeest(feestId, artiestId, keuze));
 }