Example #1
0
        public static Stage VerwerkRij(IDataRecord rij)
        {
            Stage type = new Stage();

            type.ID = Convert.ToInt32(rij["ID"].ToString());
            type.Name = rij["Name"].ToString();

            return type;

        }
Example #2
0
        public static void DeleteType(Stage SelectedStage)
        {
            try
            {
                DbParameter paramName = Database.AddParameter("@Name", SelectedStage.Name);

                Database.ModifyData("DELETE FROM Stages WHERE Name = @Name", paramName);
            }
            catch (Exception e)
            {

                throw e;
            }
        }
Example #3
0
        public static void AddType(Stage SelectedStage)
        {
            try
            {

                DbParameter paramName = Database.AddParameter("@Name", SelectedStage.Name);
                Database.ModifyData("INSERT INTO Stages (Name) values (@Name)", paramName);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

        }
Example #4
0
        //Stage methods

        public void AddStage()
        {
            Stage newStage = new Stage();
            Podiums.Add(newStage);

            SelectedStage = newStage;
        }
Example #5
0
 private static Stage CreateStageWithDate(DbDataReader reader, DateTime date)
 {
     Stage stage = new Stage();
     stage.ID = Int32.Parse(reader["ID"].ToString());
     stage.Name = Convert.ToString(reader["Name"]);
     stage.Bands = LineUp.GetBandsByLineUpIDAndDate(Convert.ToInt32(reader["ID"]), date);
     return stage;
 }
Example #6
0
 private static Stage CreateStage(DbDataReader rij)
 {
     Stage stage = new Stage();
     stage.ID = Int32.Parse(rij["ID"].ToString());
     stage.Name = Convert.ToString(rij["Name"]);
     stage.Bands = LineUp.GetBandsByLineUpID(Convert.ToInt32(rij["ID"]));
     return stage;
 }
Example #7
0
        public static void EditStage(Stage stag)
        {
            try
            {
                
                string sql = "UPDATE Ticket SET Name=@name WHERE ID=@ID;";

                DbParameter par1 = Database.AddParameter("@name", stag.Name);
              
                DbParameter parID = Database.AddParameter("@ID", Convert.ToInt32(stag.ID));

                Database.ModifyData(sql, par1, parID);



            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                throw ex;
            }
        }
Example #8
0
 public static Stage GetStageByID(int id)
 {
     Stage gevondenStage = new Stage();
     DbParameter par1 = Database.AddParameter("@id", id);
     DbDataReader reader = Database.GetData("SELECT * FROM  stages WHERE ID = @id",par1);
     while (reader.Read())
     {
         gevondenStage.Name = reader["Name"].ToString();
     }
     return gevondenStage;
 }