This repository has been archived on 2026-05-26. You can view files and clone it. You cannot open issues or pull requests or push a commit.
2023-05-02 15:02:47 +02:00
|
|
|
package com.denizk0461.studip.viewmodel
|
|
|
|
|
|
|
|
|
|
import android.app.Application
|
|
|
|
|
import com.denizk0461.studip.model.StudIPEvent
|
|
|
|
|
|
|
|
|
|
class ScheduleUpdateViewModel(application: Application) : AppViewModel(application) {
|
|
|
|
|
|
2023-05-03 14:16:32 +02:00
|
|
|
/**
|
|
|
|
|
* Inserts a new schedule element.
|
|
|
|
|
*
|
|
|
|
|
* @param event the event to save
|
|
|
|
|
*/
|
|
|
|
|
fun insert(event: StudIPEvent) { doAsync { repo.insert(event) } }
|
|
|
|
|
|
2023-05-02 15:02:47 +02:00
|
|
|
/**
|
|
|
|
|
* Updates a schedule element.
|
|
|
|
|
*
|
|
|
|
|
* @param event the event to update
|
|
|
|
|
*/
|
|
|
|
|
fun update(event: StudIPEvent) { doAsync { repo.update(event) } }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Deletes a schedule element.
|
|
|
|
|
*
|
|
|
|
|
* @param event the event to delete
|
|
|
|
|
*/
|
|
|
|
|
fun delete(event: StudIPEvent) { doAsync { repo.delete(event) } }
|
|
|
|
|
}
|