public List <VanguardDecksDO> GetVanguardDecks(int DeckID) { List <VanguardDecksDO> ListOfDecks = new List <VanguardDecksDO>(); try { using (SqlConnection connection = new SqlConnection(conn)) { using (SqlCommand command = new SqlCommand("SP_GET_Vanguard_Deck", connection)) { command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.AddWithValue("@parmDeckID", DeckID); connection.Open(); using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { VanguardDecksDO Decks = new VanguardDecksDO(); Decks.DeckID = (int)reader["DeckID"]; Decks.DeckName = (string)reader["DeckName"]; ListOfDecks.Add(Decks); } } } } } catch (Exception error) { throw error; } return(ListOfDecks); }
public bool UpdateVanguardDecks(VanguardDecksDO Deck) { bool _IsSucceeded = false; try { using (SqlConnection connection = new SqlConnection(conn)) { using (SqlCommand command = new SqlCommand("SP_Update_Vanguard_Deck", connection)) { command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.AddWithValue("@parmDeckID", Deck.DeckID); command.Parameters.AddWithValue("@parmDeckName", Deck.DeckName); } } } catch (Exception error) { _IsSucceeded = false; throw error; } return(_IsSucceeded); }