コード例 #1
0
 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();
 }
コード例 #2
0
 protected void AttendToTraining(object sender, EventArgs e)
 {
     if (!ConnectionClass.IsAttending(UserC.GetId(), TrainingId))
     {
         ParticipationClass Att = new ParticipationClass(UserC.GetId(), TrainingId);
         ConnectionClass.Attend(Att);
         Response.Redirect(Request.RawUrl);
     }
 }
コード例 #3
0
 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();
 }