modified all admin UIs to position action buttons on the left side of grids and implemented ActionDialog throughout rather than dedicated delete components

This commit is contained in:
Shaun Walker
2019-11-04 23:29:35 -05:00
parent 156f5b5f94
commit ab564f7244
32 changed files with 737 additions and 732 deletions

View File

@ -0,0 +1,49 @@
using System.Collections.Generic;
using System.Linq;
using Oqtane.Models;
using Microsoft.EntityFrameworkCore;
using System;
namespace Oqtane.Repository
{
public class ScheduleRepository : IScheduleRepository
{
private MasterDBContext db;
public ScheduleRepository(MasterDBContext context)
{
db = context;
}
public IEnumerable<Schedule> GetSchedules()
{
return db.Schedule.ToList();
}
public Schedule AddSchedule(Schedule Schedule)
{
db.Schedule.Add(Schedule);
db.SaveChanges();
return Schedule;
}
public Schedule UpdateSchedule(Schedule Schedule)
{
db.Entry(Schedule).State = EntityState.Modified;
db.SaveChanges();
return Schedule;
}
public Schedule GetSchedule(int ScheduleId)
{
return db.Schedule.Find(ScheduleId);
}
public void DeleteSchedule(int ScheduleId)
{
Schedule schedule = db.Schedule.Find(ScheduleId);
db.Schedule.Remove(schedule);
db.SaveChanges();
}
}
}