public bool UpdateSessionAcceptReject(AcceptRej AR) { try { using (SqlConnection con = new SqlConnection(connectionString)) { bool Res_CDF; if (AR.CDFResponse == "Y") { Res_CDF = true; } else { Res_CDF = false; } string strCommand = "update tbl_Session set CDF_Acceptance=@CDF_Acceptance where CDF_Id=@CDF_Id and Student_Id=@Student_Id"; SqlCommand cmd = new SqlCommand(strCommand, con); cmd.Parameters.AddWithValue("@CDF_Acceptance", Res_CDF); cmd.Parameters.AddWithValue("@CDF_Id", AR.CDFId); cmd.Parameters.AddWithValue("@Student_Id", AR.StudentId); con.Open(); int i = cmd.ExecuteNonQuery(); if (i > 0) { return(true); } else { return(false); } } } catch (Exception ex) { Log.Error(ex); return(false); } }
public bool UpdateSession([FromBody] AcceptRej AR) { return(SR.UpdateSessionAcceptReject(AR)); }