using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Church.Net.DAL.EF; using Church.Net.Entity; using Church.Net.Utility; using Church.Net.DAL.EFCoreDBF; using WebAPI.Logics; using WebAPI.Logics.Interface; namespace WebAPI.Controllers { [Route("[controller]/[action]")] [ApiController] public class CellGroupRoutineEventsController : ApiControllerBase { private readonly CellGroupLogic logic; private readonly ICombinedKeyCrudLogic prayerLogic; private readonly ICombinedKeyCrudLogic dinnerLogic; public CellGroupRoutineEventsController( CellGroupLogic logic, ICrudLogic crudLogic, ICombinedKeyCrudLogic prayerLogic, ICombinedKeyCrudLogic dinnerLogic ) : base(crudLogic) { this.logic = logic; this.prayerLogic = prayerLogic; this.dinnerLogic = dinnerLogic; } // GET: api/CellGroupRoutineEvents [HttpGet] public CellGroupRoutineEvent GetComingEvent() { return logic.GetComingEvent(); } [HttpGet] public CellGroupRoutineEvent GetLastEvent() { return logic.GetLastEvent(); } [HttpPost] public int CreateOrUpdatePrayer(CellGroupRoutineEventPrayer p) { return prayerLogic.CreateOrUpdate(p); } [HttpPost] public int CreateOrUpdateAttendees(CellGroupRoutineEventAttendee p) { return dinnerLogic.CreateOrUpdate(p); } } [Route("[controller]/[action]")] [ApiController] public class CellGroupRoutineEventPrayerController : CombinedKeyApiControllerBase { public CellGroupRoutineEventPrayerController(ICombinedKeyCrudLogic logic) : base(logic) { } } }