public static void Attend(ParticipationClass At) { Conn.Open(); string query = String.Format("Insert into [dbo].[Participations](User_Id,Training_Id) values({0},{1})", At.GetUserId(), At.GetTrainingId()); command = new SqlCommand(query, Conn); command.ExecuteNonQuery(); Conn.Close(); }
public static void LeaveTraining(ParticipationClass Pc) { Conn.Open(); string query = String.Format("Delete from [dbo].[Participations] where User_Id={0} and Training_Id={1}",Pc.GetUserId(),Pc.GetTrainingId()); command = new SqlCommand(query, Conn); command.ExecuteNonQuery(); Conn.Close(); }