init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,202 @@
|
|||
using System.Net;
|
||||
using System.Web.Http;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Logic.TanuloErtekeles;
|
||||
using Kreta.Core;
|
||||
using Kreta.Core.Exceptions;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Framework;
|
||||
using Kreta.KretaServer.Exceptions;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.TanuloErtekeles.Logic;
|
||||
using Kreta.Web.Areas.TanuloErtekeles.Models.TanuloErtekeles;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.Error;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.TanuloErtekeles.Controllers
|
||||
{
|
||||
public class BaseTanuloErtekelesKeresoController : Controller
|
||||
{
|
||||
#region Properties
|
||||
|
||||
public static string GridName => "TanuloErtekelesKeresoGrid";
|
||||
public static string SearchFormName => "TanuloErtekelesKeresoSearchForm";
|
||||
|
||||
public static string InfoPopUpId => "TanuloErtekelesKeresoInfoPopUpWindow";
|
||||
|
||||
#endregion Properties
|
||||
|
||||
public ActionResult OpenTanuloErtekelesKeresoInfoPopUp(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
var co = new TanuloErtekelesHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetTanuloErtekelesCoById(id);
|
||||
var model = new TanuloErtekelesKeresoInfoModel
|
||||
{
|
||||
ID = co.Id.ToString(),
|
||||
TanuloNev = co.TanuloNyomtatasiNev,
|
||||
OsztalyCsoportNev = co.OsztalyCsoportNev,
|
||||
TantargyNev = co.TantargyNev,
|
||||
ErtekeloNyomtatasiNev = co.ErtekeloNyomtatasiNev,
|
||||
TanuloErtekelesText = GetTanuloErtekelesText(co, ClaimData.SelectedTanevID.Value),
|
||||
TipusNev = co.TipusId.GetDisplayName<ErtekelesTipusEnum>(ClaimData.SelectedTanevID.Value),
|
||||
ErtekelesModNev = co.ErtekelesModId.GetDisplayName<ErtekelesModEnum>(ClaimData.SelectedTanevID.Value),
|
||||
Datum = co.Datum.ToShortDateString(),
|
||||
RogzitesDatum = co.RogzitesDatum.ToShortDateString(),
|
||||
ErtekelesTema = co.ErtekelesTema
|
||||
};
|
||||
|
||||
var popUpModel = new PopUpModel(model, "TanuloErtekelesKereso_Info_PopUp");
|
||||
popUpModel = popUpModel.AddCancelBtn(popUpModel, "TanuloErtekelesKeresoHelper.tanuloErtekelesKeresoInfoPopUpCancel");
|
||||
return PartialView(Constants.General.PopupView, popUpModel);
|
||||
}
|
||||
catch (BlException ex)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetTanuloErtekelesText(TanuloErtekelesCo co, int tanevId)
|
||||
{
|
||||
|
||||
string tanuloErtekelesText;
|
||||
if (!co.IsMagatartasSzorgalom)
|
||||
{
|
||||
tanuloErtekelesText = GetErtekelesText(co, tanevId);
|
||||
}
|
||||
else
|
||||
{
|
||||
var magatartasText = GetMagatartasText(co, tanevId);
|
||||
var szorgalomText = GetSzorgalomText(co, tanevId);
|
||||
tanuloErtekelesText = string.Format(TanuloErtekelesResource.MagatartasSzorgalomText, magatartasText, szorgalomText);
|
||||
}
|
||||
|
||||
return tanuloErtekelesText;
|
||||
}
|
||||
|
||||
private static string GetErtekelesText(TanuloErtekelesCo co, int tanevId)
|
||||
{
|
||||
string ertekelesText;
|
||||
if (co.ErtekelesOsztalyzatId.IsEntityId())
|
||||
{
|
||||
ertekelesText = co.TargykategoriaId != (int)TargyKategoriaTipusEnum.Szorgalom
|
||||
? TanuloErtekelesLogicWeb.GetOsztalyzatText(co.ErtekelesOsztalyzatId, tanevId)
|
||||
: TanuloErtekelesLogicWeb.GetOsztalyzatTextSzorgalom(co.ErtekelesOsztalyzatId, tanevId);
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(co.ErtekelesSzovegFormazott))
|
||||
{
|
||||
ertekelesText = co.ErtekelesSzovegFormazott;
|
||||
}
|
||||
else if (co.ErtekelesSzazalek.HasValue)
|
||||
{
|
||||
ertekelesText = co.ErtekelesSzazalek + "%";
|
||||
}
|
||||
else
|
||||
{
|
||||
var ex = new KretaException(ErrorResource.HibaTortentAMuveletKozben);
|
||||
SDAServer.Instance.Logger.ExceptionThrown(ex);
|
||||
throw ex;
|
||||
}
|
||||
|
||||
return ertekelesText;
|
||||
}
|
||||
|
||||
private static string GetMagatartasText(TanuloErtekelesCo co, int tanevId)
|
||||
{
|
||||
var magatartasText = string.Empty;
|
||||
if (co.MagatartasOsztalyzatId.IsEntityId() || co.SzorgalomOsztalyzatId.IsEntityId())
|
||||
{
|
||||
if (co.MagatartasOsztalyzatId.IsEntityId())
|
||||
{
|
||||
magatartasText = TanuloErtekelesLogicWeb.GetOsztalyzatText(co.MagatartasOsztalyzatId, tanevId);
|
||||
}
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(co.MagatartasSzoveg) || !string.IsNullOrWhiteSpace(co.SzorgalomSzoveg))
|
||||
{
|
||||
magatartasText = !string.IsNullOrWhiteSpace(co.MagatartasSzovegFormazott) ?
|
||||
co.MagatartasSzovegFormazott :
|
||||
co.MagatartasSzoveg;
|
||||
}
|
||||
else if (co.MagatartasErtekId.IsEntityId() || co.SzorgalomErtekId.IsEntityId())
|
||||
{
|
||||
if (co.MagatartasErtekId.IsEntityId())
|
||||
{
|
||||
magatartasText = TanuloErtekelesLogicWeb.GetMagatartasErtek(co.MagatartasErtekId, tanevId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var ex = new KretaException(ErrorResource.HibaTortentAMuveletKozben);
|
||||
SDAServer.Instance.Logger.ExceptionThrown(ex);
|
||||
throw ex;
|
||||
}
|
||||
|
||||
return magatartasText;
|
||||
}
|
||||
|
||||
private static string GetSzorgalomText(TanuloErtekelesCo co, int tanevId)
|
||||
{
|
||||
var szorgalomText = string.Empty;
|
||||
if (co.MagatartasOsztalyzatId.IsEntityId() || co.SzorgalomOsztalyzatId.IsEntityId())
|
||||
{
|
||||
if (co.SzorgalomOsztalyzatId.IsEntityId())
|
||||
{
|
||||
szorgalomText = TanuloErtekelesLogicWeb.GetOsztalyzatText(co.SzorgalomOsztalyzatId, tanevId);
|
||||
}
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(co.MagatartasSzoveg) || !string.IsNullOrWhiteSpace(co.SzorgalomSzoveg))
|
||||
{
|
||||
szorgalomText = !string.IsNullOrWhiteSpace(co.SzorgalomSzovegFormazott) ?
|
||||
co.SzorgalomSzovegFormazott :
|
||||
co.SzorgalomSzoveg;
|
||||
}
|
||||
else if (co.MagatartasErtekId.IsEntityId() || co.SzorgalomErtekId.IsEntityId())
|
||||
{
|
||||
if (co.SzorgalomErtekId.IsEntityId())
|
||||
{
|
||||
szorgalomText = TanuloErtekelesLogicWeb.GetSzorgalomErtek(co.SzorgalomErtekId, tanevId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var ex = new KretaException(ErrorResource.HibaTortentAMuveletKozben);
|
||||
SDAServer.Instance.Logger.ExceptionThrown(ex);
|
||||
throw ex;
|
||||
}
|
||||
|
||||
return szorgalomText;
|
||||
}
|
||||
|
||||
#region Export
|
||||
|
||||
public ActionResult ExportTanulokEvkoziJegyei([FromUri] TanuloErtekelesListModel data)
|
||||
{
|
||||
var result = GetExport((int)ErtekelesTipusEnum.evkozi_jegy_ertekeles, TanuloErtekelesResource.TanulokEvkoziJegyeiExportFileName, data);
|
||||
return result;
|
||||
}
|
||||
|
||||
public ActionResult ExportTanulokFeleviJegyei([FromUri] TanuloErtekelesListModel data)
|
||||
{
|
||||
var result = GetExport((int)ErtekelesTipusEnum.felevi_jegy_ertekeles, TanuloErtekelesResource.TanulokFeleviJegyeiExportFileName, data);
|
||||
return result;
|
||||
}
|
||||
|
||||
public ActionResult ExportTanulokEvVegiJegyei([FromUri] TanuloErtekelesListModel data)
|
||||
{
|
||||
var result = GetExport((int)ErtekelesTipusEnum.evvegi_jegy_ertekeles, TanuloErtekelesResource.TanulokEvVegiJegyeiExportFileName, data);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static ActionResult GetExport(int tipusId, string fileDownloadName, TanuloErtekelesListModel model)
|
||||
{
|
||||
return TanuloErtekelesWebLogic.GetExport(tipusId, fileDownloadName, model);
|
||||
}
|
||||
|
||||
#endregion Export
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue