101 lines
4.6 KiB
C#
101 lines
4.6 KiB
C#
using System.Collections.Generic;
|
|
using System.Net;
|
|
using System.Web.Http;
|
|
using System.Web.Mvc;
|
|
using Kreta.BusinessLogic.Classes;
|
|
using Kreta.BusinessLogic.Helpers;
|
|
using Kreta.Core.Exceptions;
|
|
using Kreta.Resources;
|
|
using Kreta.Web.Areas.Hianyzas.Logic;
|
|
using Kreta.Web.Areas.Hianyzas.Models;
|
|
using Kreta.Web.Helpers;
|
|
using Kreta.Web.Helpers.Error;
|
|
using Kreta.Web.Helpers.TabStrip;
|
|
using Kreta.Web.Models.EditorTemplates;
|
|
using Kreta.Web.Security;
|
|
|
|
namespace Kreta.Web.Areas.Hianyzas.Controllers
|
|
{
|
|
public class BaseMulasztasKeresoController : Controller
|
|
{
|
|
#region Properties
|
|
|
|
public static string GridName => "MulasztasKeresoGrid";
|
|
public static string SearchFormName => "MulasztasKeresoSearchForm";
|
|
|
|
public static string InfoPopUpId => "MulasztasKeresoInfoPopUpWindow";
|
|
|
|
#endregion Properties
|
|
|
|
public ActionResult OpenMulasztasInfoPopUp(int mulasztasId)
|
|
{
|
|
try
|
|
{
|
|
var mulasztasCo = new MulasztasHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetMulasztasById(mulasztasId);
|
|
var tanoraCo = new TanoraHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetTanoraByOrarendiId(mulasztasCo.OraId.Value, mulasztasCo.Datum, true, ClaimData.IsTanuloOrGondviselo);
|
|
var alapadatModel = new MulasztasInfoModel.AlapadatModel
|
|
{
|
|
Tanulo = mulasztasCo.TanuloNev,
|
|
Datum = mulasztasCo.Datum.ToShortDateString(),
|
|
Oraszam = mulasztasCo.Oraszam,
|
|
OsztalyCsoport = tanoraCo.OsztalyCsoportNev,
|
|
Tantargy = mulasztasCo.TargyNev,
|
|
MulasztasTipus = mulasztasCo.MulTipNev,
|
|
KesesPercben = mulasztasCo.KesIdo,
|
|
Igazolt = mulasztasCo.Igazolt.GetDisplayName(),
|
|
IgazolasTipus = mulasztasCo.IgazolasTipusNev,
|
|
Megjegyzes = mulasztasCo.Megjegyzes
|
|
};
|
|
var tanitasiOraModel = new MulasztasInfoModel.TanitasiOraModel
|
|
{
|
|
Datum = tanoraCo.Datum.ToShortDateString(),
|
|
Oraszam = tanoraCo.Oraszam,
|
|
HetNapja = tanoraCo.HetNapjaNev,
|
|
Hetirend = tanoraCo.HetirendNev,
|
|
Foglalkozas = tanoraCo.FoglalkozasNev,
|
|
OsztalyCsoport = tanoraCo.OsztalyCsoportNev,
|
|
Tantargy = tanoraCo.TantargyNev,
|
|
Tanar = tanoraCo.TanarNev,
|
|
HelyettesitesitoTanarNeve = tanoraCo.HelyettesitesitoTanarNeve,
|
|
Terem = tanoraCo.TeremNev,
|
|
Megtartott = tanoraCo.Megtartott.HasValue ? tanoraCo.Megtartott.Value.GetDisplayName() : HianyzasResource.NemNaplozott,
|
|
Sorszamozando = tanoraCo.Sorszamozando.GetDisplayName(),
|
|
OraKezdete = tanoraCo.OraKezd.ToString("HH:mm"),
|
|
OraVege = tanoraCo.OraVeg.ToString("HH:mm"),
|
|
Tema = tanoraCo.Tema,
|
|
Megjegyzes = tanoraCo.Megjegyzes
|
|
};
|
|
|
|
var popUpModel = new PopUpModel(new TabStripModel { TabList = GetInfoTabs(alapadatModel, tanitasiOraModel) }, "MulasztasKereso_Info_PopUp");
|
|
popUpModel.AddCancelBtn(popUpModel, "MulasztasKeresoHelper.mulasztasKeresoInfoPopUpCancel");
|
|
return PartialView(Constants.General.PopupView, popUpModel);
|
|
}
|
|
catch (BlException ex)
|
|
{
|
|
throw new StatusError(HttpStatusCode.BadRequest, ex.Message);
|
|
}
|
|
}
|
|
|
|
public static List<TabStripItemModel> GetInfoTabs(MulasztasInfoModel.AlapadatModel alapadatModel, MulasztasInfoModel.TanitasiOraModel tanitasiOraModel)
|
|
{
|
|
return new List<TabStripItemModel> {
|
|
new TabStripItemModel { ItemId = "1", ItemName = HianyzasResource.Alapadatok, Model = alapadatModel, PartialViewName = "MulasztasKereso_Info_Alapadatok_Tab", IsActive = true },
|
|
new TabStripItemModel { ItemId = "2", ItemName = HianyzasResource.TanitasiOraAdatai, Model = tanitasiOraModel, PartialViewName = "MulasztasKereso_Info_TanitasiOraAdatai_Tab" }
|
|
};
|
|
}
|
|
|
|
#region Export
|
|
|
|
public ActionResult ExportTanulokMulasztasai([FromUri] MulasztasSearchModel data)
|
|
{
|
|
return MulasztasKeresoLogic.ExportTanulokMulasztasai(data);
|
|
}
|
|
|
|
public ActionResult ExportTanorakonNemJelenlevok([FromUri] MulasztasSearchModel data)
|
|
{
|
|
return MulasztasKeresoLogic.ExportTanorakonNemJelenlevok(data);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|