public bool Add(Student newStudent) { string gradeString = newStudent.grade.ToString().Replace(',', '.'); string sql = "INSERT INTO " + TBL_STUDENTS + " (" + STUD_NAME + ", " + STUD_GRADE + ", " + STUD_HEIGHT + ", " + CLASS_ID + ") " + "VALUES('" + newStudent.name + "', " + ConvertGrade(newStudent.grade) + ", " + newStudent.height + ", " + newStudent.class_id.id + ");"; return _db.ExecuteInsertUpdateDelete(sql); }
public bool Edit(Student editStudent) { string sql = "UPDATE " + TBL_STUDENTS + " SET " + STUD_NAME + "='" + editStudent.name + "', " + STUD_HEIGHT + "=" + editStudent.height + ", " + STUD_GRADE + "=" + ConvertGrade(editStudent.grade) + ", " + CLASS_ID + "=" + editStudent.class_id.id + " WHERE " + STUD_ID + "=" + editStudent.id + ";"; return _db.ExecuteInsertUpdateDelete(sql); }
public bool Delete(Student editStudent) { string sql = "DELETE FROM " + TBL_STUDENTS + " WHERE " + STUD_ID + "=" + editStudent.id + ";"; return _db.ExecuteInsertUpdateDelete(sql); }