package com.example.doctor.Pref

import android.annotation.SuppressLint
import android.content.Context
import android.content.SharedPreferences

class SavePref (){


    @SuppressLint("CommitPrefEdits")
    fun saveToken(context: Context, token: String) {
        val prefDoctor: SharedPreferences = context.getSharedPreferences("DOCTORtoken", Context.MODE_PRIVATE)
        prefDoctor.edit().putString("token", token).apply()
    }


    @SuppressLint("CommitPrefEdits")
    fun saveViewPatient(context: Context, view_patient: Int) {
        val prefDoctor: SharedPreferences = context.getSharedPreferences("DOCTORviewPatient", Context.MODE_PRIVATE)
        prefDoctor.edit().putInt("viewPatient", view_patient).apply()
    }

    @SuppressLint("CommitPrefEdits")
    fun saveIdPatient(context: Context, view_patient: Int) {
        val prefDoctor: SharedPreferences = context.getSharedPreferences("DOCTORidPatient", Context.MODE_PRIVATE)
        prefDoctor.edit().putInt("idPatient", view_patient).apply()
    }

    @SuppressLint("CommitPrefEdits")
    fun saveIdCourses(context: Context, view_patient: Int) {
        val prefDoctor: SharedPreferences = context.getSharedPreferences("DOCTORidCourses", Context.MODE_PRIVATE)
        prefDoctor.edit().putInt("idCourses", view_patient).apply()
    }
    @SuppressLint("CommitPrefEdits")
    fun saveIdActivitis(context: Context, view_patient: Int) {
        val prefDoctor: SharedPreferences = context.getSharedPreferences("DOCTORIdActivitis", Context.MODE_PRIVATE)
        prefDoctor.edit().putInt("idActivitis", view_patient).apply()
    }
}