public int UpdateAcademicQualification(AcademicQualificationModel acad_qualification) { sqlConnection = OpenConnection(); sqlConnection.Open(); sqlCommand = sqlConnection.CreateCommand(); sqlCommand.CommandText = "UPDATE AcademicAchievements SET " + "[CourseType] = @courseType," + "[GraduationDate] = @graduationDate," + "[CourseSpecialization] = @courseSpecialization,"; sqlCommand.Parameters.AddWithValue("@courseType", acad_qualification.CourseType); sqlCommand.Parameters.AddWithValue("@graduationDate", acad_qualification.GraduationDate); sqlCommand.Parameters.AddWithValue("@courseSpecialization", acad_qualification.Specialization); int result = sqlCommand.ExecuteNonQuery(); sqlConnection.Close(); return(result); }
public int AddtoAcademicQualification(AcademicQualificationModel acad_qualification) { sqlConnection = OpenConnection(); sqlConnection.Open(); sqlCommand = new SqlCommand("INSERT INTO AcademicAchievements VALUES(" + "'" + acad_qualification.CourseType + "','" + acad_qualification.GraduationDate + "','" + acad_qualification.Specialization + "'," + acad_qualification.EmployeeID + ")", sqlConnection); int result = sqlCommand.ExecuteNonQuery(); sqlConnection.Close(); return(result); }
protected void AcademicDetailsEditButton_Click(object sender, EventArgs e) { AcademicQualificationModel acad_qualification = new AcademicQualificationModel() { CourseType = CourseSpecializationTextBox.Text, Specialization = CourseSpecializationTextBox.Text, GraduationDate = GraduationDateTextBox.Text }; EmployeeDataAccessLayer employeeDataAccessLayer = new EmployeeDataAccessLayer(); employeeDataAccessLayer.UpdateAcademicQualification(acad_qualification); }