init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
34
Kreta.BusinessLogic/Helpers/ElearningElerhetosegHelper.cs
Normal file
34
Kreta.BusinessLogic/Helpers/ElearningElerhetosegHelper.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using Kreta.Core.ConnectionType;
|
||||
using Kreta.DataAccessManual;
|
||||
|
||||
namespace Kreta.BusinessLogic.Helpers
|
||||
{
|
||||
public class ElearningElerhetosegHelper : LogicBase
|
||||
{
|
||||
public ElearningElerhetosegHelper(IConnectionType connectionType) : base(connectionType) { }
|
||||
|
||||
public IEnumerable<string> GetElearningElerhetosegList(bool isGondviselo, bool isTanulo, int role, List<string> packages, int? gondviseloId)
|
||||
{
|
||||
var ds = Dal.CustomConnection.Run(ConnectionType, h => h.ElearningElerhetosegDal().GetElearningElerhetosegDataSet(role, packages, TanevId, IntezmenyId, isGondviselo, isTanulo, FelhasznaloId, gondviseloId));
|
||||
|
||||
var courseIdList = new List<string>();
|
||||
var now = DateTime.Now;
|
||||
foreach (var course in ds.Tables[0].AsEnumerable())
|
||||
{
|
||||
var availabilityStartDate = course.Field<DateTime?>("elerhetosegKezdete");
|
||||
var availabilityEndDate = course.Field<DateTime?>("elerhetosegVege") ?? now.AddYears(1);
|
||||
|
||||
if (availabilityStartDate <= now.Date && availabilityEndDate >= now.Date)
|
||||
{
|
||||
courseIdList.Add(course.Field<string>("azonosito"));
|
||||
}
|
||||
}
|
||||
|
||||
return courseIdList.Distinct();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue