init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
105
KretaWeb/Areas/Hianyzas/Helpers/IgazolasokHelper.cs
Normal file
105
KretaWeb/Areas/Hianyzas/Helpers/IgazolasokHelper.cs
Normal file
|
@ -0,0 +1,105 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Web.Areas.Hianyzas.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Hianyzas.Helpers
|
||||
{
|
||||
public class IgazolasokHelper
|
||||
{
|
||||
public static List<SelectListItem> GetTanuloList()
|
||||
{
|
||||
IDictionary<string, string> dictionary;
|
||||
var helper = new TanuloHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
dictionary = helper.GetTanulokDDL();
|
||||
|
||||
return dictionary.ToSelectListItemList();
|
||||
}
|
||||
|
||||
public static List<SelectListItem> GetOsztCsopList()
|
||||
{
|
||||
IDictionary<string, string> dictionary;
|
||||
var helper = new OsztalyCsoportHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
|
||||
dictionary = helper.GetOsztalyCsoportForDDL(new List<string>(), null, "Osztály", "Csoport");
|
||||
|
||||
return dictionary.ToSelectListItemList();
|
||||
}
|
||||
|
||||
public static List<SelectListItem> GetRogzitoList()
|
||||
{
|
||||
IDictionary<string, string> dictionary;
|
||||
var helper = new TanarHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
dictionary = helper.GetTeachersNameList();
|
||||
|
||||
return dictionary.ToSelectListItemList();
|
||||
}
|
||||
|
||||
public static List<SelectListItem> GetIgazolasTipusList()
|
||||
{
|
||||
IDictionary<string, string> dictionary = FrameworkEnumExtensions.EnumToList((int)GeneratedAdatszotarTipusEnum.IgazolasTipus, ClaimData.SelectedTanevID.Value, true);
|
||||
return dictionary.ToSelectListItemList();
|
||||
}
|
||||
|
||||
internal static IgazolasModel ConvertCoToModel(IgazolasCO co)
|
||||
{
|
||||
IgazolasModel model = new IgazolasModel()
|
||||
{
|
||||
ID = co.ID,
|
||||
TanuloId = co.TanuloId,
|
||||
OsztCsopId = co.OsztCsop,
|
||||
RogzitoId = co.RogzitoId,
|
||||
IgazolasTipus = co.IgazolasTipus,
|
||||
ErvKezdete = co.ErvKezdete,
|
||||
ErvVege = co.ErvVege,
|
||||
Megjegyzes = co.Megjegyzes,
|
||||
RogzDatum = co.RogzDatum,
|
||||
RogzitoNev = co.RogzitoNev,
|
||||
TanuloNev = co.TanuloNev,
|
||||
OsztCsopNev = co.OsztCsopNev
|
||||
};
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
public static IgazolasCO ConvertNewModelToCO(IgazolasModel model)
|
||||
{
|
||||
IgazolasCO co = new IgazolasCO()
|
||||
{
|
||||
TanuloId = model.TanuloId.Value,
|
||||
OsztCsop = model.OsztCsopId.Value,
|
||||
RogzitoId = ClaimData.FelhasznaloId,
|
||||
RogzDatum = DateTime.Now,
|
||||
IgazolasTipus = model.IgazolasTipus,
|
||||
Megjegyzes = model.Megjegyzes,
|
||||
ErvKezdete = model.ErvKezdete.Value,
|
||||
ErvVege = model.ErvVege.Value
|
||||
};
|
||||
return co;
|
||||
}
|
||||
|
||||
public static IgazolasCO ConvertModModelToCO(IgazolasModel model)
|
||||
{
|
||||
IgazolasCO co = new IgazolasCO()
|
||||
{
|
||||
ID = model.ID,
|
||||
TanuloId = model.TanuloId.Value,
|
||||
OsztCsop = model.OsztCsopId.Value,
|
||||
IgazolasTipus = model.IgazolasTipus,
|
||||
Megjegyzes = model.Megjegyzes,
|
||||
ErvKezdete = model.ErvKezdete.Value,
|
||||
ErvVege = model.ErvVege.Value,
|
||||
RogzitoId = model.RogzitoId.Value,
|
||||
RogzDatum = model.RogzDatum
|
||||
|
||||
};
|
||||
return co;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue