init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,180 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Results;
|
||||
using System.Web.Mvc;
|
||||
using Kendo.Mvc.UI;
|
||||
using Kreta.BusinessLogic.Classes.ComboBox;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.BusinessLogic.Utils;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.Error;
|
||||
using Kreta.Web.Helpers.Grid;
|
||||
using Kreta.Web.Security;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.ApiControllers
|
||||
{
|
||||
[ApiRoleClaimsAuthorize(true)]
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Tanar.ClaimValue)]
|
||||
public class BaseTanmenetApiController : ApiController
|
||||
{
|
||||
public DataSourceResult GetTanmenetGrid(string data, [System.Web.Http.ModelBinding.ModelBinder(typeof(ModelBinder.DataSourceRequestModelBinder))] DataSourceRequest request)
|
||||
{
|
||||
var model = JsonConvert.DeserializeObject<TanmenetSearchModel>(data);
|
||||
model.FeltoltoIdSearch = ClaimData.FelhasznaloId;
|
||||
var thelper = new TanmenetHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
|
||||
thelper.GridParameters = Converter.GridParameter(request);
|
||||
|
||||
TanmenetKereseseCO co = ConvertSearchModelToCo(model);
|
||||
DataSet tanmenetek = thelper.GetTanmenetek(co);
|
||||
return tanmenetek.ToDataSourceResult();
|
||||
|
||||
}
|
||||
|
||||
public string GetTanmenetModalHeader(int tantargyId, int osztalyId)
|
||||
{
|
||||
Enum.TryParse(new OsztalyCsoportHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType()).GetOsztalyCsoportFeladatKategoria(osztalyId).ToString(), out OktNevelesiKategoriaEnum kategoria);
|
||||
|
||||
return new TanmenetHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType()).GetTanmenetModalHeader(ClaimData.FelhasznaloId, tantargyId, osztalyId, kategoria);
|
||||
}
|
||||
|
||||
public DataSourceResult GetTanmenetOrak(int foglalkozasId, int TantargyId, int OsztalyId, [System.Web.Http.ModelBinding.ModelBinder(typeof(ModelBinder.DataSourceRequestModelBinder))] DataSourceRequest request)
|
||||
{
|
||||
var thelper = new TanmenetHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
thelper.GridParameters = Converter.GridParameter(request);
|
||||
DataSet tanmenetek = thelper.GetTanmenetek(TantargyId, OsztalyId, ClaimData.FelhasznaloId, foglalkozasId: foglalkozasId);
|
||||
return tanmenetek.ToDataSourceResult();
|
||||
}
|
||||
|
||||
[System.Web.Http.HttpPost]
|
||||
public HttpResponseMessage SaveTanmenet(TanmenetModel model)
|
||||
{
|
||||
if (model.TanmenetBejegyzesek.All(x => string.IsNullOrWhiteSpace(x.Tema)))
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ErrorResource.UresTanmenetetNemLehetMenteni);
|
||||
}
|
||||
|
||||
var temaLengthErrors = new List<string>();
|
||||
foreach (var bejegyzes in model.TanmenetBejegyzesek.Where(b => !string.IsNullOrWhiteSpace(b.Tema)))
|
||||
{
|
||||
// NOTE: bejegyzés név = "{oraszam}. {tema}", max 1000 karakter, amiből óraszám max 3 karakter lehet
|
||||
if (bejegyzes.Tema.Length > 995)
|
||||
{
|
||||
temaLengthErrors.Add(string.Format(ErrorResource.TanmenetBejegyzesTemaMaxKarakter, bejegyzes.Oraszam));
|
||||
}
|
||||
}
|
||||
|
||||
if (temaLengthErrors.Any())
|
||||
{
|
||||
var errorMsg = string.Join(Core.Constants.General.Sortores, temaLengthErrors);
|
||||
throw new StatusError(HttpStatusCode.BadRequest, errorMsg);
|
||||
}
|
||||
|
||||
model.AlkalmazottId = ClaimData.FelhasznaloId;
|
||||
TanmenetCO co = ConvertModelToCo(model);
|
||||
|
||||
var tHelper = new TanmenetHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
tHelper.SaveTanmenet(co);
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
|
||||
[System.Web.Http.HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public HttpResponseMessage Delete([FromBody] int foglalkozasId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var helper = new TanmenetHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
List<TanmenetItemCo> tanmenetCoList = helper.GetTanmenetCoList(ClaimData.FelhasznaloId).Where(x => x.TantargyfelosztasId == foglalkozasId).ToList();
|
||||
foreach (TanmenetItemCo tanmenetCo in tanmenetCoList)
|
||||
{
|
||||
helper.DeleteTanmenet(tanmenetCo.Id);
|
||||
}
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.InternalServerError, ErrorResource.HibaATorlesSoran)
|
||||
{
|
||||
UnHandledException = e
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public List<SelectListItem> GetTantargyList()
|
||||
{
|
||||
List<SelectListItem> list = new List<SelectListItem>();
|
||||
TantargyHelper helper = new TantargyHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
|
||||
foreach (var item in helper.GetTantargyakForDDL(ClaimData.FelhasznaloId, isSzakkepzo: ClaimData.IsSzakkepzoIntezmeny))
|
||||
{
|
||||
SelectListItem sli = new SelectListItem() { Text = item.Value, Value = item.Key };
|
||||
list.Add(sli);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private TanmenetKereseseCO ConvertSearchModelToCo(TanmenetSearchModel model)
|
||||
{
|
||||
TanmenetKereseseCO co = new TanmenetKereseseCO()
|
||||
{
|
||||
AlkalmazottID = model.FeltoltoIdSearch,
|
||||
Megjegyzes = model.MegjegyzesSearch,
|
||||
Nev = model.NevSearch,
|
||||
Oraszam = model.OraszamSearch,
|
||||
OsztalyID = model.OsztalyCsoportIdSearch,
|
||||
RovidNev = model.RovidNevSearch,
|
||||
TantargyID = model.TantargyIdSearch,
|
||||
Tema = model.TemaSearch
|
||||
};
|
||||
return co;
|
||||
}
|
||||
|
||||
private TanmenetCO ConvertModelToCo(TanmenetModel model)
|
||||
{
|
||||
TanmenetCO co = new TanmenetCO()
|
||||
{
|
||||
AlkalmazottID = model.AlkalmazottId,
|
||||
FoglalkozasID = model.FoglalkozasId,
|
||||
Orak = new List<TanmenetOrakCO>()
|
||||
};
|
||||
|
||||
foreach (var tema in model.TanmenetBejegyzesek)
|
||||
{
|
||||
co.Orak.Add(new TanmenetOrakCO()
|
||||
{
|
||||
ID = string.IsNullOrWhiteSpace(tema.ID) ? new int?() : int.Parse(tema.ID),
|
||||
Tema = tema.Tema,
|
||||
Oraszam = tema.Oraszam
|
||||
}
|
||||
);
|
||||
}
|
||||
return co;
|
||||
}
|
||||
|
||||
public JsonResult<List<ComboBoxListItem>> GetFoglalkozasList()
|
||||
{
|
||||
var helper = new TantargyFelosztasHelper(ConnectionTypeExtensions.GetSessionConnectionType())
|
||||
{
|
||||
GridParameters = null,
|
||||
};
|
||||
|
||||
var foglalkozasok = helper.GetTantargyFelosztasForDDL(ClaimData.FelhasznaloId);
|
||||
|
||||
return Json(foglalkozasok.ToComboBoxItemList());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,461 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.ModelBinding;
|
||||
using System.Web.Http.Results;
|
||||
using Kendo.Mvc.Extensions;
|
||||
using Kendo.Mvc.UI;
|
||||
using Kreta.BusinessLogic.Classes.ComboBox;
|
||||
using Kreta.BusinessLogic.Exceptions;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Logic;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Core;
|
||||
using Kreta.Core.Exceptions;
|
||||
using Kreta.Framework;
|
||||
using Kreta.Framework.Entities;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.Error;
|
||||
using Kreta.Web.Helpers.Grid;
|
||||
using Kreta.Web.Security;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.ApiControllers
|
||||
{
|
||||
public class BaseTantargyFelosztasApiController : ApiController
|
||||
{
|
||||
public DataSourceResult GetTantargyFelosztasok(string data, DataSourceRequest request)
|
||||
{
|
||||
var (gridParameter, modelList, _) = GetGridData(data, request);
|
||||
|
||||
var ret = modelList.ToDataSourceResult(gridParameter);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public HttpResponseMessage GetExport(string data, DataSourceRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
var (gridParameter, modelList, exportAttributeName) = GetGridData(data, request);
|
||||
|
||||
modelList = modelList.SortingAndPaging(gridParameter.OrderDictionary);
|
||||
|
||||
var simpleExportColumnCos = SimpleExportLogic.GetSimpleExportColumnCos<TantargyFelosztasGridModel>(exportAttributeName);
|
||||
|
||||
var memoryStream = SimpleExportLogic.GetExport(TantargyfelosztasResource.ExportSheetName, simpleExportColumnCos, modelList, ClaimData.SelectedTanevID.Value);
|
||||
|
||||
return HttpResponseExtensions.GetFileHttpResponse(memoryStream.ToArray(), string.Format(TantargyfelosztasResource.ExportFileNameFormat, ClaimData.IntezmenyAzonosito));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ErrorResource.HibaTortentAFajlExportalasaKozben) { UnHandledException = ex };
|
||||
}
|
||||
}
|
||||
|
||||
private (GridParameters gridParameter, List<TantargyFelosztasGridModel> modelList, string exportAttributeName) GetGridData(string data, DataSourceRequest request)
|
||||
{
|
||||
var connection = ConnectionTypeExtensions.GetSessionConnectionType();
|
||||
var model = JsonConvert.DeserializeObject<TantargyFelosztasModel>(data);
|
||||
var gridParameter = Converter.GridParameter(request);
|
||||
|
||||
var keresesModel = model.ConvertToCo();
|
||||
if (model.IsFromSzervezet)
|
||||
{
|
||||
var szervezetId = new SzervezetHelper(connection).GetAlkalmazottSzervezetId(ClaimData.FelhasznaloId);
|
||||
keresesModel.SzervezetId = szervezetId;
|
||||
}
|
||||
|
||||
var coList = new TantargyFelosztasHelper(connection).GetTantargyFelosztasCoList(keresesModel);
|
||||
|
||||
var modelList = new List<TantargyFelosztasGridModel>();
|
||||
foreach (var co in coList)
|
||||
{
|
||||
var gridModel = new TantargyFelosztasGridModel(co);
|
||||
modelList.Add(gridModel);
|
||||
}
|
||||
|
||||
var exportAttributeName = model.IsFromSzervezet ? TantargyFelosztasGridModel.DualisTantargyFelosztasExportAttributeId : TantargyFelosztasGridModel.TantargyFelosztasExportAttributeId;
|
||||
|
||||
return (gridParameter, modelList, exportAttributeName);
|
||||
}
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue, KretaClaimPackages.Dualis_Admin.ClaimValue, KretaClaimPackages.IsSzakiranyuOktatasertFelelos.ClaimValue)]
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public void StoreSelectedTanar([FromBody] int tanarID)
|
||||
{
|
||||
if (tanarID > 0)
|
||||
{
|
||||
HttpContext.Current.Application["tanarId"] = tanarID;
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public JsonResult<bool> ValidateTantargyFelosztasModify(TantargyFelosztasModositasaModel model)
|
||||
{
|
||||
var helper = new TantargyFelosztasHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
var result = helper.DuplicatedTantargyfelosztas(model.TanarId, model.CsoportID, model.TantargyId, model.Id);
|
||||
return Json(result);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public HttpResponseMessage SaveFelosztas(SaveFelosztasModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
var helper = new TantargyFelosztasHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
foreach (var item in model.felosztasok)
|
||||
{
|
||||
if (item?.CsoportID.HasValue == true && ((item.TantargyID.HasValue && item.Oraszam.HasValue) || (item.TantargyID.HasValue && model.IsFromSzervezet)))
|
||||
{
|
||||
helper.CreateOrUpdateFelosztas(new TantargyFelosztasCO
|
||||
{
|
||||
TanarID = model.tanarID,
|
||||
OsztalyCsoportID = item.CsoportID.Value,
|
||||
TantargyID = item.TantargyID.Value,
|
||||
Oraszam = item.Oraszam ?? 0,
|
||||
TuloraSzam = item.TuloraSzam ?? 0,
|
||||
OsszevontOra = item.OsszevontOra,
|
||||
NemzetisegiOra = item.NemzetisegiOra,
|
||||
MegbizasiOraszam = item.MegbizasiOraszam ?? 0
|
||||
},
|
||||
isFromSzervezet: model.IsFromSzervezet);
|
||||
}
|
||||
}
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
catch (BlException e)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public DataSourceResult GetTantargyFelosztasokFelvetel(string data, bool isFromSzervezet, [ModelBinder(typeof(ModelBinder.DataSourceRequestModelBinder))] DataSourceRequest request)
|
||||
{
|
||||
var model = JsonConvert.DeserializeObject<TantargyFelosztasFelveteleModel>(data);
|
||||
var dataSet = new DataSet();
|
||||
var dataTable = new DataTable();
|
||||
dataTable.Columns.Add("ID");
|
||||
dataTable.Columns.Add("OsztalyCsoport");
|
||||
dataTable.Columns.Add("OsztalyCsoportID");
|
||||
dataTable.Columns.Add("Tantargy");
|
||||
dataTable.Columns.Add("TantargyID");
|
||||
dataTable.Columns.Add("Oraszam");
|
||||
dataTable.Columns.Add("Tuloraszam");
|
||||
dataTable.Columns.Add("OsszevontOra");
|
||||
dataTable.Columns.Add("OsszevontOra_BNAME");
|
||||
dataTable.Columns.Add("NemzetisegiOra");
|
||||
dataTable.Columns.Add("NemzetisegiOra_BNAME");
|
||||
dataTable.Columns.Add("MegbizasiOraszam");
|
||||
dataTable.Columns.Add("Valid");
|
||||
|
||||
if (model.TanarId.HasValue)
|
||||
{
|
||||
DataSet tantargyfelosztasDataSet;
|
||||
var helper = new TantargyFelosztasHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
helper.GridParameters = Converter.GridParameter(request);
|
||||
tantargyfelosztasDataSet = helper.GetTantargyFelosztasData(model.TanarId, isFromSzervezet: isFromSzervezet);
|
||||
|
||||
foreach (DataRow dataRow in tantargyfelosztasDataSet.Tables[0].Rows)
|
||||
{
|
||||
dataTable.Rows.Add(
|
||||
dataRow["ID"],
|
||||
dataRow["OsztalyCsoport"],
|
||||
dataRow["OsztalyCsoportID"],
|
||||
dataRow["Tantargy"],
|
||||
dataRow["TantargyID"],
|
||||
dataRow["Oraszam"],
|
||||
dataRow["Tuloraszam"],
|
||||
dataRow["OsszevontOra"],
|
||||
dataRow["OsszevontOra_BNAME"],
|
||||
dataRow["NemzetisegiOra"],
|
||||
dataRow["NemzetisegiOra_BNAME"],
|
||||
dataRow["MegbizasiOraszam"],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
dataTable.Rows.Add(
|
||||
Guid.NewGuid(),
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
false,
|
||||
string.Empty,
|
||||
false,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
dataSet.Tables.Add(dataTable);
|
||||
return dataSet.ToDataSourceResult();
|
||||
}
|
||||
|
||||
public JsonResult<List<ComboBoxListItem>> GetTantargyakDD([DataSourceRequest] DataSourceRequest request)
|
||||
{
|
||||
var helper = new TantargyHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
var tantargyak = helper.GetTanarTantargyaiByTanevCsoportositva(isSzakkepzo: ClaimData.IsSzakkepzoIntezmeny);
|
||||
|
||||
var dropdownListItems = new List<ComboBoxListItem>();
|
||||
foreach (var row in tantargyak)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(row.Value))
|
||||
{
|
||||
var sli = new ComboBoxListItem()
|
||||
{
|
||||
Text = row.Text,
|
||||
Value = row.Value
|
||||
};
|
||||
dropdownListItems.Add(sli);
|
||||
}
|
||||
}
|
||||
|
||||
return Json(dropdownListItems);
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public HttpResponseMessage ModifyTantargyFelosztas(TantargyFelosztasModositasaModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (model.Oraszam < model.TuloraSzam)
|
||||
{
|
||||
ModelState.AddModelError("TuloraSzam", TantargyfelosztasResource.ATuloraNemLehetNagyobbMintAzOraszam);
|
||||
}
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
var connectionType = ConnectionTypeExtensions.GetSessionConnectionType();
|
||||
var helper = new TantargyFelosztasHelper(connectionType);
|
||||
var orarendiOraHelper = new OrarendiOraHelper(connectionType);
|
||||
|
||||
var eredetiTtf = helper.GetFoglalkozasById(model.Id);
|
||||
var tanarId = Convert.ToInt32(eredetiTtf.Tables[0].Rows[0]["TanarID"]);
|
||||
var tantargyId = Convert.ToInt32(eredetiTtf.Tables[0].Rows[0]["TantargyID"]);
|
||||
var osztalycsoportId = Convert.ToInt32(eredetiTtf.Tables[0].Rows[0]["OsztalyCsoportID"]);
|
||||
var ttfCo = new TantargyFelosztasVisszamenolegesCO
|
||||
{
|
||||
EredetiTanarId = tanarId,
|
||||
EredetiTantargyId = tantargyId,
|
||||
EredetiOsztalyCsoportId = osztalycsoportId,
|
||||
ModosultTanarId = model.TanarId,
|
||||
ModosultTantargyId = model.TantargyId,
|
||||
ModosultOsztalyCsoportId = model.CsoportID
|
||||
};
|
||||
|
||||
if (model.VisszamenolegesModositas)
|
||||
{
|
||||
if (tanarId != model.TanarId)
|
||||
{
|
||||
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, TantargyResource.VisszamenolegesModositasNemLehetHaTanar);
|
||||
}
|
||||
|
||||
if (!helper.ValidateTantargyfelosztasVisszamenolegesModositas(ttfCo, out var errorMessage))
|
||||
{
|
||||
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, errorMessage);
|
||||
}
|
||||
|
||||
if (tantargyId != model.TantargyId || osztalycsoportId != model.CsoportID)
|
||||
{
|
||||
helper.TantargyfelosztasVisszamenolegesModositas(ttfCo);
|
||||
|
||||
new TanuloErtekelesHelper(ConnectionTypeExtensions.GetSessionConnectionType()).AtlagUjraSzamitasVisszamenolegesModositasUtan(ttfCo);
|
||||
}
|
||||
}
|
||||
|
||||
if (model.KapcsolodoOrarendiOrakModositasa)
|
||||
{
|
||||
helper.UpdateOrarendiOraAfterTantargyfelosztasUpdate(ttfCo);
|
||||
}
|
||||
else if (tantargyId != model.TantargyId || osztalycsoportId != model.CsoportID)
|
||||
{
|
||||
helper.RemoveOrarendiOraTTFRelation(model.Id);
|
||||
}
|
||||
|
||||
helper.CreateOrUpdateFelosztas(new TantargyFelosztasCO
|
||||
{
|
||||
ID = model.Id,
|
||||
Oraszam = model.Oraszam,
|
||||
OsztalyCsoportID = model.CsoportID,
|
||||
TanarID = model.TanarId,
|
||||
TantargyID = model.TantargyId,
|
||||
FoglalkozasTipusa = model.TipusId,
|
||||
OsszevontOra = model.OsszevontOra,
|
||||
NemzetisegiOra = model.NemzetisegiOra,
|
||||
MegbizasiOraszam = model.MegbizasiOraszam,
|
||||
TuloraSzam = model.TuloraSzam
|
||||
});
|
||||
|
||||
if (tanarId != model.TanarId)
|
||||
{
|
||||
helper.HandleTanarValtozasOrarendiOrakon(model.Id);
|
||||
}
|
||||
|
||||
orarendiOraHelper.UpdateOrarend();
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
|
||||
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
|
||||
}
|
||||
catch (BlException e)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, e.Message);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ErrorResource.HibaTortentAMuveletSoran)
|
||||
{
|
||||
UnHandledException = e
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public JsonResult<string> ModifyTantargyFelosztasConfirmContent(TantargyFelosztasModositasaModel model)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
var helper = new TantargyFelosztasHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
var eredetiTtf = helper.GetFoglalkozasById(model.Id);
|
||||
var tanarId = Convert.ToInt32(eredetiTtf.Tables[0].Rows[0]["TanarID"]);
|
||||
var tantargyId = Convert.ToInt32(eredetiTtf.Tables[0].Rows[0]["TantargyID"]);
|
||||
var osztalycsoportId = Convert.ToInt32(eredetiTtf.Tables[0].Rows[0]["OsztalyCsoportID"]);
|
||||
|
||||
var ttfCo = new TantargyFelosztasVisszamenolegesCO
|
||||
{
|
||||
EredetiTanarId = tanarId,
|
||||
EredetiTantargyId = tantargyId,
|
||||
EredetiOsztalyCsoportId = osztalycsoportId,
|
||||
ModosultTanarId = model.TanarId,
|
||||
ModosultTantargyId = model.TantargyId,
|
||||
ModosultOsztalyCsoportId = model.CsoportID
|
||||
};
|
||||
|
||||
if (model.VisszamenolegesModositas)
|
||||
{
|
||||
sb.AppendFormat(TantargyResource.VisszamenolegesModositasFormat,
|
||||
model.TanorakSzama.ToString(), model.ErtekelesekSzama.ToString(), model.MulasztasokSzama.ToString()).AppendLine();
|
||||
if (model.TantargyId != tantargyId)
|
||||
{
|
||||
if (helper.GetEgyszerAdhatoErtekelesekTanatargyfelosztasModositasAlapjan(ttfCo).Count > 0)
|
||||
{
|
||||
sb.AppendLine(TantargyResource.MarLetezikEgyszerAdhatoErtekeles);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (model.KapcsolodoOrarendiOrakModositasa)
|
||||
{
|
||||
var m = helper.TantargyfelosztasbanValtozoOrarendiOrak(ttfCo);
|
||||
|
||||
if (m.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
sb.AppendLine(TantargyResource.AtirasraKerulOrarendiElemek);
|
||||
|
||||
foreach (var row in m.Tables[0].AsEnumerable())
|
||||
{
|
||||
var kezdete = DateTime.Parse(row["ErvenyessegKezdete"].ToString()).ToShortDateString();
|
||||
var vege = row["ErvenyessegVege"] != null ? DateTime.Parse(row["ErvenyessegVege"].ToString()).ToShortDateString() : string.Empty;
|
||||
sb.AppendFormat(TantargyResource.AtirasraKerulOrarendiElemekFormat,
|
||||
row["Hetirend"], row["Nap"], row["Ora"], kezdete, vege).AppendLine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendLine(TantargyResource.NincsModositandoOrarendiElem);
|
||||
}
|
||||
}
|
||||
|
||||
return Json(sb.ToString());
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public HttpResponseMessage DeleteTantargyFelosztas([FromBody] int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
var helper = new TantargyFelosztasHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
|
||||
helper.DeleteTargyFelosztas(id);
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
catch (Framework.Entities.EntityDeleteFailedException)
|
||||
{
|
||||
var uzenet = string.Format(StringResourcesUtil.GetString(5490), StringResourcesUtil.GetString(1621));
|
||||
throw new StatusError(HttpStatusCode.BadRequest, uzenet);
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public IHttpActionResult DeleteSelectedTantargyFelosztas(List<int> idList)
|
||||
{
|
||||
string errorMsg = string.Empty, entityName = string.Empty;
|
||||
var counter = 0;
|
||||
|
||||
var helper = new TantargyFelosztasHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
|
||||
foreach (var id in idList)
|
||||
{
|
||||
try
|
||||
{
|
||||
helper.DeleteTargyFelosztas(id);
|
||||
counter++;
|
||||
}
|
||||
catch (CannotBeDeletedException ex)
|
||||
{
|
||||
errorMsg += $"{ex.Message}{Environment.NewLine}";
|
||||
continue;
|
||||
}
|
||||
catch (EntityDeleteFailedException ex)
|
||||
{
|
||||
var errorMessage = string.Format(ErrorResource.NemTorolhetoKapcsolatMiatt, OrarendResource.Tantargyfelosztas, ex.ConnectionErrorMessage);
|
||||
|
||||
errorMsg += $"{errorMessage}{Environment.NewLine}{Environment.NewLine}";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(errorMsg))
|
||||
{
|
||||
return Json(new { Message = string.Format(ErrorResource.NSorTorlesSikeres, counter) });
|
||||
}
|
||||
|
||||
if (counter > 0)
|
||||
{
|
||||
errorMsg += Environment.NewLine + string.Format(ErrorResource.NSorTorlesSikeres, counter);
|
||||
}
|
||||
|
||||
throw new StatusError(HttpStatusCode.BadRequest, errorMsg);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Web.Attributes;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.ApiControllers
|
||||
{
|
||||
[ApiRoleClaimsAuthorize(true)]
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue, KretaClaimPackages.Dualis_Admin.ClaimValue, KretaClaimPackages.IsSzakiranyuOktatasertFelelos.ClaimValue)]
|
||||
[KretaGlobalLanguageChangeApiActionFilter(LanguageCode = "hu-Dualis")]
|
||||
public class DualisTantargyFelosztasApiController : BaseTantargyFelosztasApiController
|
||||
{
|
||||
}
|
||||
}
|
326
KretaWeb/Areas/Tantargy/ApiControllers/OraTervApiController.cs
Normal file
326
KretaWeb/Areas/Tantargy/ApiControllers/OraTervApiController.cs
Normal file
|
@ -0,0 +1,326 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.ModelBinding;
|
||||
using System.Web.Http.Results;
|
||||
using Kendo.Mvc.UI;
|
||||
using Kreta.BusinessLogic.Classes.ComboBox;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.BusinessLogic.Utils;
|
||||
using Kreta.Core.Exceptions;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Framework.Entities;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.Error;
|
||||
using Kreta.Web.Helpers.Grid;
|
||||
using Kreta.Web.Security;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.ApiControllers
|
||||
{
|
||||
[ApiRoleClaimsAuthorize(true)]
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class OraTervApiController : ApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Visszaadja a Grid result-ot (1 szint)
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public DataSourceResult GetOraTervGrid(string data, [ModelBinder(typeof(ModelBinder.DataSourceRequestModelBinder))] DataSourceRequest request)
|
||||
{
|
||||
OraTervSearchModel model = JsonConvert.DeserializeObject<OraTervSearchModel>(data);
|
||||
|
||||
OratervHelper helper = new OratervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
helper.GridParameters = Converter.GridParameter(request);
|
||||
OratervCO srcCO = Convert_SearchModel_to_CO(model);
|
||||
|
||||
var oraterv = helper.GetOraTerv(srcCO);
|
||||
return oraterv.ToDataSourceResult();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visszaadja a Grid result-ot (2 szint)
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public DataSourceResult GetOraTervDetailGrid(int oratervId, [ModelBinder(typeof(ModelBinder.DataSourceRequestModelBinder))] DataSourceRequest request)
|
||||
{
|
||||
OraTervModel model = new OraTervModel() { OratervId = oratervId };
|
||||
|
||||
OratervHelper helper = new OratervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
helper.GridParameters = Converter.GridParameter(request);
|
||||
OratervCO srcCO = Convert_Model_to_CO(model);
|
||||
|
||||
var oratervTantargy = helper.GetOratervTantargy(srcCO);
|
||||
return oratervTantargy.ToDataSourceResult();
|
||||
}
|
||||
|
||||
public int GetOraTervDetailCount(int oratervId)
|
||||
{
|
||||
OraTervModel model = new OraTervModel() { OratervId = oratervId };
|
||||
|
||||
OratervHelper helper = new OratervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
helper.GridParameters = null;
|
||||
OratervCO srcCO = Convert_Model_to_CO(model);
|
||||
return helper.GetOratervTantargy(srcCO).Tables[0].Rows.Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Menti egy ÓraTerv adatait
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public HttpResponseMessage SaveOraTervData(OraTervModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
if (model.OratervId.HasValue && model.OratervId > 0)
|
||||
{
|
||||
OratervCO co = Convert_Model_to_CO(model);
|
||||
OratervHelper helper = new OratervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
var expression = $"OratervId <> {model.OratervId.Value}";
|
||||
//Egyedi Nev validacio
|
||||
if (helper.GetOraTerv(new OratervCO { Nev = co.Nev, IsValidacio = true }).Tables[0].Select(expression).ToList().Any())
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ErrorResource.DuplikaltOraterv);
|
||||
|
||||
helper.UpdateOratervCO(co);
|
||||
}
|
||||
else
|
||||
{
|
||||
OratervCO co = Convert_Model_to_CO(model);
|
||||
OratervHelper helper = new OratervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
//Egyedi Nev validacio
|
||||
if (helper.GetOraTerv(new OratervCO { Nev = co.Nev, IsValidacio = true }).Tables[0].Rows.Count > 0)
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ErrorResource.DuplikaltOraterv);
|
||||
|
||||
helper.InsertOratervCO(co);
|
||||
}
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
|
||||
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tantárgy insert egy OraTervhez
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public HttpResponseMessage AddOraTervTargy(OraTervTargyModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (model.OratervTantargyId.HasValue && model.OratervTantargyId > 0)
|
||||
{
|
||||
OratervTantargyCO co = Convert_Model_to_CO(model);
|
||||
OratervHelper helper = new OratervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
helper.UpdateOratervTantargyCO(co, ClaimData.IsActivTanev);
|
||||
}
|
||||
else
|
||||
{
|
||||
OratervTantargyCO co = Convert_Model_to_CO(model);
|
||||
OratervHelper helper = new OratervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
helper.InsertOratervTantargyCO(co, ClaimData.IsActivTanev);
|
||||
}
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
catch (BlException exception)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, exception.Message);
|
||||
}
|
||||
}
|
||||
|
||||
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Töröl egy óratervet
|
||||
/// </summary>
|
||||
/// <param name="parameters"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public HttpResponseMessage DeleteOraTerv([FromBody] int oratervID)
|
||||
{
|
||||
if (ClaimData.SelectedTanevID == ClaimData.KovTanevID)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ErrorResource.OratervTorleseCsakAzAktualisTanevbenLehetseges);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
OratervHelper helper = new OratervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
if (helper.IfModifyOrDeleteOraTerv(oratervID))
|
||||
{
|
||||
helper.DeleteOratervCO(oratervID);
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ErrorResource.TorlesCsakAkkorLehetsegesHaAzOratervhezNincsRogzitveTantargy);
|
||||
|
||||
}
|
||||
catch (EntityDeleteFailedException ex)
|
||||
{
|
||||
var errorMessage = string.Format(ErrorResource.NemTorolhetoKapcsolatMiatt, TantargyResource.Oraterv, ex.ConnectionErrorMessage);
|
||||
|
||||
throw new StatusError(HttpStatusCode.BadRequest, errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Töröl egy óraterv tantárgyat
|
||||
/// </summary>
|
||||
/// <param name="parameters"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public HttpResponseMessage DeleteOraTervTantargy([FromBody] int tantargyID)
|
||||
{
|
||||
OratervHelper helper = new OratervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
helper.DeleteOratervTantargy(tantargyID);
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Törli az összes tantárgyat egy óratervhez
|
||||
/// </summary>
|
||||
/// <param name="parameters"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public HttpResponseMessage DeleteAllOraTervTantargy([FromBody] int id)
|
||||
{
|
||||
OratervHelper helper = new OratervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
helper.DeleteAllOratervTantargy(id);
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
|
||||
#region Helpers
|
||||
|
||||
public class ItemModel
|
||||
{
|
||||
public int Id { set; get; }
|
||||
}
|
||||
|
||||
private OratervCO Convert_Model_to_CO(OraTervModel model)
|
||||
{
|
||||
OratervCO co = new OratervCO()
|
||||
{
|
||||
OratervId = model.OratervId,
|
||||
TantervId = model.TantervId,
|
||||
Evfolyam = model.EvfolyamId ?? 0,
|
||||
Nev = model.Nev
|
||||
};
|
||||
return co;
|
||||
}
|
||||
|
||||
private OratervCO Convert_SearchModel_to_CO(OraTervSearchModel model)
|
||||
{
|
||||
OratervCO co = new OratervCO()
|
||||
{
|
||||
TantervId = model.TantervIdSearch,
|
||||
Evfolyam = model.EvfolyamIdSearch ?? 0,
|
||||
Nev = model.NevSearch
|
||||
};
|
||||
return co;
|
||||
}
|
||||
|
||||
private OratervTantargyCO Convert_Model_to_CO(OraTervTargyModel model)
|
||||
{
|
||||
OratervTantargyCO co = new OratervTantargyCO()
|
||||
{
|
||||
OratervId = model.OratervId,
|
||||
EvesOraszam = model.EvesOraszam.Value,
|
||||
Tantargy = model.TantargyId.Value,
|
||||
OratervTantargyId = model.OratervTantargyId
|
||||
};
|
||||
return co;
|
||||
}
|
||||
|
||||
private OraTervModel Convert_CO_to_Model(OratervCO co)
|
||||
{
|
||||
OraTervModel model = new OraTervModel()
|
||||
{
|
||||
OratervId = co.OratervId,
|
||||
TantervId = co.TantervId,
|
||||
EvfolyamId = co.Evfolyam,
|
||||
Nev = co.Nev
|
||||
};
|
||||
return model;
|
||||
}
|
||||
|
||||
private OraTervTargyModel Convert_TantargyCO_to_Model(OratervTantargyCO co)
|
||||
{
|
||||
OraTervTargyModel model = new OraTervTargyModel()
|
||||
{
|
||||
OratervId = co.OratervId,
|
||||
EvesOraszam = co.EvesOraszam,
|
||||
TantargyId = co.Tantargy
|
||||
};
|
||||
return model;
|
||||
}
|
||||
|
||||
public OraTervModel GetOraTervElem(int id)
|
||||
{
|
||||
OratervCO co;
|
||||
|
||||
var helper = new OratervHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
co = helper.GetOratervCO(id);
|
||||
|
||||
OraTervModel model = Convert_CO_to_Model(co);
|
||||
return model;
|
||||
}
|
||||
|
||||
public OraTervTargyModel GetOraTervTantargyElem(int id)
|
||||
{
|
||||
OratervTantargyCO co;
|
||||
|
||||
var helper = new OratervHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
co = helper.GetOratervTantargyCO(id);
|
||||
|
||||
OraTervTargyModel model = Convert_TantargyCO_to_Model(co);
|
||||
return model;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// NOTE: Kiszervezni -> GetTantervList ComboBoxHelperApi
|
||||
public JsonResult<List<ComboBoxListItem>> GetTantervList([DataSourceRequest] DataSourceRequest request)
|
||||
{
|
||||
var helper = new TantervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
var dictionary = helper.GetTanterv("");
|
||||
List<ComboBoxListItem> dropdownListItems = new List<ComboBoxListItem>();
|
||||
|
||||
foreach (var item in dictionary)
|
||||
{
|
||||
ComboBoxListItem sli = new ComboBoxListItem() { Text = item.Value, Value = item.Key };
|
||||
dropdownListItems.Add(sli);
|
||||
}
|
||||
return Json(dropdownListItems);
|
||||
}
|
||||
|
||||
public JsonResult<List<ComboBoxListItem>> GetEvfolyamList([DataSourceRequest] DataSourceRequest request)
|
||||
{
|
||||
List<ComboBoxListItem> items = ((int)GeneratedAdatszotarTipusEnum.EvfolyamTipus).GetItemsByType(ClaimData.SelectedTanevID.Value, true).ToComboBoxItemList();
|
||||
|
||||
return Json(items);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
namespace Kreta.Web.Areas.Tantargy.ApiControllers
|
||||
{
|
||||
public class TanmenetApiController : BaseTanmenetApiController
|
||||
{
|
||||
|
||||
}
|
||||
}
|
113
KretaWeb/Areas/Tantargy/ApiControllers/TanorakApiController.cs
Normal file
113
KretaWeb/Areas/Tantargy/ApiControllers/TanorakApiController.cs
Normal file
|
@ -0,0 +1,113 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.ModelBinding;
|
||||
using Kendo.Mvc.UI;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Logic;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Core;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.Error;
|
||||
using Kreta.Web.Helpers.Grid;
|
||||
using Kreta.Web.Security;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.ApiControllers
|
||||
{
|
||||
[ApiRoleClaimsAuthorize(true)]
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Naplo.ClaimValue)]
|
||||
public class TanorakApiController : ApiController
|
||||
{
|
||||
public DataSourceResult GetTanorakGrid(string data, [ModelBinder(typeof(ModelBinder.DataSourceRequestModelBinder))] DataSourceRequest request)
|
||||
{
|
||||
TanorakSearchModel model = JsonConvert.DeserializeObject<TanorakSearchModel>(data);
|
||||
|
||||
var helper = new TanoraHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
helper.GridParameters = Converter.GridParameter(request);
|
||||
|
||||
var ret = helper.GetTanorak(ConvertTanorakSearchModelToTanorakSearchCO(model));
|
||||
|
||||
return ret.ToDataSourceResult();
|
||||
}
|
||||
|
||||
public DataSourceResult GetTanorakGridForNaplozas(int osztalyCsoportId, int tantargyId, DateTime oraKezdete, DataSourceRequest request)
|
||||
{
|
||||
var model = new TanorakSearchModel
|
||||
{
|
||||
OsztalyCsoportId = osztalyCsoportId,
|
||||
TantargyId = tantargyId,
|
||||
OraKezdete = oraKezdete
|
||||
};
|
||||
|
||||
var (gridParameter, modelList) = GetGridData(model, request);
|
||||
|
||||
return modelList.ToDataSourceResult(gridParameter);
|
||||
}
|
||||
|
||||
public HttpResponseMessage GetExport(int osztalyCsoportId, int tantargyId, DataSourceRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
var model = new TanorakSearchModel
|
||||
{
|
||||
OsztalyCsoportId = osztalyCsoportId,
|
||||
TantargyId = tantargyId
|
||||
};
|
||||
|
||||
var (gridParameter, modelList) = GetGridData(model, request);
|
||||
|
||||
modelList = modelList.SortingAndPaging(gridParameter.OrderDictionary);
|
||||
|
||||
var simpleExportColumnCos = SimpleExportLogic.GetSimpleExportColumnCos<TanorakGridModel>(TanorakGridModel.TanorakExportAttributeId);
|
||||
|
||||
var memoryStream = SimpleExportLogic.GetExport(OrarendResource.KorabbiOrakNaplozasiAdataiExportSheetName, simpleExportColumnCos, modelList, ClaimData.SelectedTanevID.Value);
|
||||
|
||||
return HttpResponseExtensions.GetFileHttpResponse(memoryStream.ToArray(), $"{OrarendResource.KorabbiOrakNaplozasiAdatai_Export}_{DateTime.Now:yyyy_MM_dd}.xlsx");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ErrorResource.HibaTortentAFajlExportalasaKozben) { UnHandledException = ex };
|
||||
}
|
||||
}
|
||||
|
||||
private (GridParameters gridParameter, List<TanorakGridModel> modelList) GetGridData(TanorakSearchModel model, DataSourceRequest request)
|
||||
{
|
||||
var gridParameter = Converter.GridParameter(request);
|
||||
|
||||
var coList = new TanoraHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetTanorakGridForNaplozasCoList(ConvertTanorakSearchModelToTanorakSearchCO(model));
|
||||
|
||||
var modelList = new List<TanorakGridModel>();
|
||||
foreach (var co in coList)
|
||||
{
|
||||
var gridModel = new TanorakGridModel(co);
|
||||
modelList.Add(gridModel);
|
||||
}
|
||||
|
||||
return (gridParameter, modelList);
|
||||
}
|
||||
|
||||
private TanorakSearchCO ConvertTanorakSearchModelToTanorakSearchCO(TanorakSearchModel model)
|
||||
{
|
||||
TanorakSearchCO co = new TanorakSearchCO
|
||||
{
|
||||
IdoszakKezdete = model.IdoszakKezdete,
|
||||
IdoszakVege = model.IdoszakVege,
|
||||
OsztalyCsoportId = model.OsztalyCsoportId,
|
||||
Helyetesitett = model.Helyetesitett,
|
||||
TantargyId = model.TantargyId,
|
||||
TanarId = model.TanarId,
|
||||
OraKezdete = model.OraKezdete,
|
||||
};
|
||||
|
||||
return co;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Results;
|
||||
using Kendo.Mvc.UI;
|
||||
using Kreta.BusinessLogic.Classes.ComboBox;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.BusinessLogic.Utils;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.Error;
|
||||
using Kreta.Web.Security;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.ApiControllers
|
||||
{
|
||||
[ApiRoleClaimsAuthorize(true)]
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class TantargyFelosztasApiController : BaseTantargyFelosztasApiController
|
||||
{
|
||||
[HttpGet]
|
||||
public HttpResponseMessage ExportLepedoOsztalyTantargyfelosztas(string data, bool isFromSzervezet = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var model = JsonConvert.DeserializeObject<TantargyFelosztasModel>(data);
|
||||
|
||||
var memoryStream = new BusinessLogic.Classes.ExcelHelpers.TTFExportHelper(ConnectionTypeExtensions.GetSessionConnectionType()).ExportLepedoOsztalyTTF(model.SearchTanar, model.SearchOsztalCsoport, model.SearchTantargy, targyKatId: null, evfolyamId: model.SearchEvfolyam, foglalkozasTipusId: model.SearchFoglalkozasTipusa, feladatKategoriaId: model.SearchFeladatKategoriaId, feladatellatasiHelyId: model.SearchFeladatellatasihely, oraszam: model.SearchOraszam, isImportalt: null, osztalybontasokkal: model.Osztalybontasokkal, kapcsolodoCsoportokkal: model.KapcsolodoCsoportokkal, isFromSzervezet: model.IsFromSzervezet);
|
||||
|
||||
return HttpResponseExtensions.GetFileHttpResponse(memoryStream.ToArray(), $"{ClaimData.IntezmenyAzonosito}_{TantargyResource.Tantargyfelosztas_Export}_{DateTime.Now:yyyy_MM_dd}.xlsx");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ErrorResource.HibaTortentAFajlExportalasaKozben) { UnHandledException = ex };
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public HttpResponseMessage ExportLepedoTantargyfelosztas(string data)
|
||||
{
|
||||
try
|
||||
{
|
||||
var model = JsonConvert.DeserializeObject<TantargyFelosztasModel>(data);
|
||||
|
||||
var memoryStream = new BusinessLogic.Classes.ExcelHelpers.TTFExportHelper(ConnectionTypeExtensions.GetSessionConnectionType()).ExportLepedoTTF(model.SearchTanar, model.SearchOsztalCsoport, model.SearchTantargy, targyKatId: null, evfolyamId: model.SearchEvfolyam, foglalkozasTipusId: model.SearchFoglalkozasTipusa, feladatKategoriaId: model.SearchFeladatKategoriaId, feladatellatasiHelyId: model.SearchFeladatellatasihely, oraszam: model.SearchOraszam, isImportalt: null, osztalybontasokkal: model.Osztalybontasokkal, kapcsolodoCsoportokkal: model.KapcsolodoCsoportokkal, isFromSzervezet: model.IsFromSzervezet);
|
||||
|
||||
return HttpResponseExtensions.GetFileHttpResponse(memoryStream.ToArray(), $"{ClaimData.IntezmenyAzonosito}_{TantargyResource.Tantargyfelosztas_Export}_{DateTime.Now:yyyy_MM_dd}.xlsx");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ErrorResource.HibaTortentAFajlExportalasaKozben) { UnHandledException = ex };
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public HttpResponseMessage ExportEgyszeruTantargyfelosztas(string data)
|
||||
{
|
||||
try
|
||||
{
|
||||
var model = JsonConvert.DeserializeObject<TantargyFelosztasModel>(data);
|
||||
|
||||
var memoryStream = new BusinessLogic.Classes.ExcelHelpers.TTFExportHelper(ConnectionTypeExtensions.GetSessionConnectionType()).ExportEgyszeruTTF(model.SearchTanar, model.SearchOsztalCsoport, model.SearchTantargy, targyKatId: null, evfolyamId: model.SearchEvfolyam, foglalkozasTipusId: model.SearchFoglalkozasTipusa, feladatKategoriaId: model.SearchFeladatKategoriaId, feladatellatasiHelyId: model.SearchFeladatellatasihely, oraszam: model.SearchOraszam, isImportalt: null, osztalybontasokkal: model.Osztalybontasokkal, kapcsolodoCsoportokkal: model.KapcsolodoCsoportokkal, isFromSzervezet: model.IsFromSzervezet);
|
||||
|
||||
return HttpResponseExtensions.GetFileHttpResponse(memoryStream.ToArray(), $"{ClaimData.IntezmenyAzonosito}_{TantargyResource.Tantargyfelosztas_Export}_{DateTime.Now:yyyy_MM_dd}.xlsx");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ErrorResource.HibaTortentAFajlExportalasaKozben) { UnHandledException = ex };
|
||||
}
|
||||
}
|
||||
|
||||
public IntezmenyCO GetIntezmenyAdatok() => new IntezmenyHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetIntezmenyiAdatok();
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public JsonResult<List<ComboBoxListItem>> GetEvfolyamok([DataSourceRequest] DataSourceRequest request)
|
||||
{
|
||||
List<ComboBoxListItem> items = ((int)GeneratedAdatszotarTipusEnum.EvfolyamTipus).GetItemsByType(ClaimData.SelectedTanevID.Value, true).ToComboBoxItemList();
|
||||
|
||||
return Json(items);
|
||||
}
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public JsonResult<List<ComboBoxListItem>> GetFoglalkozasTipusok([DataSourceRequest] DataSourceRequest request)
|
||||
{
|
||||
List<ComboBoxListItem> items = ((int)GeneratedAdatszotarTipusEnum.FoglalkozasTipus).GetItemsByType(ClaimData.SelectedTanevID.Value, true).ToComboBoxItemList();
|
||||
|
||||
return Json(items);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,414 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.ModelBinding;
|
||||
using System.Web.Http.Results;
|
||||
using Kendo.Mvc.UI;
|
||||
using Kreta.BusinessLogic.Classes.ComboBox;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Logic;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.BusinessLogic.Utils;
|
||||
using Kreta.Core;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Framework.Entities;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Areas.TanuloErtekeles.Models.TanuloErtekeles;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.Error;
|
||||
using Kreta.Web.Helpers.Grid;
|
||||
using Kreta.Web.Security;
|
||||
using Newtonsoft.Json;
|
||||
using SDA.DataProvider;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.ApiControllers
|
||||
{
|
||||
[ApiRoleClaimsAuthorize(true)]
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class TantargyakApiController : ApiController
|
||||
{
|
||||
public bool IsDualisKepzesEnabled => new IntezmenyConfigHelper(ConnectionTypeExtensions.GetSystemConnectionType()).GetIntezmenyConfig<bool>(IntezmenyConfigModulEnum.DualisKepzes, IntezmenyConfigTipusEnum.IsEnabled);
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public DataSourceResult GetTantargyakGrid(string data, DataSourceRequest request)
|
||||
{
|
||||
var (gridParameter, modelList) = GetGridData(data, request, IsDualisKepzesEnabled);
|
||||
|
||||
return modelList.ToDataSourceResult(gridParameter);
|
||||
}
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public HttpResponseMessage GetExport(string data, DataSourceRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
var (gridParameter, modelList) = GetGridData(data, request, IsDualisKepzesEnabled);
|
||||
|
||||
modelList = modelList.SortingAndPaging(gridParameter.OrderDictionary);
|
||||
|
||||
var simpleExportColumnCos = SimpleExportLogic.GetSimpleExportColumnCos<TantargyakGridModel>(TantargyakGridModel.TantargyakExportAttributeId);
|
||||
|
||||
var memoryStream = SimpleExportLogic.GetExport(TantargyResource.ExportSheetName, simpleExportColumnCos, modelList, ClaimData.SelectedTanevID.Value);
|
||||
|
||||
return HttpResponseExtensions.GetFileHttpResponse(memoryStream.ToArray(), $"{TantargyResource.Tantargyak_Export}_{DateTime.Now:yyyy_MM_dd}.xlsx");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ErrorResource.HibaTortentAFajlExportalasaKozben) { UnHandledException = ex };
|
||||
}
|
||||
}
|
||||
|
||||
private (GridParameters gridParameter, List<TantargyakGridModel> modelList) GetGridData(string data, DataSourceRequest request, bool isFromSzervezet)
|
||||
{
|
||||
var model = JsonConvert.DeserializeObject<TantargySearchModel>(data);
|
||||
model.IsFromSzervezet = isFromSzervezet;
|
||||
model.IsSzakkepzo = ClaimData.IsSzakkepzoIntezmeny;
|
||||
|
||||
var gridParameter = Converter.GridParameter(request);
|
||||
|
||||
var coList = new TantargyHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetTantargyCoList(model.ConvertToCo());
|
||||
|
||||
var modelList = new List<TantargyakGridModel>();
|
||||
foreach (var co in coList)
|
||||
{
|
||||
var gridModel = new TantargyakGridModel(co);
|
||||
modelList.Add(gridModel);
|
||||
}
|
||||
|
||||
return (gridParameter, modelList);
|
||||
}
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public DataSourceResult GetTantargyFoglalkozasaiGrid(int tantargyID, [ModelBinder(typeof(ModelBinder.DataSourceRequestModelBinder))] DataSourceRequest request)
|
||||
{
|
||||
var fhelper = new TantargyFelosztasHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
fhelper.GridParameters = Converter.GridParameter(request);
|
||||
var foglalkozasok = fhelper.GetTantargyFoglalkozasai(tantargyID);
|
||||
return foglalkozasok.ToDataSourceResult();
|
||||
}
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public DataSourceResult GetTantargyOrarendiOraiGrid(int tantargyID, [ModelBinder(typeof(ModelBinder.DataSourceRequestModelBinder))] DataSourceRequest request)
|
||||
{
|
||||
var ohelper = new OrarendiOraHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
ohelper.GridParameters = Converter.GridParameter(request);
|
||||
var orarendiorak = ohelper.GetOrarendiOrakByTantargyId(tantargyID);
|
||||
return orarendiorak.ToDataSourceResult();
|
||||
}
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public DataSourceResult GetTantargyTanmeneteiGrid(int tantargyID, [ModelBinder(typeof(ModelBinder.DataSourceRequestModelBinder))] DataSourceRequest request)
|
||||
{
|
||||
var thelper = new TanmenetHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
thelper.GridParameters = Converter.GridParameter(request);
|
||||
var tanmenetek = thelper.GetTantargyTanmenetei(tantargyID);
|
||||
return tanmenetek.ToDataSourceResult();
|
||||
}
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public DataSourceResult GetTantargyMegtartottTanoraiGrid(int tantargyID, [ModelBinder(typeof(ModelBinder.DataSourceRequestModelBinder))] DataSourceRequest request)
|
||||
{
|
||||
var thelper = new TanoraHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
thelper.GridParameters = Converter.GridParameter(request);
|
||||
var tanmenetek = thelper.GetTantargyMegtartottTanorai(tantargyID);
|
||||
return tanmenetek.ToDataSourceResult();
|
||||
}
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public DataSourceResult GetTantargyErtekelesListGrid(int tantargyId, [ModelBinder(typeof(ModelBinder.DataSourceRequestModelBinder))] DataSourceRequest request)
|
||||
{
|
||||
var helper = new TanuloErtekelesHelper(ConnectionTypeExtensions.GetSessionConnectionType())
|
||||
{
|
||||
GridParameters = Converter.GridParameter(request)
|
||||
};
|
||||
|
||||
var tanuloErtekelesListModel = new TanuloErtekelesListModel
|
||||
{
|
||||
TantargyIdSearch = tantargyId,
|
||||
FeladatKategoriaIdSearch = Constants.MindenErteke.FeladatKategoria
|
||||
};
|
||||
DataSet dataSet = helper.GetTanuloErtekelesListGridDataSet(tanuloErtekelesListModel.ToCo());
|
||||
|
||||
return dataSet.ToDataSourceResult();
|
||||
}
|
||||
|
||||
public HttpResponseMessage SaveModifiedOrNewTantargy(TantargyModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
ValidateModel(model);
|
||||
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
TantargyHelper h = new TantargyHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
TantargyCO co = Convert_Model_to_CO(model);
|
||||
|
||||
h.SaveOrUpdateTantargy(co);
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
|
||||
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
|
||||
}
|
||||
catch (UniqueKeyViolationException)
|
||||
{
|
||||
/*Már létezik ilyen nevű tantárgy*/
|
||||
StatusError error = new StatusError(HttpStatusCode.BadRequest, StringResourcesUtils.GetString(4850));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
public HttpResponseMessage SaveModTantargy(TantargyModModel model)
|
||||
{
|
||||
bool? isFoTargyE = default;
|
||||
if (model.IsFoTargy.HasValue)
|
||||
{
|
||||
isFoTargyE = model.IsFoTargy > 0;
|
||||
}
|
||||
|
||||
bool? isGyakorlatiTargy = default;
|
||||
if (model.GyakorlatiTargy.HasValue)
|
||||
{ isGyakorlatiTargy = model.GyakorlatiTargy > 0; }
|
||||
|
||||
bool? isAmiTargy = default;
|
||||
if (model.IsAmiTargyMod.HasValue)
|
||||
{ isAmiTargy = model.IsAmiTargyMod > 0; }
|
||||
|
||||
bool? isMszgTargy = default;
|
||||
if (model.IsMszgTargyMod.HasValue)
|
||||
{ isMszgTargy = model.IsMszgTargyMod > 0; }
|
||||
|
||||
bool? isKollegiumiTargy = default;
|
||||
if (model.IsKollegiumiTargy.HasValue)
|
||||
{ isKollegiumiTargy = model.IsKollegiumiTargy > 0; }
|
||||
|
||||
bool? isFelnottoktatasTargy = default;
|
||||
if (model.IsFelnottOktatasTargy.HasValue)
|
||||
{ isFelnottoktatasTargy = model.IsFelnottOktatasTargy > 0; }
|
||||
|
||||
bool? isNincsBeloleOra = default;
|
||||
if (model.IsNincsBeloleOraMod.HasValue)
|
||||
{ isNincsBeloleOra = model.IsNincsBeloleOraMod > 0; }
|
||||
|
||||
bool? isEgymiTargy = default;
|
||||
if (model.IsEgymiTargyMod.HasValue)
|
||||
{ isEgymiTargy = model.IsEgymiTargyMod > 0; }
|
||||
|
||||
int? sorszam = model.Sorszam;
|
||||
|
||||
bool? isAltantargyNyomtatvanyban = default;
|
||||
if (model.AltantargyNyomtatvanyban.HasValue)
|
||||
{ isAltantargyNyomtatvanyban = model.AltantargyNyomtatvanyban > 0; }
|
||||
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(model.TantargyakIDArray))
|
||||
{
|
||||
var h = new TantargyHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
var co = new TantargyTobbesModositasCO(model.ID.Value, model.TargyKategoria, model.ESLTargyKategoria, isFoTargyE, isGyakorlatiTargy, isAltantargyNyomtatvanyban, model.FoTargyID, sorszam, isAmiTargy, isMszgTargy, isKollegiumiTargy, isFelnottoktatasTargy, isEgymiTargy, isNincsBeloleOra);
|
||||
h.TantargyTobbesModify(co);
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] tantargyIDArray = model.TantargyakIDArray.Split(',');
|
||||
|
||||
var h = new TantargyHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
foreach (var item in tantargyIDArray)
|
||||
{
|
||||
var co = new TantargyTobbesModositasCO(int.Parse(item), model.TargyKategoria, model.ESLTargyKategoria, isFoTargyE, isGyakorlatiTargy, isAltantargyNyomtatvanyban, model.FoTargyID, sorszam, isAmiTargy, isMszgTargy, isKollegiumiTargy, isFelnottoktatasTargy, isEgymiTargy, isNincsBeloleOra);
|
||||
h.TantargyTobbesModify(co);
|
||||
}
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
}
|
||||
|
||||
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
|
||||
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public HttpResponseMessage DeleteTantargy([FromBody] int tantargyID)
|
||||
{
|
||||
try
|
||||
{
|
||||
TantargyHelper h = new TantargyHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
h.DeleteTantargyById(tantargyID);
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
catch (EntityDeleteFailedException ex)
|
||||
{
|
||||
var uzenet = string.Format(ErrorResource.NemTorolhetoKapcsolatMiatt, TantargyResource.Tantargy, ex.ConnectionErrorMessage);
|
||||
throw new StatusError(HttpStatusCode.BadRequest, uzenet);
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public IHttpActionResult DeleteSelectedTantargy(List<int> idList)
|
||||
{
|
||||
var connectionType = ConnectionTypeExtensions.GetSessionConnectionType();
|
||||
var h = new TantargyHelper(connectionType);
|
||||
|
||||
var errorMsg = string.Empty;
|
||||
var counter = 0;
|
||||
foreach (var id in idList)
|
||||
{
|
||||
try
|
||||
{
|
||||
h.DeleteTantargyById(id, false);
|
||||
counter++;
|
||||
}
|
||||
catch (EntityDeleteFailedException ex)
|
||||
{
|
||||
var tantargyNev = h.GetTantargyById(id).TantargyNev;
|
||||
var errorMessage = string.Format(ErrorResource.NemTorolhetoKapcsolatMiatt, tantargyNev, ex.ConnectionErrorMessage);
|
||||
|
||||
errorMsg += $"{errorMessage}{Environment.NewLine}{Environment.NewLine}";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (idList.Any())
|
||||
{
|
||||
new TanoraHelper(connectionType).UpdateTanitasiOraEvesSorszamTeljesTanev();
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(errorMsg))
|
||||
{
|
||||
return Json(new { Message = string.Format(ErrorResource.NSorTorlesSikeres, counter) });
|
||||
}
|
||||
|
||||
if (counter > 0)
|
||||
{
|
||||
errorMsg += Environment.NewLine + string.Format(ErrorResource.NSorTorlesSikeres, counter);
|
||||
}
|
||||
throw new StatusError(HttpStatusCode.BadRequest, errorMsg);
|
||||
}
|
||||
|
||||
private TantargyCO Convert_Model_to_CO(TantargyModel model)
|
||||
{
|
||||
TantargyCO co = new TantargyCO
|
||||
{
|
||||
AltantargyNyomtatvanyban = model.AltantargyNyomtatvanyban,
|
||||
FoTargyID = model.FoTargyID,
|
||||
FoTargyNev = model.FoTargyNev,
|
||||
GyakorlatiTargy = model.GyakorlatiTargy,
|
||||
ID = model.ID,
|
||||
isFoTargy = model.IsFoTargy,
|
||||
NevNyomtatvanyban = model.NevNyomtatvanyban,
|
||||
TantargyNev = model.TantargyNev,
|
||||
TantargyRovidNev = model.TantargyRovidNev,
|
||||
TargyKategoria = model.TargyKategoria,
|
||||
TargyKategoriaNev = model.TargyKategoriaNev,
|
||||
ESLTantargykategoria = model.ESLTargyKategoria,
|
||||
ESLTantargykategoriaNev = model.ESLTargyKategoriaNev,
|
||||
TantargyAngolNev = model.TantargyAngolNev,
|
||||
TantargyNemetNev = model.TantargyNemetNev,
|
||||
TantargyHorvatNev = model.TantargyHorvatNev,
|
||||
TantargyRomanNev = model.TantargyRomanNev,
|
||||
TantargySzerbNev = model.TantargySzerbNev,
|
||||
Sorszam = model.Sorszam,
|
||||
Megjegyzes = model.Megjegyzes,
|
||||
Gyakorlatigenyesseg = model.Gyakorlatigenyesseg,
|
||||
IsAmiTargy = model.IsAmiTargyMod,
|
||||
IsKollegiumiTargy = model.IsKollegiumiTargy,
|
||||
IsFelnottOktatasTargy = model.IsFelnottOktatas,
|
||||
IsNincsBeloleOra = model.IsNincsBeloleOraMod,
|
||||
IsEgymiTargy = model.IsEgymi,
|
||||
IsTanulmanyiAtlagbaNemSzamit = model.IsTanulmanyiAtlagbaNemSzamit,
|
||||
IsOsztalynaplobanNemJelenikMeg = model.IsOsztalynaplobanNemJelenikMeg,
|
||||
IsOsztalyokOrarendjebenMegjelenik = model.IsOsztalyOrarendjebenMegjelenik,
|
||||
IsMszgTargy = model.IsMszgTargy,
|
||||
MufajTipusId = model.AmiKepzesiJellemzokModel.MufajTipusId,
|
||||
TanszakTipusId = model.AmiKepzesiJellemzokModel.TanszakTipusId,
|
||||
MuveszetiAgId = model.AmiKepzesiJellemzokModel.MuveszetiAgId
|
||||
};
|
||||
|
||||
co.SetErtekelesKorlatozasok(model.ErtekelesKorlatozasIdList);
|
||||
|
||||
return co;
|
||||
}
|
||||
|
||||
public JsonResult<List<ComboBoxListItem>> GetFotargyakList([DataSourceRequest] DataSourceRequest request)
|
||||
{
|
||||
var helper = new TantargyHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
var dictionary = helper.GetFotargyak();
|
||||
List<ComboBoxListItem> dropdownListItems = new List<ComboBoxListItem>();
|
||||
|
||||
foreach (var item in dictionary)
|
||||
{
|
||||
ComboBoxListItem sli = new ComboBoxListItem() { Text = item.Value, Value = item.Key };
|
||||
dropdownListItems.Add(sli);
|
||||
}
|
||||
return Json(dropdownListItems);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public IHttpActionResult GetFotargyakhozTartozikAltargy(List<int> tantargyIdList)
|
||||
{
|
||||
if (tantargyIdList.Any())
|
||||
{
|
||||
TantargyHelper h = new TantargyHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
List<string> errorList = h.GetFotargyhozTartozikAltargy(tantargyIdList);
|
||||
string errorMsg = string.Empty, entityName = string.Empty;
|
||||
if (errorList.Any())
|
||||
{
|
||||
errorMsg += $"{TantargyResource.AFotargyNemAllithatoAltarggyaMivelTartozikHozzaAltantargy}{Environment.NewLine}{string.Join(Environment.NewLine + " ", errorList)}";
|
||||
throw new StatusError(HttpStatusCode.BadRequest, errorMsg);
|
||||
}
|
||||
|
||||
}
|
||||
return Json(new { Text = "" });
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public IHttpActionResult GetSzorgalomElegtelenTantargyList(List<int> tantargyIdList)
|
||||
{
|
||||
TantargyHelper h = new TantargyHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
var tantargyList = h.GetTantargyakEgyesErtekelessel(tantargyIdList);
|
||||
|
||||
return Json(JsonConvert.SerializeObject(tantargyList));
|
||||
}
|
||||
|
||||
private void ValidateModel(TantargyModel model)
|
||||
{
|
||||
if (model.IsAmiTargyMod && model.IsMszgTargy)
|
||||
{
|
||||
ModelState.AddModelError(nameof(model.IsAmiTargyMod), TantargyResource.AmiMszgTargyValidacioHiba);
|
||||
}
|
||||
|
||||
if (model.TantargyNev == TantargyResource.DualisKepzes)
|
||||
{
|
||||
ModelState.AddModelError(nameof(model.TantargyNev), TantargyResource.DualisKepzesTantargyNemModosithatoMertVedettElem);
|
||||
}
|
||||
else if (model.TantargyNev == TantargyResource.ApaczaiKonzultacio)
|
||||
{
|
||||
ModelState.AddModelError(nameof(model.TantargyNev), TantargyResource.ApaczaiKonzultacioTantargyNemModosithatoMertVedettElem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
265
KretaWeb/Areas/Tantargy/ApiControllers/TantervekApiController.cs
Normal file
265
KretaWeb/Areas/Tantargy/ApiControllers/TantervekApiController.cs
Normal file
|
@ -0,0 +1,265 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.ModelBinding;
|
||||
using Kendo.Mvc.UI;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.BusinessLogic.Classes.ComboBox;
|
||||
using Kreta.BusinessLogic.Exceptions;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.BusinessLogic.Utils;
|
||||
using Kreta.Core;
|
||||
using Kreta.Core.Exceptions;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Framework;
|
||||
using Kreta.Framework.Entities;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.Error;
|
||||
using Kreta.Web.Helpers.Grid;
|
||||
using Kreta.Web.Security;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.ApiControllers
|
||||
{
|
||||
[ApiRoleClaimsAuthorize(true)]
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class TantervekApiController : ApiController
|
||||
{
|
||||
public DataSourceResult GetTantervekGrid(string data, [ModelBinder(typeof(ModelBinder.DataSourceRequestModelBinder))] DataSourceRequest request)
|
||||
{
|
||||
TantervSearchModel model = JsonConvert.DeserializeObject<TantervSearchModel>(data);
|
||||
|
||||
TantervHelper helper = new TantervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
helper.GridParameters = Converter.GridParameter(request);
|
||||
var tantervek = helper.TantervKereses(model.TantervNev, model.JellemzoCsopTipID, model.KezdoEvfolyamID, model.VegzoEvfolyamID, model.IsKerettantervreEpul, model.IsKerettantervSrc);
|
||||
return tantervek.ToDataSourceResult();
|
||||
}
|
||||
|
||||
public TantervModel GetTantervProperties(int tantervID)
|
||||
{
|
||||
TantervCO co;
|
||||
|
||||
TantervHelper thelper = new TantervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
co = thelper.GetCo(tantervID);
|
||||
|
||||
return ConvertCOtoModel(co);
|
||||
}
|
||||
|
||||
public TantervModModel GetTantervPropertiesMod(int tantervID)
|
||||
{
|
||||
TantervHelper thelper = new TantervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
TantervCO co = thelper.GetCo(tantervID);
|
||||
TantervModModel model = new TantervModModel()
|
||||
{
|
||||
ID = co.ID,
|
||||
Nev = co.Nev,
|
||||
CsoportTipusa = co.CsoportTipusa,
|
||||
Evfolyamtol = co.Evfolyamtol,
|
||||
Evfolyamig = co.Evfolyamig,
|
||||
KerettantervreEpulo = co.KerettantervreEpulo.ToNullableInt(),
|
||||
IsKerettanterv = co.IsKerettanterv.ToNullableInt()
|
||||
};
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
public DataSourceResult GetTantervOSztalyai(string tantervID, [ModelBinder(typeof(ModelBinder.DataSourceRequestModelBinder))] DataSourceRequest request)
|
||||
{
|
||||
var helper = new TantervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
helper.GridParameters = Converter.GridParameter(request);
|
||||
|
||||
var ds = helper.GetTantervOsztalyai(SDAConvert.ToInt32(tantervID));
|
||||
|
||||
return ds.ToDataSourceResult();
|
||||
}
|
||||
|
||||
public DataSourceResult GetTantervTanuloi(string tantervID, [ModelBinder(typeof(ModelBinder.DataSourceRequestModelBinder))] DataSourceRequest request)
|
||||
{
|
||||
var helper = new TantervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
helper.GridParameters = Converter.GridParameter(request);
|
||||
|
||||
var ds = helper.GetTantervTanuloi(SDAConvert.ToInt32(tantervID));
|
||||
|
||||
return ds.ToDataSourceResult();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public HttpResponseMessage SaveModifiedOrNewTanterv(TantervModel tmodel)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
TantervCO co = ConvertModelToCO(tmodel);
|
||||
TantervHelper helper = new TantervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
if (co.ID.HasValue)
|
||||
{
|
||||
helper.Update(co);
|
||||
}
|
||||
else
|
||||
{
|
||||
helper.Insert(co);
|
||||
}
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
|
||||
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
|
||||
}
|
||||
catch (SDA.DataProvider.SDADataProviderException ex)
|
||||
{
|
||||
if (ex.Error == SDA.DataProvider.SDADataProviderError.UniqueKeyViolation)
|
||||
{
|
||||
string msg = string.Format(StringResourcesUtil.GetString(3554), StringResourcesUtil.GetString(1589 /*Tanterv neve*/));
|
||||
ModelState.AddModelError("Nev", msg);
|
||||
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
|
||||
}
|
||||
|
||||
throw;
|
||||
|
||||
}
|
||||
catch (CannotBeInsertedException e)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public HttpResponseMessage SaveModTanterv(TantervModModel tmodel)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
var co = ConvertModModelToCO(tmodel);
|
||||
var helper = new TantervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
if (string.IsNullOrWhiteSpace(tmodel.TantervIDArray))
|
||||
{
|
||||
helper.TantervTobbesModify(co);
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] tantervIDArray = tmodel.TantervIDArray.Split(',');
|
||||
foreach (var item in tantervIDArray)
|
||||
{
|
||||
co.ID = int.Parse(item);
|
||||
helper.TantervTobbesModify(co);
|
||||
}
|
||||
}
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
|
||||
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
|
||||
}
|
||||
catch (CannotBeInsertedException e)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, e.Message);
|
||||
}
|
||||
catch (BlException e)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private TantervTobbesModCO ConvertModModelToCO(TantervModModel model)
|
||||
{
|
||||
return new TantervTobbesModCO()
|
||||
{
|
||||
ID = model.ID,
|
||||
CsoportTipusa = model.CsoportTipusa,
|
||||
Evfolyamig = model.Evfolyamig,
|
||||
Evfolyamtol = model.Evfolyamtol,
|
||||
KerettantervreEpulo = model.KerettantervreEpulo,
|
||||
IsKerettanterv = model.IsKerettanterv
|
||||
};
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public HttpResponseMessage DeleteTanterv([FromBody] int tantervID)
|
||||
{
|
||||
if (ClaimData.SelectedTanevID == ClaimData.KovTanevID)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ErrorResource.TantervTorleseCsakAzAktualisTanevbenLehetseges);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
TantervHelper helper = new TantervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
var ds = helper.GetAktivTantervDataSet();
|
||||
if (ds.Tables[0].Rows.Count == 1)
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ErrorResource.Legalabb1TantervLetezne);
|
||||
|
||||
helper.Delete(tantervID);
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
catch (BlException exception)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, exception.Message);
|
||||
}
|
||||
catch (EntityDeleteFailedException ex)
|
||||
{
|
||||
|
||||
var uzenet = string.Format(ErrorResource.NemTorolhetoKapcsolatMiatt, TanuloResource.Tanterv, ex.ConnectionErrorMessage);
|
||||
throw new StatusError(HttpStatusCode.BadRequest, uzenet);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private TantervCO ConvertModelToCO(TantervModel tmodel)
|
||||
{
|
||||
TantervCO co = new TantervCO()
|
||||
{
|
||||
CsoportTipusa = tmodel.CsoportTipusa ?? -1,
|
||||
Evfolyamig = tmodel.Evfolyamig ?? -1,
|
||||
Evfolyamtol = tmodel.Evfolyamtol ?? -1,
|
||||
ID = tmodel.ID,
|
||||
KerettantervreEpulo = tmodel.KerettantervreEpulo,
|
||||
Megjegyzes = tmodel.Megjegyzes,
|
||||
Nev = tmodel.Nev,
|
||||
IsKerettanterv = tmodel.IsKerettanterv
|
||||
};
|
||||
|
||||
return co;
|
||||
}
|
||||
|
||||
private TantervModel ConvertCOtoModel(TantervCO co)
|
||||
{
|
||||
TantervModel model = new TantervModel()
|
||||
{
|
||||
CsoportTipusa = co.CsoportTipusa,
|
||||
Evfolyamig = co.Evfolyamig,
|
||||
Evfolyamtol = co.Evfolyamtol,
|
||||
ID = co.ID,
|
||||
KerettantervreEpulo = co.KerettantervreEpulo,
|
||||
Megjegyzes = co.Megjegyzes,
|
||||
Nev = co.Nev,
|
||||
IsKerettanterv = co.IsKerettanterv
|
||||
};
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
public System.Web.Http.Results.JsonResult<List<ComboBoxListItem>> GetEvfolyamListS([DataSourceRequest] DataSourceRequest request)
|
||||
{
|
||||
List<ComboBoxListItem> items = ((int)GeneratedAdatszotarTipusEnum.EvfolyamTipus).GetItemsByType(ClaimData.SelectedTanevID.Value, true).ToComboBoxItemList();
|
||||
|
||||
return Json(items);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
using Kreta.Web.Attributes;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.ApiControllers
|
||||
{
|
||||
[KretaGlobalLanguageChangeApiActionFilter(LanguageCode = "hu-Dualis")]
|
||||
public class TanulasiElemekApiController : BaseTanmenetApiController
|
||||
{
|
||||
}
|
||||
}
|
112
KretaWeb/Areas/Tantargy/Controllers/BaseTanmenetController.cs
Normal file
112
KretaWeb/Areas/Tantargy/Controllers/BaseTanmenetController.cs
Normal file
|
@ -0,0 +1,112 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Classes.ExcelHelpers;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Framework;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.ApiControllers;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Tanar.ClaimValue)]
|
||||
public class BaseTanmenetController : Controller
|
||||
{
|
||||
#region Properties
|
||||
|
||||
protected IKretaAuthorization Authorization { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
public BaseTanmenetController(IKretaAuthorization authorization)
|
||||
{
|
||||
Authorization = authorization ?? throw new ArgumentNullException(nameof(authorization));
|
||||
}
|
||||
|
||||
#region Popup actions
|
||||
|
||||
[NonAction]
|
||||
public ActionResult OpenNewTanmenetWindow(NewTanmenetModel model)
|
||||
{
|
||||
var pm = new PopUpModel(model, "~/Areas/Tantargy/Views/Tanmenet/NewTanmenet_Bevitel.cshtml");
|
||||
pm = pm.AddCancelBtn(pm, "TanmenetHelper.newTanmenetCancel");
|
||||
pm = pm.AddBtn(pm, "openNewTanmenetGrid", CommonResource.Tovabb, "TanmenetHelper.openNewTanmenetGrid");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
protected ActionResult OpenEditTanmenetGridWindow(TanmenetOrakModel model)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(model.FoglalkozasId_input))
|
||||
{
|
||||
model.TanmenetModalHeader = TantargyResource.UjTanmenet + model.FoglalkozasId_input;
|
||||
}
|
||||
else
|
||||
{
|
||||
model.TanmenetModalHeader = TantargyResource.Tanmenet + new BaseTanmenetApiController().GetTanmenetModalHeader(model.TantargyId, model.OsztalyId);
|
||||
}
|
||||
var pm = new PopUpModel(model, "~/Areas/Tantargy/Views/Tanmenet//EditTanmenetGrid_Bevitel.cshtml");
|
||||
pm = pm.AddBtn(pm, "TanmenetGridCancelBtn", AdminisztracioResource.Megsem, "TanmenetHelper.editTanmenetGridCancel");
|
||||
pm = pm.AddBtn(pm, "SaveTanmenet", CommonResource.Mentes, "TanmenetHelper.saveTanmenetOrak");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Export actions
|
||||
|
||||
[NonAction]
|
||||
public string ExportTanmenet(int tantargyId, int osztalyId)
|
||||
{
|
||||
var memoryStream = GetTanmenetExport(tantargyId, osztalyId);
|
||||
|
||||
if (memoryStream != null)
|
||||
{
|
||||
return Convert.ToBase64String(memoryStream.ToArray());
|
||||
}
|
||||
|
||||
return ImportExportCommonResource.NincsElegendoAdatARendszerbenAzExportalashoz;
|
||||
}
|
||||
|
||||
private MemoryStream GetTanmenetExport(int tantargyId, int osztalyId)
|
||||
{
|
||||
var manager = new ExcelExportManager();
|
||||
var exportFile = new ExcelExportItem();
|
||||
|
||||
exportFile.AddColumn(0, TanmenetResource.Oraszam);
|
||||
exportFile.AddColumn(1, TanmenetResource.Tema);
|
||||
|
||||
var rowIndex = 2;
|
||||
var tanmenetHelper = new TanmenetHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
var ds = tanmenetHelper.GetTanmenetek(tantargyId, osztalyId, ClaimData.FelhasznaloId);
|
||||
|
||||
foreach (var row in ds.Tables[0].AsEnumerable())
|
||||
{
|
||||
exportFile.AddCell(rowIndex, 0, row.Field<int>("Oraszam"));
|
||||
exportFile.AddCell(rowIndex, 1, row.Field<string>("Tema"));
|
||||
rowIndex++;
|
||||
}
|
||||
|
||||
// mindenképp 2000-ig feltöltjük az excelt
|
||||
for (; rowIndex < 2001; rowIndex++)
|
||||
{
|
||||
exportFile.AddCell(rowIndex, 0, rowIndex);
|
||||
exportFile.AddCell(rowIndex, 1, string.Empty);
|
||||
}
|
||||
|
||||
return manager.CreateExcelExport(new List<ExcelExportItem> { exportFile });
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.Core.FeatureToggle;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Controllers;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
public class BaseTantargyFelosztasController : Controller
|
||||
{
|
||||
protected IFeatureContext FeatureContext { get; }
|
||||
|
||||
public BaseTantargyFelosztasController(IFeatureContext featureContext)
|
||||
{
|
||||
FeatureContext = featureContext;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public PopUpModel OpenTantargyFelosztasFelvetelePopUp(bool isFromSzervezet = false)
|
||||
{
|
||||
var model = new TantargyFelosztasFelveteleModel
|
||||
{
|
||||
TanarList = new ComboBoxHelperApiController().GetTanarSelectListItemList(isFromSzervezet)
|
||||
};
|
||||
|
||||
model.IsFromSzervezet = isFromSzervezet;
|
||||
model.DualisKepzesTantargyId = new TantargyHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetDualisKepzesTantargyId();
|
||||
var popUpModel = new PopUpModel(model, "TantargyFelosztasFelveteleModal");
|
||||
popUpModel.AddCancelBtn(popUpModel, "TantargyFelosztasHelper.CloseWindow");
|
||||
popUpModel.AddOkBtn(popUpModel, "FelosztasFelvetelHelper.ValidateFelosztas");
|
||||
|
||||
return popUpModel;
|
||||
}
|
||||
|
||||
public ActionResult OpenTantargyFelosztasAdatokPopUp(int id, bool isFromSzervezet = false)
|
||||
{
|
||||
var model = new TantargyFelosztasAdatokModel();
|
||||
var helper = new TantargyFelosztasHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
var adatok = helper.GetTantargyFelosztasAdatok(id);
|
||||
model.Csoport = adatok.Csoport;
|
||||
model.FoglalkozasHelye = adatok.FoglalkozasHelye;
|
||||
model.FoglalkozasKategoria = adatok.FoglalkozasKategoria;
|
||||
model.FoglalkozasTipus = adatok.FoglalkozasTipus;
|
||||
model.HetiOraszam = adatok.HetiOraszam;
|
||||
model.MunkakorTipus = adatok.MunkakorTipus;
|
||||
model.MunkavallaloNev = adatok.MunkavallaloNev;
|
||||
model.Tantargynev = adatok.Tantargynev;
|
||||
model.Tanev = adatok.Tanev;
|
||||
model.OsszevontOra = adatok.OsszevontOra;
|
||||
model.NemzetisegiOra = adatok.NemzetisegiOra;
|
||||
model.MegbizasiOraszam = adatok.MegbizasiOraszam;
|
||||
model.TuloraSzam = adatok.TuloraSzam;
|
||||
model.IsFromSzervezet = isFromSzervezet;
|
||||
|
||||
var pm = new PopUpModel(model, "TantargyFelosztasAdatokModal");
|
||||
pm.AddCancelBtn(pm, "TantargyFelosztasHelper.CloseWindow");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenTantargyFelosztasModositasPopUp(int id, bool isFromSzervezet = false)
|
||||
{
|
||||
var model = new TantargyFelosztasModositasaModel();
|
||||
|
||||
var helper = new TantargyFelosztasHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
var adatok = helper.GetTantargyFelosztas(id);
|
||||
var kapcsolatok = helper.GetTantargyFelosztasKapcsolatai(id);
|
||||
model.Id = id;
|
||||
model.Oraszam = adatok.Oraszam;
|
||||
model.CsoportID = adatok.OsztalyCsoportID;
|
||||
model.TanarId = adatok.TanarID;
|
||||
model.TantargyId = adatok.TantargyID;
|
||||
model.TipusId = adatok.FoglalkozasTipusa;
|
||||
model.Modosithato = adatok.Modosithato;
|
||||
model.DiakokSzama = kapcsolatok.DiakokSzama;
|
||||
model.ErtekelesekSzama = kapcsolatok.ErtekelesekSzama;
|
||||
model.TanorakSzama = kapcsolatok.TanorakSzama;
|
||||
model.OsszevontOra = adatok.OsszevontOra;
|
||||
model.NemzetisegiOra = adatok.NemzetisegiOra;
|
||||
model.MegbizasiOraszam = adatok.MegbizasiOraszam;
|
||||
model.TuloraSzam = adatok.TuloraSzam;
|
||||
model.MulasztasokSzama = kapcsolatok.MulasztasokSzama;
|
||||
model.IsFromSzervezet = isFromSzervezet;
|
||||
|
||||
var pm = new PopUpModel(model, "TantargyFelosztasModositasModal");
|
||||
pm.AddCancelBtn(pm, "TantargyFelosztasHelper.CloseWindow");
|
||||
pm.AddOkBtn(pm, "TantargyFelosztasHelper.ValidateFelosztas");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Core.FeatureToggle;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Attributes;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue, KretaClaimPackages.IsDefaultAdminUser.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue, KretaClaimPackages.Dualis_Admin.ClaimValue, KretaClaimPackages.IsSzakiranyuOktatasertFelelos.ClaimValue)]
|
||||
[KretaGlobalLanguageChangeActionFilter(LanguageCode = "hu-Dualis")]
|
||||
public class DualisTantargyFelosztasController : BaseTantargyFelosztasController
|
||||
{
|
||||
public DualisTantargyFelosztasController(IFeatureContext featureContext) : base(featureContext)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ActionResult OpenTantargyFelosztasFelvetelePopUp()
|
||||
{
|
||||
var popUpModel = OpenTantargyFelosztasFelvetelePopUp(true);
|
||||
(popUpModel.Instance as TantargyFelosztasFelveteleModel).ApiControllerName = Constants.ApiControllers.DualisTantargyFelosztasApi;
|
||||
return PartialView(Constants.General.PopupView, popUpModel);
|
||||
}
|
||||
}
|
||||
}
|
131
KretaWeb/Areas/Tantargy/Controllers/OraTervController.cs
Normal file
131
KretaWeb/Areas/Tantargy/Controllers/OraTervController.cs
Normal file
|
@ -0,0 +1,131 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.BusinessLogic.Utils;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Web.Areas.Tantargy.ApiControllers;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class OraTervController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
OraTervSearchModel model = new OraTervSearchModel();
|
||||
model.IsKovetkezoTanev = ClaimData.KovTanevID == ClaimData.SelectedTanevID;
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
public ActionResult OpenOraTervNewPopUp(int tantervId)
|
||||
{
|
||||
PopUpModel pm = new PopUpModel(new OraTervModel()
|
||||
{
|
||||
TantervId = tantervId,
|
||||
EvfolyamList = GetEvfolyamList(tantervId)
|
||||
}, "OraTerv_Bevitel");
|
||||
|
||||
pm = pm.AddCancelBtn(pm, "OraTervHelper.newOraTervCancel");
|
||||
pm = pm.AddOkBtn(pm, "OraTervHelper.newOraTervSave");
|
||||
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenOraTervModPopUp(int id)
|
||||
{
|
||||
OraTervApiController api = new OraTervApiController();
|
||||
|
||||
OraTervModel model = api.GetOraTervElem(id);
|
||||
model.EvfolyamList = GetEvfolyamList(model.TantervId.Value);
|
||||
|
||||
PopUpModel pm = new PopUpModel(model, "OraTerv_Bevitel");
|
||||
|
||||
pm = pm.AddCancelBtn(pm, "OraTervHelper.modOraTervCancel");
|
||||
pm = pm.AddOkBtn(pm, "OraTervHelper.modOraTervSave");
|
||||
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenOraTervTantargyNewPopUp(int oraTervId)
|
||||
{
|
||||
PopUpModel pm = new PopUpModel(new OraTervTargyModel()
|
||||
{
|
||||
OratervId = oraTervId,
|
||||
TantargyList = GetTantargyList(oraTervId)
|
||||
}, "OraTervTantargy_Bevitel");
|
||||
|
||||
pm = pm.AddCancelBtn(pm, "OraTervHelper.newTantargyCancel");
|
||||
pm = pm.AddOkBtn(pm, "OraTervHelper.newTantargySave");
|
||||
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenOraTervTantargyModPopUp(int oraTervTantargyId)
|
||||
{
|
||||
OraTervApiController api = new OraTervApiController();
|
||||
OraTervTargyModel model = api.GetOraTervTantargyElem(oraTervTantargyId);
|
||||
model.OratervTantargyId = oraTervTantargyId;
|
||||
model.TantargyList = GetTantargyList(model.OratervId, oraTervTantargyId);
|
||||
|
||||
PopUpModel pm = new PopUpModel(model, "OraTervTantargy_Bevitel");
|
||||
|
||||
pm = pm.AddCancelBtn(pm, "OraTervHelper.modTantargyCancel");
|
||||
pm = pm.AddOkBtn(pm, "OraTervHelper.modTantargySave");
|
||||
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult GetDetailGrid(int? id)
|
||||
{
|
||||
return PartialView("DetailGrid", id);
|
||||
}
|
||||
|
||||
#region Helpers
|
||||
|
||||
private List<SelectListItem> GetEvfolyamList(int tantervID)
|
||||
{
|
||||
List<SelectListItem> items = ((int)GeneratedAdatszotarTipusEnum.EvfolyamTipus).GetItemsByType(ClaimData.SelectedTanevID.Value, true).ToSelectItemList();
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetTantargyList(int oraTervId)
|
||||
{
|
||||
OratervHelper helper = new OratervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
var tantargyDictionary = helper.GetTantargyak(oraTervId);
|
||||
List<SelectListItem> tantargyList = new List<SelectListItem>();
|
||||
|
||||
foreach (var item in tantargyDictionary)
|
||||
{
|
||||
SelectListItem sli = new SelectListItem() { Text = item.Value, Value = item.Key };
|
||||
tantargyList.Add(sli);
|
||||
}
|
||||
return tantargyList;
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetTantargyList(int oraTervId, int oraTervTantargyId)
|
||||
{
|
||||
OratervHelper helper = new OratervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
var tantargyDictionary = helper.GetTantargyakModOraTervTantargy(oraTervId, oraTervTantargyId);
|
||||
List<SelectListItem> tantargyList = new List<SelectListItem>();
|
||||
|
||||
foreach (var item in tantargyDictionary)
|
||||
{
|
||||
SelectListItem sli = new SelectListItem() { Text = item.Value, Value = item.Key };
|
||||
tantargyList.Add(sli);
|
||||
}
|
||||
return tantargyList;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
51
KretaWeb/Areas/Tantargy/Controllers/TanmenetController.cs
Normal file
51
KretaWeb/Areas/Tantargy/Controllers/TanmenetController.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
using System.Web.Mvc;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
public class TanmenetController : BaseTanmenetController
|
||||
{
|
||||
public TanmenetController(IKretaAuthorization authorization) : base(authorization)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ActionResult Index()
|
||||
{
|
||||
if (Authorization.IsValidTanulasiElemek())
|
||||
{
|
||||
return Redirect(Url.Action("AccessDenied", "ErrorHandler", new { area = string.Empty }));
|
||||
}
|
||||
|
||||
var model = new TanmenetSearchModel
|
||||
{
|
||||
ControllerName = Constants.Controllers.Tanmenet,
|
||||
ApiControllerName = Constants.ApiControllers.TanmenetApi,
|
||||
ImportControllerName = Constants.Controllers.TanmenetImportExport,
|
||||
IsFromSzervezet = false,
|
||||
};
|
||||
return View(model);
|
||||
}
|
||||
|
||||
public ActionResult OpenNewTanmenetWindow()
|
||||
{
|
||||
var model = new NewTanmenetModel
|
||||
{
|
||||
ApiControllerName = Constants.ApiControllers.TanmenetApi,
|
||||
};
|
||||
return OpenNewTanmenetWindow(model);
|
||||
}
|
||||
|
||||
public new ActionResult OpenEditTanmenetGridWindow(TanmenetOrakModel model)
|
||||
{
|
||||
model.ApiControllerName = Constants.ApiControllers.TanmenetApi;
|
||||
return base.OpenEditTanmenetGridWindow(model);
|
||||
}
|
||||
|
||||
public new string ExportTanmenet(int tantargyId, int osztalyId)
|
||||
{
|
||||
return base.ExportTanmenet(tantargyId, osztalyId);
|
||||
}
|
||||
}
|
||||
}
|
93
KretaWeb/Areas/Tantargy/Controllers/TanorakController.cs
Normal file
93
KretaWeb/Areas/Tantargy/Controllers/TanorakController.cs
Normal file
|
@ -0,0 +1,93 @@
|
|||
using System.Net;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Core.Exceptions;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.Error;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Tanar.ClaimValue)]
|
||||
public class TanorakController : Controller
|
||||
{
|
||||
private IKretaAuthorization Authorization { get; }
|
||||
|
||||
public TanorakController(IKretaAuthorization authorization)
|
||||
{
|
||||
Authorization = authorization;
|
||||
}
|
||||
|
||||
// GET: Tantargy/Tanorak
|
||||
public ActionResult Index()
|
||||
{
|
||||
TanorakSearchModel model = new TanorakSearchModel();
|
||||
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
public ActionResult OpenAdatokPopup(int ID)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Authorization.IsValidTanitasiOra(ID))
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.Forbidden, ErrorResource.NincsJogaAzOldalMegtekintesehez);
|
||||
}
|
||||
|
||||
PopUpModel pm = new PopUpModel(GetTanoraAdatokModel(ID), "TanorakAdatok");
|
||||
|
||||
pm = pm.AddCancelBtn(pm, "TanorakHelper.adatokCancel");
|
||||
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
catch (BlException ex)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private TanoraAdatokModel GetTanoraAdatokModel(int id)
|
||||
{
|
||||
TanoraCO co;
|
||||
|
||||
var helper = new TanoraHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
|
||||
co = helper.GetTanorakAdatok(id);
|
||||
|
||||
TanoraAdatokModel model = ConvertTanoraCoToTanoraAdatokModel(co);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
private TanoraAdatokModel ConvertTanoraCoToTanoraAdatokModel(TanoraCO co)
|
||||
{
|
||||
TanoraAdatokModel model = new TanoraAdatokModel()
|
||||
{
|
||||
Datum = co.Datum.ToShortDateString(),
|
||||
HelyNev = co.TeremNev,
|
||||
HetNapja = co.HetNapjaNev,
|
||||
Id = co.ID,
|
||||
Oraszam = string.IsNullOrWhiteSpace(co.OraIdopont) ? co.Oraszam.ToString() : co.OraIdopont,
|
||||
OraSorszama = co.EvesOraSorszam.HasValue ? co.EvesOraSorszam.Value.ToString() : "",
|
||||
OsztCsopNev = co.OsztalyCsoportNev,
|
||||
TanarNev = co.TanarNev,
|
||||
TargyNev = co.TantargyNev,
|
||||
Tema = co.Megtartott.HasValue && co.Megtartott.Value ? co.Tema : "-",
|
||||
FoglalkozasNev = co.FoglalkozasNev,
|
||||
Megtartott = co.Megtartott.Value,
|
||||
OraKezdete = co.OraKezd.ToShortTimeString(),
|
||||
OraVege = co.OraVeg.ToShortTimeString()
|
||||
};
|
||||
|
||||
return model;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
using System;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Classes.ExcelHelpers;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Core.FeatureToggle;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class TantargyFelosztasController : BaseTantargyFelosztasController
|
||||
{
|
||||
public TantargyFelosztasController(IFeatureContext featureContext) : base(featureContext)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ActionResult Index(string filter)
|
||||
{
|
||||
var api = new ApiControllers.TantargyFelosztasApiController();
|
||||
|
||||
var model = new TantargyFelosztasModel();
|
||||
var intezmeny = api.GetIntezmenyAdatok();
|
||||
model.VeglegesTTF = intezmeny.VeglegesTTF;
|
||||
model.VeglegesESL = intezmeny.VeglegesESL;
|
||||
model.ElfogadottTTF = intezmeny.ElfogadottTTF;
|
||||
model.ElfogadottESL = intezmeny.ElfogadottESL;
|
||||
model.IntezmenyId = intezmeny.ID;
|
||||
model.IsFromSzervezet = false;
|
||||
model.ControllerName = Constants.Controllers.Tantargyfelosztas;
|
||||
model.ApiControllerName = Constants.ApiControllers.TantargyFelosztasApi;
|
||||
|
||||
if (filter == "minden")
|
||||
{
|
||||
model.SearchFeladatKategoriaId = Constants.MindenErteke.FeladatKategoria;
|
||||
}
|
||||
|
||||
model.SearchFeladatellatasihely = ClaimData.FelhelySzuro;
|
||||
|
||||
(var oraszam, var ttfKorrekcioOraszam) = new FoglalkozasHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetFoglalkozasOsszOraszamok();
|
||||
|
||||
ViewBag.Oraszam = oraszam;
|
||||
ViewBag.TtfKorrekcioOraszam = ttfKorrekcioOraszam;
|
||||
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
|
||||
[System.Web.Mvc.HttpPost]
|
||||
[MvcValidateAjaxAntiForgeryToken]
|
||||
public string ExportFormazottTantargyfelosztas()
|
||||
{
|
||||
var helper = new TTFExportHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
var munkaugyiAdatokKlebelsbergOrNSZFH =
|
||||
FeatureContext.IsEnabled(Core.Constants.FeatureName.MunkaugyiAdatokKlebelsberg)
|
||||
|| FeatureContext.IsEnabled(Core.Constants.FeatureName.MunkaugyiAdatokNSZFH);
|
||||
var memoryStream = helper.ExportFormazottTtf(munkaugyiAdatokKlebelsbergOrNSZFH ? 1 : 0);
|
||||
|
||||
if (memoryStream != null)
|
||||
{
|
||||
return Convert.ToBase64String(memoryStream.ToArray());
|
||||
}
|
||||
|
||||
return ImportExportCommonResource.NincsElegendoAdatARendszerbenAzExportalashoz;
|
||||
}
|
||||
|
||||
public ActionResult OpenTantargyFelosztasFelvetelePopUp()
|
||||
{
|
||||
var popUpModel = OpenTantargyFelosztasFelvetelePopUp(false);
|
||||
(popUpModel.Instance as TantargyFelosztasFelveteleModel).ApiControllerName = Constants.ApiControllers.TantargyFelosztasApi;
|
||||
return PartialView(Constants.General.PopupView, popUpModel);
|
||||
}
|
||||
}
|
||||
}
|
295
KretaWeb/Areas/Tantargy/Controllers/TantargyakController.cs
Normal file
295
KretaWeb/Areas/Tantargy/Controllers/TantargyakController.cs
Normal file
|
@ -0,0 +1,295 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Helpers.SystemSettings;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Framework;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.Logic;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.TabStrip;
|
||||
using Kreta.Web.Models;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class TantargyakController : Controller
|
||||
{
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult Index(string filter)
|
||||
{
|
||||
TantargySearchModel model = TantargySearchModel.SetFilterTantargySearchModel(filter);
|
||||
model.NemzetiDokumentumNyelvek = new SystemSettingsHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetSystemSettingValue<List<int>>(RendszerBeallitasTipusEnum.Nemzeti_Nyelvi_Dokumentum_Nyelvek);
|
||||
model.IsSzakkepzo = ClaimData.IsSzakkepzoIntezmeny;
|
||||
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult ErrorIndex(bool? nincsTantargykategoria)
|
||||
{
|
||||
TantargySearchModel model = new TantargySearchModel();
|
||||
|
||||
if (nincsTantargykategoria.HasValue && nincsTantargykategoria.Value)
|
||||
{
|
||||
model.nincsTantargykategoria = nincsTantargykategoria;
|
||||
}
|
||||
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult OpenTantargyPropertiesTab(int tantargyID)
|
||||
{
|
||||
TantargyModel tmodel = new TantargyModel()
|
||||
{
|
||||
ID = tantargyID,
|
||||
RadioButtonItems = GetMinositesRadioButtonItems()
|
||||
};
|
||||
tmodel.TabList = GetTabItems(tmodel);
|
||||
PopUpModel pm = new PopUpModel(tmodel, "TantargyProperties_Info");
|
||||
pm = pm.AddCancelBtn(pm, "TantargyHelper.propertiesCancel");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenTantargyModifyAddPopup(int? tantargyID)
|
||||
{
|
||||
TantargyModel tmodel;
|
||||
if (tantargyID.HasValue)
|
||||
{
|
||||
tmodel = GetTantargyBaseProperties(tantargyID.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
tmodel = new TantargyModel();
|
||||
tmodel.SetDefaultsForNew();
|
||||
}
|
||||
|
||||
tmodel.NemzetiDokumentumNyelvek = new SystemSettingsHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetSystemSettingValue<List<int>>(RendszerBeallitasTipusEnum.Nemzeti_Nyelvi_Dokumentum_Nyelvek);
|
||||
|
||||
var tabModel = TantargyLogic.GetTabModel(tmodel);
|
||||
|
||||
PopUpModel pm = new PopUpModel(tabModel, "TantargyModifyAdd_Bevitel");
|
||||
pm = pm.AddCancelBtn(pm, "TantargyHelper.modifyAddCancel");
|
||||
pm = pm.AddBtn(pm, "saveTantargy", CommonResource.Mentes, "TantargyHelper.saveModifyAddTantargy");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public static List<TabStripItemModel> GetTantargyTobbesModTabs(TantargyModModel model)
|
||||
{
|
||||
List<TabStripItemModel> list = new List<TabStripItemModel>();
|
||||
|
||||
list.Add(new TabStripItemModel() { ItemId = "1", ItemName = TantargyResource.Alapadatok, Model = model, PartialViewName = "~/Areas/Tantargy/Views/Tantargyak/TantargyTobbesModify.cshtml" });
|
||||
list[0].IsActive = true;
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public ActionResult OpenModPopup(List<TantargyModModel> tantargyakList)
|
||||
{
|
||||
TantargyModModel tmodel = new TantargyModModel();
|
||||
|
||||
tmodel.TabList = GetTantargyTobbesModTabs(tmodel);
|
||||
|
||||
foreach (var item in tantargyakList)
|
||||
{
|
||||
tmodel.TantargyakIDArray += item.ID.ToString() + ",";
|
||||
tmodel.TantargyakNevArray += item.TantargyNev.ToString() + ", ";
|
||||
}
|
||||
|
||||
tmodel.TantargyakIDArray = tmodel.TantargyakIDArray.Remove(tmodel.TantargyakIDArray.Length - 1);
|
||||
tmodel.TantargyakNevArray = tmodel.TantargyakNevArray.Remove(tmodel.TantargyakNevArray.Length - 2);
|
||||
|
||||
PopUpModel pm = new PopUpModel(tmodel, "TantargyModify_bevitel");
|
||||
pm = pm.AddCancelBtn(pm, "TantargyHelper.modifyAddCancel");
|
||||
pm = pm.AddBtn(pm, "saveTantargy", CommonResource.Mentes, "TantargyHelper.saveCsoportosModifyAddTantargy");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult OpenTantargyakBaseProperties(int id)
|
||||
{
|
||||
TantargyModel tmodel = GetTantargyBaseProperties(id);
|
||||
tmodel.NemzetiDokumentumNyelvek = new SystemSettingsHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetSystemSettingValue<List<int>>(RendszerBeallitasTipusEnum.Nemzeti_Nyelvi_Dokumentum_Nyelvek);
|
||||
|
||||
return PartialView("TantargyBasicProperties_Tab", tmodel);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult OpenTantargyakFoglalkozasai(int id)
|
||||
{
|
||||
TantargyModel tmodel = new TantargyModel()
|
||||
{
|
||||
ID = id
|
||||
};
|
||||
return PartialView("TantargyFoglalkozasai_Tab", tmodel);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult OpenTantargyakOrarendiOrai(int id)
|
||||
{
|
||||
TantargyModel tmodel = new TantargyModel()
|
||||
{
|
||||
ID = id
|
||||
};
|
||||
return PartialView("TantargyOrarendiOrai_Tab", tmodel);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult OpenTantargyakTanmenetei(int id)
|
||||
{
|
||||
TantargyModel tmodel = new TantargyModel()
|
||||
{
|
||||
ID = id
|
||||
};
|
||||
return PartialView("TantargyTanmenetei_Tab", tmodel);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult OpenTantargyakMegtartottTanorai(int id)
|
||||
{
|
||||
TantargyModel tmodel = new TantargyModel()
|
||||
{
|
||||
ID = id
|
||||
};
|
||||
return PartialView("TantargyMegtartottTanorai_Tab", tmodel);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult OpenTantargyakErtekelesei(int id)
|
||||
{
|
||||
TantargyModel tmodel = new TantargyModel()
|
||||
{
|
||||
ID = id
|
||||
};
|
||||
return PartialView("TantargyErtekelesei_Tab", tmodel);
|
||||
}
|
||||
|
||||
private List<TabStripItemModel> GetTabItems(TantargyModel tmodel)
|
||||
{
|
||||
var items = new List<TabStripItemModel>();
|
||||
//Alapadatok
|
||||
items.Add(new TabStripItemModel { ItemId = "1", ItemName = StringResourcesUtil.GetString(161), Area = "Tantargy", Controller = "Tantargyak", Action = "OpenTantargyakBaseProperties", RouteParameters = new Dictionary<string, string>() { { "Id", tmodel.ID.ToString() } } });
|
||||
//Foglalkozasok
|
||||
items.Add(new TabStripItemModel { ItemId = "2", ItemName = StringResourcesUtil.GetString(164), Area = "Tantargy", Controller = "Tantargyak", Action = "OpenTantargyakFoglalkozasai", RouteParameters = new Dictionary<string, string>() { { "Id", tmodel.ID.ToString() } } });
|
||||
//Orarendi orak
|
||||
items.Add(new TabStripItemModel { ItemId = "3", ItemName = StringResourcesUtil.GetString(165), Area = "Tantargy", Controller = "Tantargyak", Action = "OpenTantargyakOrarendiOrai", RouteParameters = new Dictionary<string, string>() { { "Id", tmodel.ID.ToString() } }, IsETTFDisabled = true });
|
||||
//Tanmenetek
|
||||
items.Add(new TabStripItemModel { ItemId = "4", ItemName = StringResourcesUtil.GetString(166), Area = "Tantargy", Controller = "Tantargyak", Action = "OpenTantargyakTanmenetei", RouteParameters = new Dictionary<string, string>() { { "Id", tmodel.ID.ToString() } }, IsETTFDisabled = true });
|
||||
//Megtartott tanorak
|
||||
items.Add(new TabStripItemModel { ItemId = "5", ItemName = StringResourcesUtil.GetString(167), Area = "Tantargy", Controller = "Tantargyak", Action = "OpenTantargyakMegtartottTanorai", RouteParameters = new Dictionary<string, string>() { { "Id", tmodel.ID.ToString() } }, IsETTFDisabled = true });
|
||||
//Ertekeles
|
||||
items.Add(new TabStripItemModel { ItemId = "6", ItemName = StringResourcesUtil.GetString(168), Area = "Tantargy", Controller = "Tantargyak", Action = "OpenTantargyakErtekelesei", RouteParameters = new Dictionary<string, string>() { { "Id", tmodel.ID.ToString() } }, IsETTFDisabled = true });
|
||||
//Minositesek
|
||||
//items.Add(new TabStripItemModel { ItemId = "7", ItemName = StringResourcesUtil.GetString(3233), Area = "Tantargy", Controller = "Tantargyak", Action = "OpenTantargyakMinositesei", RouteParameters = new Dictionary<string, string>() { { "Id", tmodel.ID.ToString() } }, IsETTFDisabled = true });
|
||||
return items;
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetMinositesRadioButtonItems()
|
||||
{
|
||||
List<SelectListItem> list = new List<SelectListItem>();
|
||||
list.Add(new SelectListItem() { Value = "0", Text = StringResourcesUtil.GetString(3231), Selected = true });
|
||||
list.Add(new SelectListItem() { Value = "1", Text = StringResourcesUtil.GetString(30) });
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetTargyKategoriaList()
|
||||
{
|
||||
List<SelectListItem> list = new List<SelectListItem>();
|
||||
var itemlist = FrameworkEnumExtensions.EnumToList((int)GeneratedAdatszotarTipusEnum.TargyKategoriaTipus, ClaimData.SelectedTanevID.Value, true);
|
||||
foreach (var item in itemlist)
|
||||
{
|
||||
SelectListItem sli = new SelectListItem() { Text = item.Value, Value = item.Key };
|
||||
list.Add(sli);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetFotargyakList(int tanevId, int id)
|
||||
{
|
||||
IDictionary<string, string> fotargyLista;
|
||||
List<SelectListItem> list = new List<SelectListItem>();
|
||||
var helper = new TantargyHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
|
||||
fotargyLista = helper.GetFotargyak(kiveve: id).OrderBy(x => x.Value).ToDictionary(k => k.Key, v => v.Value);
|
||||
|
||||
foreach (var item in fotargyLista)
|
||||
{
|
||||
SelectListItem sli = new SelectListItem() { Text = item.Value, Value = item.Key };
|
||||
list.Add(sli);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
#region Export
|
||||
|
||||
public ActionResult ExportTantargyakMindenAdata([FromUri] TantargySearchModel data)
|
||||
{
|
||||
data.IsSzakkepzo = ClaimData.IsSzakkepzoIntezmeny;
|
||||
|
||||
return TantargyLogic.ExportTantargyakMindenAdata(data);
|
||||
}
|
||||
#endregion
|
||||
|
||||
private TantargyModel GetTantargyBaseProperties(int tantargyId)
|
||||
{
|
||||
var t = new TantargyHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
TantargyCO tantargy = t.GetTantargyById(tantargyId);
|
||||
TantargyModel tmodel = new TantargyModel()
|
||||
{
|
||||
ID = tantargy.ID,
|
||||
AltantargyNyomtatvanyban = tantargy.AltantargyNyomtatvanyban,
|
||||
FoTargyID = tantargy.FoTargyID,
|
||||
FoTargyNev = tantargy.FoTargyNev,
|
||||
GyakorlatiTargy = tantargy.GyakorlatiTargy,
|
||||
IsFoTargy = tantargy.isFoTargy,
|
||||
NevNyomtatvanyban = tantargy.NevNyomtatvanyban,
|
||||
TantargyNev = tantargy.TantargyNev,
|
||||
TantargyRovidNev = tantargy.TantargyRovidNev,
|
||||
TargyKategoria = tantargy.TargyKategoria,
|
||||
TargyKategoriaNev = tantargy.TargyKategoriaNev,
|
||||
ESLTargyKategoria = tantargy.ESLTantargykategoria,
|
||||
ESLTargyKategoriaNev = tantargy.ESLTantargykategoriaNev,
|
||||
Tanev = tantargy.Tanev,
|
||||
TantargyAngolNev = tantargy.TantargyAngolNev,
|
||||
TantargyNemetNev = tantargy.TantargyNemetNev,
|
||||
TantargyHorvatNev = tantargy.TantargyHorvatNev,
|
||||
TantargyRomanNev = tantargy.TantargyRomanNev,
|
||||
TantargySzerbNev = tantargy.TantargySzerbNev,
|
||||
Sorszam = tantargy.Sorszam,
|
||||
Megjegyzes = tantargy.Megjegyzes,
|
||||
Gyakorlatigenyesseg = tantargy.Gyakorlatigenyesseg,
|
||||
IsAmiTargyMod = tantargy.IsAmiTargy,
|
||||
IsKollegiumiTargy = tantargy.IsKollegiumiTargy,
|
||||
IsEgymi = tantargy.IsEgymiTargy,
|
||||
IsFelnottOktatas = tantargy.IsFelnottOktatasTargy,
|
||||
IsNincsBeloleOraMod = tantargy.IsNincsBeloleOra,
|
||||
IsTanulmanyiAtlagbaNemSzamit = tantargy.IsTanulmanyiAtlagbaNemSzamit,
|
||||
IsOsztalynaplobanNemJelenikMeg = tantargy.IsOsztalynaplobanNemJelenikMeg,
|
||||
IsOsztalyOrarendjebenMegjelenik = tantargy.IsOsztalyokOrarendjebenMegjelenik,
|
||||
IsMszgTargy = tantargy.IsMszgTargy,
|
||||
AmiKepzesiJellemzokModel = new AmiKepzesiJellemzokModel()
|
||||
{
|
||||
MufajTipusId = tantargy.MufajTipusId,
|
||||
TanszakTipusId = tantargy.TanszakTipusId,
|
||||
MuveszetiAgId = tantargy.MuveszetiAgId
|
||||
}
|
||||
};
|
||||
|
||||
tmodel.SetErtekelesKorlatozasIdList(tantargy);
|
||||
|
||||
return tmodel;
|
||||
}
|
||||
}
|
||||
}
|
160
KretaWeb/Areas/Tantargy/Controllers/TantervekController.cs
Normal file
160
KretaWeb/Areas/Tantargy/Controllers/TantervekController.cs
Normal file
|
@ -0,0 +1,160 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Framework;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Web.Areas.Tantargy.ApiControllers;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers.TabStrip;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class TantervekController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
TantervSearchModel model = new TantervSearchModel();
|
||||
model.IsKovetkezoTanev = ClaimData.KovTanevID == ClaimData.SelectedTanevID;
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
public ActionResult OpenTantervProperties(int tantervID)
|
||||
{
|
||||
TantervModel tmodel = new TantervModel()
|
||||
{
|
||||
ID = tantervID
|
||||
};
|
||||
tmodel.TabList = GetTabItems(tmodel);
|
||||
|
||||
PopUpModel pm = new PopUpModel(tmodel, "TantervPropertiesTab");
|
||||
pm = pm.AddCancelBtn(pm, "TantervHelper.propertiesCancel");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenTantervOsztalyaiTab(int id)
|
||||
{
|
||||
TantervModel tmodel = new TantervModel()
|
||||
{
|
||||
ID = id
|
||||
};
|
||||
return PartialView("TantervProperties_Osztalyok", tmodel);
|
||||
}
|
||||
|
||||
public ActionResult OpenTantervTanuloiTab(int id)
|
||||
{
|
||||
TantervModel tmodel = new TantervModel()
|
||||
{
|
||||
ID = id
|
||||
};
|
||||
return PartialView("TantervProperties_Tanulok", tmodel);
|
||||
}
|
||||
|
||||
public ActionResult OpenTantervModifyAdd(int? tantervID)
|
||||
{
|
||||
TantervModel model;
|
||||
if (tantervID.HasValue)
|
||||
{
|
||||
TantervekApiController api = new TantervekApiController();
|
||||
model = api.GetTantervProperties(tantervID.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
model = new TantervModel();
|
||||
model.CsoportTipusa = (int)CsoportTipusEnum.iskolai_csoport_tanorai_celu_;
|
||||
model.KerettantervreEpulo = true;
|
||||
}
|
||||
|
||||
PopUpModel pm = new PopUpModel(model, "TantervModifyAdd_Bevitel");
|
||||
pm = pm.AddCancelBtn(pm, "TantervHelper.modifyAddCancel");
|
||||
pm = pm.AddOkBtn(pm, "TantervHelper.modifyAddSave");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenModPopUp(List<TantervModel> tantervList)
|
||||
{
|
||||
TantervekApiController api = new TantervekApiController();
|
||||
TantervModModel model = new TantervModModel();
|
||||
|
||||
if (tantervList.Count == 1)
|
||||
{
|
||||
model = api.GetTantervPropertiesMod(tantervList[0].ID.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var item in tantervList)
|
||||
{
|
||||
model.TantervIDArray += item.ID.ToString() + ",";
|
||||
model.TantervNevArray += item.Nev.ToString() + ", ";
|
||||
}
|
||||
|
||||
model.TantervIDArray = model.TantervIDArray.Remove(model.TantervIDArray.Length - 1);
|
||||
model.TantervNevArray = model.TantervNevArray.Remove(model.TantervNevArray.Length - 2);
|
||||
}
|
||||
|
||||
PopUpModel pm = new PopUpModel(model, "TantervModify_Bevitel");
|
||||
pm = pm.AddCancelBtn(pm, "TantervHelper.modifyAddCancel");
|
||||
pm = pm.AddOkBtn(pm, "TantervHelper.confirmCsopModWindow");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenTantervAlapadatok(int id)
|
||||
{
|
||||
TantervekApiController api = new TantervekApiController();
|
||||
TantervModel tmodel = api.GetTantervProperties(id);
|
||||
|
||||
return PartialView("TantervProperties_Info", tmodel);
|
||||
}
|
||||
|
||||
public List<TabStripItemModel> GetTabItems(TantervModel model)
|
||||
{
|
||||
var items = new List<TabStripItemModel>();
|
||||
items.Add(new TabStripItemModel { ItemId = "1", ItemName = StringResourcesUtil.GetString(161) /*Alapadatok*/, Area = "Tantargy", Controller = "Tantervek", Action = "OpenTantervAlapadatok", RouteParameters = new Dictionary<string, string>() { { "Id", model.ID.ToString() } } });
|
||||
items.Add(new TabStripItemModel { ItemId = "2", ItemName = StringResourcesUtil.GetString(3848) /*Tanterv osztályai*/, Area = "Tantargy", Controller = "Tantervek", Action = "OpenTantervOsztalyaiTab", RouteParameters = new Dictionary<string, string>() { { "Id", model.ID.ToString() } } });
|
||||
items.Add(new TabStripItemModel { ItemId = "3", ItemName = StringResourcesUtil.GetString(3849) /*Tanterv tanulói*/, Area = "Tantargy", Controller = "Tantervek", Action = "OpenTantervTanuloiTab", RouteParameters = new Dictionary<string, string>() { { "Id", model.ID.ToString() } } });
|
||||
return items;
|
||||
}
|
||||
|
||||
#region Keresok
|
||||
|
||||
private List<SelectListItem> GetJellCsopTipListS()
|
||||
{
|
||||
|
||||
var dictionary = FrameworkEnumExtensions.EnumToList((int)GeneratedAdatszotarTipusEnum.CsoportTipus, ClaimData.SelectedTanevID.Value, true);
|
||||
List<SelectListItem> list = new List<SelectListItem>();
|
||||
|
||||
foreach (var item in dictionary)
|
||||
{
|
||||
SelectListItem sli = new SelectListItem() { Text = item.Value, Value = item.Key };
|
||||
list.Add(sli);
|
||||
}
|
||||
|
||||
return list;
|
||||
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetEvfolyamListS()
|
||||
{
|
||||
|
||||
var dictionary = FrameworkEnumExtensions.EnumToList((int)GeneratedAdatszotarTipusEnum.EvfolyamTipus, ClaimData.SelectedTanevID.Value, true);
|
||||
List<SelectListItem> list = new List<SelectListItem>();
|
||||
|
||||
foreach (var item in dictionary)
|
||||
{
|
||||
SelectListItem sli = new SelectListItem() { Text = item.Value, Value = item.Key };
|
||||
list.Add(sli);
|
||||
}
|
||||
|
||||
return list;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
using System.Web.Mvc;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Attributes;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[KretaGlobalLanguageChangeActionFilter(LanguageCode = "hu-Dualis")]
|
||||
public class TanulasiElemekController : BaseTanmenetController
|
||||
{
|
||||
public TanulasiElemekController(IKretaAuthorization authorization) : base(authorization)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ActionResult Index()
|
||||
{
|
||||
if (!Authorization.IsValidTanulasiElemek())
|
||||
{
|
||||
return Redirect(Url.Action("AccessDenied", "ErrorHandler", new { area = string.Empty }));
|
||||
}
|
||||
|
||||
var model = new TanmenetSearchModel
|
||||
{
|
||||
ControllerName = Constants.Controllers.TanulasiElemek,
|
||||
ApiControllerName = Constants.ApiControllers.TanulasiElemekApi,
|
||||
ImportControllerName = Constants.Controllers.TanulasiElemImportExport,
|
||||
IsFromSzervezet = true,
|
||||
};
|
||||
return View("~/Areas/Tantargy/Views/Tanmenet/Index.cshtml", model);
|
||||
}
|
||||
|
||||
public ActionResult OpenNewTanmenetWindow()
|
||||
{
|
||||
var model = new NewTanmenetModel
|
||||
{
|
||||
ApiControllerName = Constants.ApiControllers.TanulasiElemekApi,
|
||||
};
|
||||
return OpenNewTanmenetWindow(model);
|
||||
}
|
||||
|
||||
public new ActionResult OpenEditTanmenetGridWindow(TanmenetOrakModel model)
|
||||
{
|
||||
model.ApiControllerName = Constants.ApiControllers.TanulasiElemekApi;
|
||||
return base.OpenEditTanmenetGridWindow(model);
|
||||
}
|
||||
|
||||
public new string ExportTanmenet(int tantargyId, int osztalyId)
|
||||
{
|
||||
return base.ExportTanmenet(tantargyId, osztalyId);
|
||||
}
|
||||
}
|
||||
}
|
62
KretaWeb/Areas/Tantargy/Logic/TantargyLogic.cs
Normal file
62
KretaWeb/Areas/Tantargy/Logic/TantargyLogic.cs
Normal file
|
@ -0,0 +1,62 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.TabStrip;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Logic
|
||||
{
|
||||
public class TantargyLogic
|
||||
{
|
||||
public static ActionResult ExportTantargyakMindenAdata(TantargySearchModel model)
|
||||
{
|
||||
MemoryStream stream = new TantargyHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetExportTantargyakMindenAdataExcelExport(
|
||||
model.TantargyNev,
|
||||
model.TantargyKategoriaID,
|
||||
model.EslTargykategoriaTipusId,
|
||||
model.IsErtekelesKorlatozva,
|
||||
model.IsFotargy,
|
||||
model.KeresesFotargyID,
|
||||
model.IsGyakorlati,
|
||||
model.RovidNev,
|
||||
model.BizonyitvanyNev,
|
||||
model.IsAltantargykentBizonyitvanyban,
|
||||
model.IsNincsBeloleOra,
|
||||
model.IsOsztalyNaplobanNemJelenikMeg,
|
||||
model.IsOsztalyokOrarendjebenMegjelenik,
|
||||
model.IsTanulmanyiAtlagbaSzamit,
|
||||
model.IsAmiTargy,
|
||||
model.IsKollegiumTargy,
|
||||
model.IsEgymiTargy,
|
||||
model.IsFelnottoktatasTargy,
|
||||
model.IsMszgTargyFltr,
|
||||
model.AngolNev,
|
||||
model.NemetNev,
|
||||
model.HorvatNev,
|
||||
model.RomanNev,
|
||||
model.SzerbNev,
|
||||
model.nincsTantargykategoria,
|
||||
model.IsFromSzervezet,
|
||||
model.IsSzakkepzo);
|
||||
var result = new FileStreamResult(stream, Core.Constants.ContentTypes.Xlsx) { FileDownloadName = TantargyResource.TantargyakMindenAdataExportFileName };
|
||||
return result;
|
||||
}
|
||||
|
||||
public static TabStripModel GetTabModel(TantargyModel tmodel)
|
||||
{
|
||||
return new TabStripModel
|
||||
{
|
||||
TabList = new List<TabStripItemModel>
|
||||
{
|
||||
{new TabStripItemModel {ItemId = "1", ItemName = TantargyResource.TabAlapadatok, Model = tmodel, PartialViewName = "New_Modify_Alapadatok_Tab", IsActive = true} },
|
||||
{new TabStripItemModel {ItemId = "2", ItemName = TantargyResource.TabSpecialisAdatok, Model = tmodel, PartialViewName = "New_Modify_SpecialisAdatok_Tab"} },
|
||||
{new TabStripItemModel {ItemId = "2", ItemName = TantargyResource.TabNyelviAdatok, Model = tmodel, PartialViewName = "New_Modify_Nyelviadatok_Tab"} }
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
11
KretaWeb/Areas/Tantargy/Models/ElutasitasModel.cs
Normal file
11
KretaWeb/Areas/Tantargy/Models/ElutasitasModel.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class ElutasitasModel
|
||||
{
|
||||
[Display(Name = nameof(TantargyResource.ElutasitasIndoklasa), ResourceType = typeof(TantargyResource))]
|
||||
public string ElutasitasSzoveg { get; set; }
|
||||
}
|
||||
}
|
17
KretaWeb/Areas/Tantargy/Models/NewTanmenetModel.cs
Normal file
17
KretaWeb/Areas/Tantargy/Models/NewTanmenetModel.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Attributes;
|
||||
using Kreta.Web.Models;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class NewTanmenetModel : UploadFileModel
|
||||
{
|
||||
[Display(Name = nameof(TanmenetResource.Foglalkozas), ResourceType = typeof(TanmenetResource))]
|
||||
[Required(ErrorMessageResourceName = nameof(TanmenetResource.FoglalkozasKotelezo), ErrorMessageResourceType = typeof(TanmenetResource))]
|
||||
public int? FoglalkozasId { get; set; }
|
||||
|
||||
public string ApiControllerName { get; set; }
|
||||
}
|
||||
}
|
17
KretaWeb/Areas/Tantargy/Models/OraTervDetailGridModel.cs
Normal file
17
KretaWeb/Areas/Tantargy/Models/OraTervDetailGridModel.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Web.Attributes;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class OraTervDetailGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
public int? OraTervTantargyId { get; set; }
|
||||
|
||||
[KretaDisplayName(3380)] /*Tárgy neve*/
|
||||
public string Tantargy { get; set; }
|
||||
|
||||
[KretaDisplayName(3381)] /*Éves óraszám*/
|
||||
public int EvesSorszam { get; set; }
|
||||
}
|
||||
}
|
17
KretaWeb/Areas/Tantargy/Models/OraTervGridModel.cs
Normal file
17
KretaWeb/Areas/Tantargy/Models/OraTervGridModel.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Web.Attributes;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class OraTervGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
public int? OraTervId { get; set; }
|
||||
|
||||
[KretaDisplayName(108)] /*Név*/
|
||||
public string Nev { get; set; }
|
||||
|
||||
[KretaDisplayName(442)] /*Évfolyam*/
|
||||
public string EvFolyam_DNAME { get; set; }
|
||||
}
|
||||
}
|
33
KretaWeb/Areas/Tantargy/Models/OraTervModel.cs
Normal file
33
KretaWeb/Areas/Tantargy/Models/OraTervModel.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Attributes;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class OraTervModel
|
||||
{
|
||||
public OraTervModel()
|
||||
{
|
||||
EvfolyamList = new List<SelectListItem>();
|
||||
}
|
||||
|
||||
public int? OratervId { get; set; }
|
||||
|
||||
public List<SelectListItem> EvfolyamList { get; set; }
|
||||
|
||||
[KretaDisplayName(3390)] /*Tanterv*/
|
||||
public int? TantervId { get; set; }
|
||||
|
||||
[KretaDisplayName(3397)] /*Óraterv neve*/
|
||||
[KretaRequired(StringResourcesId = 3400)] /*Név megadása kötelező!*/
|
||||
[StringLength(maximumLength: 255, ErrorMessageResourceName = nameof(ErrorResource.Max255Karakter), ErrorMessageResourceType = typeof(ErrorResource))]
|
||||
public string Nev { get; set; }
|
||||
|
||||
[KretaDisplayName(442)] /*Évfolyam*/
|
||||
[KretaRequired(StringResourcesId = 3401)] /*Évfolyam megadása kötelező!*/
|
||||
public int? EvfolyamId { get; set; }
|
||||
}
|
||||
}
|
26
KretaWeb/Areas/Tantargy/Models/OraTervSearchModel.cs
Normal file
26
KretaWeb/Areas/Tantargy/Models/OraTervSearchModel.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.Web.Attributes;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class OraTervSearchModel
|
||||
{
|
||||
public OraTervSearchModel()
|
||||
{
|
||||
EvfolyamList = new List<SelectListItem>();
|
||||
}
|
||||
|
||||
public List<SelectListItem> EvfolyamList { get; set; }
|
||||
|
||||
[KretaDisplayName(3390)] /*Tanterv*/
|
||||
public int? TantervIdSearch { get; set; }
|
||||
|
||||
[KretaDisplayName(3397)] /*Óraterv neve*/
|
||||
public string NevSearch { get; set; }
|
||||
|
||||
[KretaDisplayName(442)] /*Évfolyam*/
|
||||
public int? EvfolyamIdSearch { get; set; }
|
||||
public bool IsKovetkezoTanev { get; set; }
|
||||
}
|
||||
}
|
29
KretaWeb/Areas/Tantargy/Models/OraTervTargyModel.cs
Normal file
29
KretaWeb/Areas/Tantargy/Models/OraTervTargyModel.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class OraTervTargyModel
|
||||
{
|
||||
public OraTervTargyModel()
|
||||
{
|
||||
TantargyList = new List<SelectListItem>();
|
||||
}
|
||||
|
||||
public int OratervId { get; set; }
|
||||
public int? OratervTantargyId { get; set; }
|
||||
public List<SelectListItem> TantargyList { get; set; }
|
||||
|
||||
[Required(ErrorMessageResourceName = nameof(ErrorResource.Required), ErrorMessageResourceType = typeof(ErrorResource))]
|
||||
[Display(Name = nameof(TanuloErtekelesResource.TantargyNeve), ResourceType = typeof(TanuloErtekelesResource))]
|
||||
public int? TantargyId { get; set; }
|
||||
|
||||
[Required(ErrorMessageResourceName = nameof(ErrorResource.Required), ErrorMessageResourceType = typeof(ErrorResource))]
|
||||
[Display(Name = nameof(ImportExportOratervResource.ImportHeaderNameEvesOraszam), ResourceType = typeof(ImportExportOratervResource))]
|
||||
[DisplayFormat(DataFormatString = Core.Constants.DataFormats.EvesOraszam)]
|
||||
[RegularExpression(Core.Constants.RegularExpressions.EvesOraszam, ErrorMessageResourceName = nameof(ImportExportOratervResource.HibaAzEvesOraszamFormatumaNemMegfelelo), ErrorMessageResourceType = typeof(ImportExportOratervResource))]
|
||||
public double? EvesOraszam { get; set; }
|
||||
}
|
||||
}
|
11
KretaWeb/Areas/Tantargy/Models/SaveFelosztasModel.cs
Normal file
11
KretaWeb/Areas/Tantargy/Models/SaveFelosztasModel.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class SaveFelosztasModel
|
||||
{
|
||||
public int tanarID { set; get; }
|
||||
public bool IsFromSzervezet { get; set; }
|
||||
public List<TantargyfelosztasMentesModel> felosztasok { set; get; }
|
||||
}
|
||||
}
|
21
KretaWeb/Areas/Tantargy/Models/TanmenetGridModel.cs
Normal file
21
KretaWeb/Areas/Tantargy/Models/TanmenetGridModel.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Attributes;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TanmenetGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
|
||||
[Display(Name = nameof(AdminisztracioResource.Tantargy), ResourceType = typeof(AdminisztracioResource))]
|
||||
public string TantargyNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(OsztalyCsoportResource.Osztaly), ResourceType = typeof(OsztalyCsoportResource))]
|
||||
public string OsztalyCsoportNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TanmenetResource.Oraszam), ResourceType = typeof(TanmenetResource))]
|
||||
public int OraszamCount { get; set; }
|
||||
}
|
||||
}
|
11
KretaWeb/Areas/Tantargy/Models/TanmenetModel.cs
Normal file
11
KretaWeb/Areas/Tantargy/Models/TanmenetModel.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TanmenetModel
|
||||
{
|
||||
public int FoglalkozasId { get; set; }
|
||||
public int AlkalmazottId { get; set; }
|
||||
public List<TanmenetOrakGridModel> TanmenetBejegyzesek { get; set; }
|
||||
}
|
||||
}
|
19
KretaWeb/Areas/Tantargy/Models/TanmenetOrakGridModel.cs
Normal file
19
KretaWeb/Areas/Tantargy/Models/TanmenetOrakGridModel.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Web.Attributes;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TanmenetOrakGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
|
||||
[KretaDisplayName(274)]/*Óraszám*/
|
||||
public int Oraszam { get; set; }
|
||||
|
||||
[KretaDisplayName(271)]/*Téma*/
|
||||
public string Nev { get; set; }
|
||||
|
||||
[KretaDisplayName(271)]/*Téma*/
|
||||
public string Tema { get; set; }
|
||||
}
|
||||
}
|
13
KretaWeb/Areas/Tantargy/Models/TanmenetOrakModel.cs
Normal file
13
KretaWeb/Areas/Tantargy/Models/TanmenetOrakModel.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TanmenetOrakModel
|
||||
{
|
||||
public int TantargyId { get; set; }
|
||||
public int OsztalyId { get; set; }
|
||||
public int FoglalkozasId { get; set; }
|
||||
public string TanmenetModalHeader { get; set; }
|
||||
public string FoglalkozasId_input { get; set; }
|
||||
|
||||
public string ApiControllerName { get; set; }
|
||||
}
|
||||
}
|
26
KretaWeb/Areas/Tantargy/Models/TanmenetSearchModel.cs
Normal file
26
KretaWeb/Areas/Tantargy/Models/TanmenetSearchModel.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TanmenetSearchModel
|
||||
{
|
||||
public string NevSearch { get; set; }
|
||||
public string RovidNevSearch { get; set; }
|
||||
public string TemaSearch { get; set; }
|
||||
public int? OraszamSearch { get; set; }
|
||||
|
||||
[Display(Name = nameof(OsztalyCsoportResource.OsztalyCsoport), ResourceType = typeof(OsztalyCsoportResource))]
|
||||
public int? OsztalyCsoportIdSearch { get; set; }
|
||||
public int FeltoltoIdSearch { get; set; }
|
||||
public string MegjegyzesSearch { get; set; }
|
||||
|
||||
[Display(Name = nameof(AdminisztracioResource.Tantargy), ResourceType = typeof(AdminisztracioResource))]
|
||||
public int? TantargyIdSearch { get; set; }
|
||||
|
||||
public string ControllerName { get; set; }
|
||||
public string ApiControllerName { get; set; }
|
||||
public string ImportControllerName { get; set; }
|
||||
public bool IsFromSzervezet { get; set; }
|
||||
}
|
||||
}
|
69
KretaWeb/Areas/Tantargy/Models/TanoraAdatokModel.cs
Normal file
69
KretaWeb/Areas/Tantargy/Models/TanoraAdatokModel.cs
Normal file
|
@ -0,0 +1,69 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Attributes;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TanoraAdatokModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
|
||||
[KretaDisplayName(273)] /*Dátum*/
|
||||
public string Datum { get; set; }
|
||||
|
||||
[KretaDisplayName(270)] /*Óra sorszáma*/
|
||||
public string OraSorszama { get; set; }
|
||||
|
||||
[KretaDisplayName(266)] /*Hét napja*/
|
||||
public string HetNapja { get; set; }
|
||||
|
||||
[Display(Name = nameof(AdminisztracioResource.Tantargy), ResourceType = typeof(AdminisztracioResource))]
|
||||
public string TargyNev { get; set; }
|
||||
|
||||
[KretaDisplayName(2892)] /*Tanár*/
|
||||
public string TanarNev { get; set; }
|
||||
|
||||
[KretaDisplayName(1497)] /*Tanítási óra témája*/
|
||||
public string Tema { get; set; }
|
||||
|
||||
[Display(Name = nameof(OsztalyCsoportResource.OsztalyCsoport), ResourceType = typeof(OsztalyCsoportResource))]
|
||||
public string OsztCsopNev { get; set; }
|
||||
|
||||
[KretaDisplayName(267)] /*Helyiség*/
|
||||
public string HelyNev { get; set; }
|
||||
|
||||
[KretaDisplayName(1924)] /*Óraszám/időpont*/
|
||||
public string Oraszam { get; set; }
|
||||
|
||||
[Display(Name = nameof(TanmenetResource.Foglalkozas), ResourceType = typeof(TanmenetResource))]
|
||||
public string FoglalkozasNev { get; set; }
|
||||
|
||||
[KretaDisplayName(1927)] /*Tanítási óra kezdete*/
|
||||
public string OraKezdete { get; set; }
|
||||
|
||||
[KretaDisplayName(1928)] /*Tanítási óra vége*/
|
||||
public string OraVege { get; set; }
|
||||
|
||||
public bool? Megtartott { get; set; }
|
||||
|
||||
[Display(Name = nameof(OrarendResource.MegtartottOra), ResourceType = typeof(OrarendResource))]
|
||||
public string MegtartottString
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Megtartott.HasValue)
|
||||
{
|
||||
return this.Megtartott.Value.GetDisplayName();
|
||||
}
|
||||
|
||||
return OrarendResource.NemNaplozott;
|
||||
}
|
||||
}
|
||||
|
||||
public TanoraAdatokModel()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
72
KretaWeb/Areas/Tantargy/Models/TanorakGridModel.cs
Normal file
72
KretaWeb/Areas/Tantargy/Models/TanorakGridModel.cs
Normal file
|
@ -0,0 +1,72 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Core.CustomAttributes;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TanorakGridModel : IKretaIdentity
|
||||
{
|
||||
public const string TanorakExportAttributeId = nameof(TanorakExportAttributeId);
|
||||
|
||||
public string ID { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Datum), ResourceType = typeof(TantargyResource))]
|
||||
public DateTime? Datum { get; set; }
|
||||
|
||||
[SimpleExportColumn(TanorakExportAttributeId, 00, nameof(OrarendResource.OraKezdete), typeof(OrarendResource), DateTimeToStringPattern = Core.Constants.ToStringPattern.HungarianDateTimeWithoutSeconds)]
|
||||
[Display(Name = nameof(OrarendResource.OraKezdete), ResourceType = typeof(OrarendResource))]
|
||||
public DateTime? OraKezdete { get; set; }
|
||||
|
||||
[SimpleExportColumn(TanorakExportAttributeId, 01, nameof(TantargyResource.OraSorsz), typeof(TantargyResource))]
|
||||
[Display(Name = nameof(TantargyResource.OraSorsz), ResourceType = typeof(TantargyResource))]
|
||||
public string OraSorsz { get; set; }
|
||||
|
||||
[SimpleExportColumn(TanorakExportAttributeId, 02, nameof(TantargyResource.OraSorszama), typeof(TantargyResource))]
|
||||
[Display(Name = nameof(TantargyResource.OraSorszama), ResourceType = typeof(TantargyResource))]
|
||||
public string EvesSorsz { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Nap), ResourceType = typeof(TantargyResource))]
|
||||
public string HetNapja_DNAME { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Tantargy), ResourceType = typeof(TantargyResource))]
|
||||
public string TargyNev { get; set; }
|
||||
|
||||
[SimpleExportColumn(TanorakExportAttributeId, 03, nameof(TantargyResource.Tanar), typeof(TantargyResource))]
|
||||
[Display(Name = nameof(TantargyResource.Tanar), ResourceType = typeof(TantargyResource))]
|
||||
public string TanarNev { get; set; }
|
||||
|
||||
[SimpleExportColumn(TanorakExportAttributeId, 04, nameof(TantargyResource.TanoraTemaja), typeof(TantargyResource))]
|
||||
[Display(Name = nameof(TantargyResource.TanoraTemaja), ResourceType = typeof(TantargyResource))]
|
||||
public string Tema { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OsztalyCsoport), ResourceType = typeof(TantargyResource))]
|
||||
|
||||
public string OsztCsopNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Helyettesitett), ResourceType = typeof(TantargyResource))]
|
||||
public string IsHelyetesitett_BNAME { get; set; }
|
||||
|
||||
[Display(Name = nameof(AdminisztracioResource.EgyediNap), ResourceType = typeof(AdminisztracioResource))]
|
||||
public string IsEgyediNap_BNAME { get; set; }
|
||||
|
||||
[SimpleExportColumn(TanorakExportAttributeId, 05, nameof(OrarendResource.NaplozasDatuma), typeof(OrarendResource), DateTimeToStringPattern = Core.Constants.ToStringPattern.HungarianDateTimeWithoutSeconds)]
|
||||
[Display(Name = nameof(OrarendResource.NaplozasDatuma), ResourceType = typeof(OrarendResource))]
|
||||
public DateTime? NaplozasDatuma { get; set; }
|
||||
|
||||
public TanorakGridModel() { }
|
||||
|
||||
public TanorakGridModel(TanorakItemCo itemCo)
|
||||
{
|
||||
ID = itemCo.Id.ToString();
|
||||
OraKezdete = itemCo.OraKezdete;
|
||||
OraSorsz = itemCo.OraSorsz;
|
||||
EvesSorsz = itemCo.EvesSorsz;
|
||||
TanarNev = itemCo.TanarNev;
|
||||
Tema = itemCo.Tema;
|
||||
NaplozasDatuma = itemCo.NaplozasDatuma;
|
||||
}
|
||||
}
|
||||
}
|
44
KretaWeb/Areas/Tantargy/Models/TanorakSearchModel.cs
Normal file
44
KretaWeb/Areas/Tantargy/Models/TanorakSearchModel.cs
Normal file
|
@ -0,0 +1,44 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Logic.Naplozas.Elokeszites;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TanorakSearchModel
|
||||
{
|
||||
[Display(Name = nameof(TantargyResource.IdoszakKezdete), ResourceType = typeof(TantargyResource))]
|
||||
public DateTime? IdoszakKezdete { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.IdoszakVege), ResourceType = typeof(TantargyResource))]
|
||||
public DateTime? IdoszakVege { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OsztalyCsoport), ResourceType = typeof(TantargyResource))]
|
||||
public int? OsztalyCsoportId { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Helyettesitett), ResourceType = typeof(TantargyResource))]
|
||||
public int? Helyetesitett { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Tanar), ResourceType = typeof(TantargyResource))]
|
||||
public int? TanarId { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Tantargy), ResourceType = typeof(TantargyResource))]
|
||||
public int? TantargyId { get; set; }
|
||||
|
||||
public DateTime? OraKezdete { get; set; }
|
||||
|
||||
public int? SzervezetTipusId_TanorakSearch { get; set; }
|
||||
|
||||
public TanorakSearchModel(int? szervezetTipusId = null)
|
||||
{
|
||||
SzervezetTipusId_TanorakSearch = szervezetTipusId;
|
||||
}
|
||||
|
||||
public void Fill(NaplozasElokeszitesModel model)
|
||||
{
|
||||
OsztalyCsoportId = model.OraAdat.OsztalyCsoportId;
|
||||
TantargyId = model.OraAdat.TantargyId;
|
||||
OraKezdete = model.OraAdat.OraKezdete;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyFelosztasAdatokModel
|
||||
{
|
||||
public string MunkakorTipus { get; set; }
|
||||
public string FoglalkozasTipus { get; set; }
|
||||
public string FoglalkozasKategoria { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.AlkalmazottNev), ResourceType = typeof(TantargyResource))]
|
||||
public string MunkavallaloNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.MunkakorTipus), ResourceType = typeof(TantargyResource))]
|
||||
public string MunkakorTipusNev
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(MunkakorTipus) ? string.Empty : Convert.ToInt32(MunkakorTipus).GetDisplayName<MunkakorTipusEnum>(ClaimData.SelectedTanevID.Value);
|
||||
}
|
||||
}
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OsztalyCsoport), ResourceType = typeof(TantargyResource))]
|
||||
public string Csoport { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Tantargy), ResourceType = typeof(TantargyResource))]
|
||||
public string Tantargynev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.FoglalkozasTipus), ResourceType = typeof(TantargyResource))]
|
||||
public string FoglalkozasTipusNev
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(FoglalkozasTipus) ? string.Empty : Convert.ToInt32(FoglalkozasTipus).GetDisplayName<FoglalkozasTipusEnum>(ClaimData.SelectedTanevID.Value);
|
||||
}
|
||||
}
|
||||
|
||||
[Display(Name = nameof(TantargyResource.HetiOraszam), ResourceType = typeof(TantargyResource))]
|
||||
public string HetiOraszam { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.FoglakozasHelye), ResourceType = typeof(TantargyResource))]
|
||||
public string FoglalkozasHelye { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Tanev), ResourceType = typeof(TantargyResource))]
|
||||
public string Tanev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Oraszamkorrekcio), ResourceType = typeof(TantargyResource))]
|
||||
public string OsszevontOra { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.NemzetisegiOra), ResourceType = typeof(TantargyResource))]
|
||||
public string NemzetisegiOra { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyfelosztasResource.MegbizasiOraszam), ResourceType = typeof(TantargyfelosztasResource))]
|
||||
public string MegbizasiOraszam { get; set; }
|
||||
|
||||
[Display(Name = nameof(OrarendResource.Tulora), ResourceType = typeof(OrarendResource))]
|
||||
public string TuloraSzam { get; set; }
|
||||
|
||||
public bool IsFromSzervezet { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
using Kreta.BusinessLogic.Interfaces;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyFelosztasFelvetelGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
|
||||
public string OsztalyCsoport { get; set; }
|
||||
|
||||
public string Tantargy { get; set; }
|
||||
|
||||
public string Oraszam { get; set; }
|
||||
|
||||
public string Tuloraszam { get; set; }
|
||||
|
||||
public bool OsszevontOra { get; set; }
|
||||
|
||||
public string OsszevontOra_BNAME { get; set; }
|
||||
|
||||
public bool NemzetisegiOra { get; set; }
|
||||
|
||||
public string NemzetisegiOra_BNAME { get; set; }
|
||||
|
||||
public string MegbizasiOraszam { get; set; }
|
||||
|
||||
public bool Valid { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyFelosztasFelveteleModel
|
||||
{
|
||||
public TantargyFelosztasFelveteleModel()
|
||||
{
|
||||
TanarList = new List<SelectListItem>();
|
||||
}
|
||||
|
||||
public List<SelectListItem> TanarList { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Tanar), ResourceType = typeof(TantargyResource))]
|
||||
public int? TanarId { get; set; }
|
||||
|
||||
public bool IsFromSzervezet { get; set; }
|
||||
|
||||
public int? DualisKepzesTantargyId { get; set; }
|
||||
|
||||
public string ApiControllerName { get; set; }
|
||||
}
|
||||
}
|
101
KretaWeb/Areas/Tantargy/Models/TantargyFelosztasGridModel.cs
Normal file
101
KretaWeb/Areas/Tantargy/Models/TantargyFelosztasGridModel.cs
Normal file
|
@ -0,0 +1,101 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Core.CustomAttributes;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyFelosztasGridModel : IKretaIdentity
|
||||
{
|
||||
#region Fields
|
||||
|
||||
public const string TantargyFelosztasExportAttributeId = nameof(TantargyFelosztasExportAttributeId);
|
||||
public const string DualisTantargyFelosztasExportAttributeId = nameof(DualisTantargyFelosztasExportAttributeId);
|
||||
|
||||
#endregion
|
||||
|
||||
public TantargyFelosztasGridModel() { }
|
||||
|
||||
public TantargyFelosztasGridModel(TantargyfelosztasItemCo itemCo)
|
||||
{
|
||||
ID = itemCo.Id.ToString();
|
||||
Tanar = itemCo.TanarNev;
|
||||
TanarElotagNelkul = itemCo.TanarNevElotagNelkul;
|
||||
Tanev = itemCo.TanevNev;
|
||||
OsztalyCsoport = itemCo.OsztalyCsoportNev;
|
||||
Tantargy = itemCo.TantargyNev;
|
||||
Oraszam = itemCo.Oraszam;
|
||||
OsszevontOra_BNAME = itemCo.IsOsszevontOra.GetDisplayName();
|
||||
TtfKorrekcioOraszam = itemCo.TtfKorrekcioOraszam;
|
||||
NemzetisegiOra_BNAME = itemCo.IsNemzetisegiOra.GetDisplayName();
|
||||
MegbizasiOraszam = itemCo.MegbizasiOraszam;
|
||||
TuloraSzam = itemCo.Tuloraszam;
|
||||
DualisKepzohelyNeve = itemCo.DualisKepzohelyNeve;
|
||||
DualisKepzohelyAdoszama = itemCo.DualisKepzohelyAdoszama;
|
||||
RogzitoId = itemCo.RogzitoId;
|
||||
IsSzerkesztheto = itemCo.IsSzerkesztheto;
|
||||
}
|
||||
|
||||
public string ID { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyfelosztasResource.AlkalmazottNeve), ResourceType = typeof(TantargyfelosztasResource))]
|
||||
[SimpleExportColumn(TantargyFelosztasExportAttributeId, 00, nameof(TantargyfelosztasResource.AlkalmazottNeve), typeof(TantargyfelosztasResource))]
|
||||
[SimpleExportColumn(DualisTantargyFelosztasExportAttributeId, 00, nameof(TantargyfelosztasResource.AlkalmazottNeve), typeof(TantargyfelosztasResource))]
|
||||
public string Tanar { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyfelosztasResource.AlkalmazottNeve), ResourceType = typeof(TantargyfelosztasResource))]
|
||||
public string TanarElotagNelkul { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyfelosztasResource.Tanev), ResourceType = typeof(TantargyfelosztasResource))]
|
||||
[SimpleExportColumn(TantargyFelosztasExportAttributeId, 01, nameof(TantargyfelosztasResource.Tanev), typeof(TantargyfelosztasResource))]
|
||||
[SimpleExportColumn(DualisTantargyFelosztasExportAttributeId, 01, nameof(TantargyfelosztasResource.Tanev), typeof(TantargyfelosztasResource))]
|
||||
public string Tanev { get; set; }
|
||||
|
||||
[Display(Name = nameof(OsztalyCsoportResource.OsztalyCsoport), ResourceType = typeof(OsztalyCsoportResource))]
|
||||
[SimpleExportColumn(TantargyFelosztasExportAttributeId, 02, nameof(OsztalyCsoportResource.OsztalyCsoport), typeof(OsztalyCsoportResource))]
|
||||
[SimpleExportColumn(DualisTantargyFelosztasExportAttributeId, 02, nameof(OsztalyCsoportResource.OsztalyCsoport), typeof(OsztalyCsoportResource))]
|
||||
public string OsztalyCsoport { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyfelosztasResource.Tantargy), ResourceType = typeof(TantargyfelosztasResource))]
|
||||
[SimpleExportColumn(TantargyFelosztasExportAttributeId, 03, nameof(TantargyfelosztasResource.Tantargy), typeof(TantargyfelosztasResource))]
|
||||
[SimpleExportColumn(DualisTantargyFelosztasExportAttributeId, 03, nameof(TantargyfelosztasResource.Tantargy), typeof(TantargyfelosztasResource))]
|
||||
public string Tantargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyfelosztasResource.HetiOraszam), ResourceType = typeof(TantargyfelosztasResource))]
|
||||
[SimpleExportColumn(TantargyFelosztasExportAttributeId, 08, nameof(TantargyfelosztasResource.HetiOraszam), typeof(TantargyfelosztasResource), AggregateFunction = ExcelAggregateFunctionEnum.SUM)]
|
||||
public double Oraszam { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Oraszamkorrekcio), ResourceType = typeof(TantargyResource))]
|
||||
[SimpleExportColumn(TantargyFelosztasExportAttributeId, 04, nameof(TantargyResource.Oraszamkorrekcio), typeof(TantargyResource))]
|
||||
public string OsszevontOra_BNAME { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.NemzetisegiOra), ResourceType = typeof(TantargyResource))]
|
||||
[SimpleExportColumn(TantargyFelosztasExportAttributeId, 05, nameof(TantargyResource.NemzetisegiOra), typeof(TantargyResource))]
|
||||
public string NemzetisegiOra_BNAME { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyfelosztasResource.MegbizasiOraszam), ResourceType = typeof(TantargyfelosztasResource))]
|
||||
[SimpleExportColumn(TantargyFelosztasExportAttributeId, 06, nameof(TantargyfelosztasResource.MegbizasiOraszam), typeof(TantargyfelosztasResource))]
|
||||
public double MegbizasiOraszam { get; set; }
|
||||
|
||||
[Display(Name = nameof(OrarendResource.Tulora), ResourceType = typeof(OrarendResource))]
|
||||
[SimpleExportColumn(TantargyFelosztasExportAttributeId, 07, nameof(OrarendResource.Tulora), typeof(OrarendResource))]
|
||||
public double TuloraSzam { get; set; }
|
||||
|
||||
public double TtfKorrekcioOraszam { get; set; }
|
||||
|
||||
[Display(Name = nameof(AlkalmazottResource.DualisKepzohelyNeve), ResourceType = typeof(AlkalmazottResource))]
|
||||
[SimpleExportColumn(DualisTantargyFelosztasExportAttributeId, 04, nameof(AlkalmazottResource.DualisKepzohelyNeve), typeof(AlkalmazottResource))]
|
||||
public string DualisKepzohelyNeve { get; set; }
|
||||
|
||||
[Display(Name = nameof(AlkalmazottResource.DualisKepzohelyAdoszama), ResourceType = typeof(AlkalmazottResource))]
|
||||
[SimpleExportColumn(DualisTantargyFelosztasExportAttributeId, 05, nameof(AlkalmazottResource.DualisKepzohelyAdoszama), typeof(AlkalmazottResource))]
|
||||
public string DualisKepzohelyAdoszama { get; set; }
|
||||
|
||||
public int RogzitoId { get; set; }
|
||||
|
||||
public bool IsSzerkesztheto { get; set; }
|
||||
}
|
||||
}
|
94
KretaWeb/Areas/Tantargy/Models/TantargyFelosztasModel.cs
Normal file
94
KretaWeb/Areas/Tantargy/Models/TantargyFelosztasModel.cs
Normal file
|
@ -0,0 +1,94 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers.SystemSettings;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Attributes;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyFelosztasModel
|
||||
{
|
||||
public TantargyFelosztasModel()
|
||||
{
|
||||
if (ClaimData.IsVegyes)
|
||||
{
|
||||
SearchFeladatKategoriaId = new SystemSettingsHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetSystemSettingValue<int>(RendszerBeallitasTipusEnum.Default_Feladat_Kategoria);
|
||||
}
|
||||
}
|
||||
|
||||
[Display(Name = nameof(OsztalyCsoportResource.EllatottKoznevelesiFeladatTipus), ResourceType = typeof(OsztalyCsoportResource))]
|
||||
public int? SearchFeladatKategoriaId { get; set; }
|
||||
|
||||
public int IntezmenyId { get; set; }
|
||||
|
||||
[Display(Name = nameof(OsztalyCsoportResource.OsztalyCsoport), ResourceType = typeof(OsztalyCsoportResource))]
|
||||
public int? SearchOsztalCsoport { get; set; } /// TODO (Dev.Kornél): Typo
|
||||
|
||||
[Display(Name = nameof(AdminisztracioResource.Tantargy), ResourceType = typeof(AdminisztracioResource))]
|
||||
public int? SearchTantargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyfelosztasResource.TanarPedagogusValasztasa), ResourceType = typeof(TantargyfelosztasResource))]
|
||||
public int? SearchTanar { get; set; }
|
||||
|
||||
[KretaDisplayName(442)]
|
||||
public int? SearchEvfolyam { get; set; }
|
||||
|
||||
[KretaDisplayName(254)/*Heti óraszám*/]
|
||||
[KretaRange(0, Kreta.Core.Constants.General.TantargyfelosztasImportMaxOraszam)]
|
||||
public double? SearchOraszam { get; set; }
|
||||
|
||||
[KretaDisplayName(90)/*Feladatellátási hely*/]
|
||||
public int? SearchFeladatellatasihely { get; set; }
|
||||
|
||||
[KretaDisplayName(255)/*Foglalkozas Typusa*/]
|
||||
public int? SearchFoglalkozasTipusa { get; set; }
|
||||
|
||||
public bool ElfogadottTTF { get; set; }
|
||||
|
||||
public bool ElfogadottESL { get; set; }
|
||||
|
||||
public bool VeglegesTTF { get; set; }
|
||||
|
||||
public bool VeglegesESL { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyfelosztasResource.Osztalybontasokkal), ResourceType = typeof(TantargyfelosztasResource))]
|
||||
public bool Osztalybontasokkal { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyfelosztasResource.KapcsolodoCsoportokkal), ResourceType = typeof(TantargyfelosztasResource))]
|
||||
public bool KapcsolodoCsoportokkal { get; set; }
|
||||
|
||||
public bool IsFromSzervezet { get; set; }
|
||||
|
||||
[Display(Name = nameof(AlkalmazottResource.DualisKepzohelyNeve), ResourceType = typeof(AlkalmazottResource))]
|
||||
public string DualisKepzohelyNeve { get; set; }
|
||||
|
||||
[Display(Name = nameof(AlkalmazottResource.DualisKepzohelyAdoszama), ResourceType = typeof(AlkalmazottResource))]
|
||||
public string DualisKepzohelyAdoszama { get; set; }
|
||||
|
||||
public string ControllerName { get; set; }
|
||||
|
||||
public string ApiControllerName { get; set; }
|
||||
|
||||
public TantargyFelosztasKeresesCo ConvertToCo()
|
||||
{
|
||||
return new TantargyFelosztasKeresesCo()
|
||||
{
|
||||
Feladatellatasihely = SearchFeladatellatasihely,
|
||||
FeladatKategoriaId = SearchFeladatKategoriaId,
|
||||
IsKapcsolodoCsoportokkal = KapcsolodoCsoportokkal,
|
||||
IsOsztalybontasokkal = Osztalybontasokkal,
|
||||
Oraszam = SearchOraszam,
|
||||
OsztalyCsoport = SearchOsztalCsoport,
|
||||
Tanar = SearchTanar,
|
||||
Tantargy = SearchTantargy,
|
||||
IsFromSzervezet = IsFromSzervezet,
|
||||
DualisKepzohelyNeve = DualisKepzohelyNeve,
|
||||
DualisKepzohelyAdoszama = DualisKepzohelyAdoszama,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyFelosztasModositasaModel
|
||||
{
|
||||
public TantargyFelosztasModositasaModel()
|
||||
{
|
||||
Modosithato = true;
|
||||
}
|
||||
|
||||
public int Id { get; set; }
|
||||
|
||||
[KretaRequired(typeof(TantargyResource), nameof(TantargyResource.TanarKivalasztasaKotelezo))]
|
||||
[Range(1, int.MaxValue, ErrorMessageResourceType = typeof(TantargyResource), ErrorMessageResourceName = nameof(TantargyResource.TanarKivalasztasaKotelezo))]
|
||||
[Display(Name = nameof(TantargyResource.TanarPedagogusValasztasa), ResourceType = typeof(TantargyResource))]
|
||||
public int TanarId { get; set; }
|
||||
|
||||
[KretaRequired(typeof(TantargyResource), nameof(TantargyResource.TantargyMegadasaKotelezo))]
|
||||
[Range(1, int.MaxValue, ErrorMessageResourceType = typeof(TantargyResource), ErrorMessageResourceName = nameof(TantargyResource.TantargyMegadasaKotelezo))]
|
||||
[Display(Name = nameof(TantargyResource.Tantargy), ResourceType = typeof(TantargyResource))]
|
||||
public int TantargyId { get; set; }
|
||||
|
||||
[KretaRequired(typeof(TantargyResource), nameof(TantargyResource.OsztalyVagyCsoportMegadasaKotelezo))]
|
||||
[Range(1, int.MaxValue, ErrorMessageResourceType = typeof(TantargyResource), ErrorMessageResourceName = nameof(TantargyResource.OsztalyVagyCsoportMegadasaKotelezo))]
|
||||
[Display(Name = nameof(TantargyResource.OsztalyCsoport), ResourceType = typeof(TantargyResource))]
|
||||
public int CsoportID { get; set; }
|
||||
|
||||
[KretaRequired(typeof(TantargyResource), nameof(TantargyResource.OraszamMegadasaKotelezo))]
|
||||
[Range(0, Core.Constants.General.TantargyfelosztasImportMaxOraszam, ErrorMessageResourceType = typeof(TantargyResource), ErrorMessageResourceName = nameof(TantargyResource.AzOraszamCsakEgy0Es50KozottiSzamLehet))]
|
||||
[Display(Name = nameof(TantargyResource.HetiOraszam), ResourceType = typeof(TantargyResource))]
|
||||
public double Oraszam { get; set; }
|
||||
|
||||
[KretaRequired(typeof(TantargyResource), nameof(TantargyResource.TuloraMegadasaKotelezo))]
|
||||
[Range(0, Core.Constants.General.TantargyfelosztasImportMaxOraszam, ErrorMessageResourceType = typeof(TantargyResource), ErrorMessageResourceName = nameof(TantargyResource.ATuloraCsakEgy0Es50KozottiSzamLehet))]
|
||||
[Display(Name = nameof(OrarendResource.Tulora), ResourceType = typeof(OrarendResource))]
|
||||
public double TuloraSzam { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Oraszamkorrekcio), ResourceType = typeof(TantargyResource))]
|
||||
public bool OsszevontOra { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.NemzetisegiOra), ResourceType = typeof(TantargyResource))]
|
||||
public bool NemzetisegiOra { get; set; }
|
||||
|
||||
[Range(0, Core.Constants.General.TantargyfelosztasImportMaxOraszam, ErrorMessageResourceType = typeof(TantargyResource), ErrorMessageResourceName = nameof(TantargyResource.AMegbizasiCsakEgy0Es50KozottiSzamLehet))]
|
||||
[Display(Name = nameof(TantargyfelosztasResource.MegbizasiOraszam), ResourceType = typeof(TantargyfelosztasResource))]
|
||||
public double MegbizasiOraszam { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.VisszamenolegesModositas), ResourceType = typeof(TantargyResource))]
|
||||
public bool VisszamenolegesModositas { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.KapcsolodoOrarendiOrakModositasa), ResourceType = typeof(TantargyResource))]
|
||||
public bool KapcsolodoOrarendiOrakModositasa { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.FoglalkozasTipusa), ResourceType = typeof(TantargyResource))]
|
||||
public int? TipusId { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.ErtekelesekSzama), ResourceType = typeof(TantargyResource))]
|
||||
public int ErtekelesekSzama { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TanorakSzama), ResourceType = typeof(TantargyResource))]
|
||||
public int TanorakSzama { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.DiakokSzama), ResourceType = typeof(TantargyResource))]
|
||||
public int DiakokSzama { get; set; }
|
||||
|
||||
public bool Modosithato { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.MulasztasokSzama), ResourceType = typeof(TantargyResource))]
|
||||
public int MulasztasokSzama { get; set; }
|
||||
|
||||
public bool IsFromSzervezet { get; set; } = false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Attributes;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyFoglalkozasaiGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
|
||||
[Display(Name = nameof(OsztalyCsoportResource.OsztalyCsoport), ResourceType = typeof(OsztalyCsoportResource))]
|
||||
public string OsztalyCsoport { get; set; }
|
||||
|
||||
[KretaDisplayName(2614)] /*Oktató*/
|
||||
public string Tanar { get; set; }
|
||||
|
||||
[KretaDisplayName(254)] /*Heti óraszám*/
|
||||
public float Oraszam { get; set; }
|
||||
|
||||
[KretaDisplayName(255)] /*Foglalkozás típusa*/
|
||||
public string Tipus_DNAME { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyMegtartottTanoraiGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OsztalyCsoport), ResourceType = typeof(TantargyResource))]
|
||||
public string OsztalyCsoport { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OraSorszama), ResourceType = typeof(TantargyResource))]
|
||||
public int EvesSorszam { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Tema), ResourceType = typeof(TantargyResource))]
|
||||
public string Tema { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Datum), ResourceType = typeof(TantargyResource))]
|
||||
public DateTime Datum { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OraSzama), ResourceType = typeof(TantargyResource))]
|
||||
public int Oraszam { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyMinositeseiOsztalyAtlagokGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OsztalycsoportNeve), ResourceType = typeof(TantargyResource))]
|
||||
public string OsztalyCsoportNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Atlag), ResourceType = typeof(TantargyResource))]
|
||||
public string Atlag { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyMinositeseiTanarAtlagokGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.PedagogusNeve), ResourceType = typeof(TantargyResource))]
|
||||
public string TanarNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Atlag), ResourceType = typeof(TantargyResource))]
|
||||
public string Atlag { get; set; }
|
||||
}
|
||||
}
|
77
KretaWeb/Areas/Tantargy/Models/TantargyModModel.cs
Normal file
77
KretaWeb/Areas/Tantargy/Models/TantargyModModel.cs
Normal file
|
@ -0,0 +1,77 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyModModel : TabStripModel
|
||||
{
|
||||
public TantargyModModel()
|
||||
{
|
||||
}
|
||||
|
||||
public int? ID { get; set; }
|
||||
public string TantargyakIDArray { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TantargyNev), ResourceType = typeof(TantargyResource))]
|
||||
public string TantargyNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.KivalasztottTantargyak), ResourceType = typeof(TantargyResource))]
|
||||
public string TantargyakNevArray { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TantargyKategoria), ResourceType = typeof(TantargyResource))]
|
||||
public int? TargyKategoria { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TantargyKategoria), ResourceType = typeof(TantargyResource))]
|
||||
public string TargyKategoriaNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.ESLTantargyKategoria), ResourceType = typeof(TantargyResource))]
|
||||
public int? ESLTargyKategoria { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.ESLTantargyKategoria), ResourceType = typeof(TantargyResource))]
|
||||
public string ESLTargyKategoriaNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.KapcsolodoFotantargyNeve), ResourceType = typeof(TantargyResource))]
|
||||
public int? FoTargyID { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Fotantargy), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsFoTargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.KapcsolodoFotantargyNeve), ResourceType = typeof(TantargyResource))]
|
||||
public string FoTargyNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.GyakorlatiTargy), ResourceType = typeof(TantargyResource))]
|
||||
public int? GyakorlatiTargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.AltantargykentBizonyitvanyban), ResourceType = typeof(TantargyResource))]
|
||||
public int? AltantargyNyomtatvanyban { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.AngolTantargyNev), ResourceType = typeof(TantargyResource))]
|
||||
public string TantargyAngolNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.NemetTantargyNev), ResourceType = typeof(TantargyResource))]
|
||||
public string TantargyNemetNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Sorszam), ResourceType = typeof(TantargyResource))]
|
||||
[Range(Core.Constants.MinMaxValues.MinTantargySorszam, Core.Constants.MinMaxValues.MaxTantargySorszam, ErrorMessageResourceName = nameof(ErrorResource.Ervenytelen), ErrorMessageResourceType = typeof(ErrorResource))]
|
||||
public int? Sorszam { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.AmiTargy), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsAmiTargyMod { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.MSZGtantargy), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsMszgTargyMod { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.KollegiumiTargy), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsKollegiumiTargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.FelnottoktatasTargy), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsFelnottOktatasTargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.NincsBeloleOra), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsNincsBeloleOraMod { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.IsEgymi), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsEgymiTargyMod { get; set; }
|
||||
}
|
||||
}
|
269
KretaWeb/Areas/Tantargy/Models/TantargyModel.cs
Normal file
269
KretaWeb/Areas/Tantargy/Models/TantargyModel.cs
Normal file
|
@ -0,0 +1,269 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Foolproof;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.TabStrip;
|
||||
using Kreta.Web.Models;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyModel
|
||||
{
|
||||
public TantargyModel()
|
||||
{
|
||||
TabList = new List<TabStripItemModel>();
|
||||
RadioButtonItems = new List<SelectListItem>();
|
||||
ErtekelesKorlatozasList = GetErtekelesKorlatozasList();
|
||||
AmiKepzesiJellemzokModel = new AmiKepzesiJellemzokModel();
|
||||
}
|
||||
|
||||
public int? ID { get; set; }
|
||||
|
||||
public List<TabStripItemModel> TabList { get; set; }
|
||||
public List<SelectListItem> RadioButtonItems { get; set; }
|
||||
public AmiKepzesiJellemzokModel AmiKepzesiJellemzokModel { get; set; }
|
||||
|
||||
public List<int> NemzetiDokumentumNyelvek { get; set; } = new List<int>();
|
||||
|
||||
public bool NemzetiDokumentumNyelvekMegjelenjenek
|
||||
{
|
||||
get
|
||||
{
|
||||
return NemzetiDokumentumNyelvek.Any(x => x == ((int)AnyanyelvEnum.horvat) || x == ((int)AnyanyelvEnum.szerb) || x == ((int)AnyanyelvEnum.roman));
|
||||
}
|
||||
}
|
||||
[Display(Name = nameof(TantargyResource.Tanev), ResourceType = typeof(TantargyResource))]
|
||||
public string Tanev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TantargyNev), ResourceType = typeof(TantargyResource))]
|
||||
[Required(ErrorMessageResourceName = nameof(TantargyResource.ATantargyNevMegadasaKotelezo), ErrorMessageResourceType = typeof(TantargyResource))]
|
||||
[MaxLength(150, ErrorMessageResourceName = nameof(TantargyResource.ATantargyNeveMaximum150KarakterLehet), ErrorMessageResourceType = typeof(TantargyResource))]
|
||||
public string TantargyNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TantargyRovidnev), ResourceType = typeof(TantargyResource))]
|
||||
[MaxLength(20, ErrorMessageResourceName = nameof(TantargyResource.ATantargyRovidNevMaximum20KarakterLehet), ErrorMessageResourceType = typeof(TantargyResource))]
|
||||
public string TantargyRovidNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TantargyKategoria), ResourceType = typeof(TantargyResource))]
|
||||
[Required(ErrorMessageResourceName = nameof(TantargyResource.ATantargyKategoriaMegadasaKotelezo), ErrorMessageResourceType = typeof(TantargyResource))]
|
||||
public int? TargyKategoria { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TantargyKategoria), ResourceType = typeof(TantargyResource))]
|
||||
public string TargyKategoriaNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.ESLTantargyKategoria), ResourceType = typeof(TantargyResource))]
|
||||
[Required(ErrorMessageResourceName = nameof(TantargyResource.AzESLTargyKategoriaMegadasaKotelezo), ErrorMessageResourceType = typeof(TantargyResource))]
|
||||
public int? ESLTargyKategoria { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.ESLTantargyKategoria), ResourceType = typeof(TantargyResource))]
|
||||
public string ESLTargyKategoriaNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.KapcsolodoFotantargyNeve), ResourceType = typeof(TantargyResource))]
|
||||
[RequiredIf(nameof(FoTargyIDValidationAttr), true, ErrorMessageResourceName = nameof(TantargyResource.KapcsolodoFotantargyNevenekMegadasaKotelezo), ErrorMessageResourceType = typeof(TantargyResource))]
|
||||
public int? FoTargyID { get; set; }
|
||||
|
||||
public bool FoTargyIDValidationAttr => AltantargyNyomtatvanyban || !IsFoTargy;
|
||||
|
||||
[Display(Name = nameof(TantargyResource.KapcsolodoFotantargyNeve), ResourceType = typeof(TantargyResource))]
|
||||
public string FoTargyNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Fotantargy), ResourceType = typeof(TantargyResource))]
|
||||
public bool IsFoTargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Fotantargy), ResourceType = typeof(TantargyResource))]
|
||||
public string IsFoTargy_BNAME { get { return Kreta.Framework.StringResourcesUtil.GetString(IsFoTargy ? 133 : 134); } } //Igen, Nem
|
||||
|
||||
[Display(Name = nameof(TantargyResource.KollegiumiTargy), ResourceType = typeof(TantargyResource))]
|
||||
public bool IsKollegiumiTargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.KollegiumiTargy), ResourceType = typeof(TantargyResource))]
|
||||
public string IsKollegiumiTargy_BNAME { get { return Kreta.Framework.StringResourcesUtil.GetString(IsKollegiumiTargy ? 133 : 134); } } //Igen, Nem
|
||||
|
||||
[Display(Name = nameof(TantargyResource.GyakorlatiTargy), ResourceType = typeof(TantargyResource))]
|
||||
public bool GyakorlatiTargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.GyakorlatiTargy), ResourceType = typeof(TantargyResource))]
|
||||
public string GyakorlatiTargy_BNAME { get { return Kreta.Framework.StringResourcesUtil.GetString(GyakorlatiTargy ? 133 : 134); } } //Igen, Nem
|
||||
|
||||
[Display(Name = nameof(TantargyResource.AmiTargy), ResourceType = typeof(TantargyResource))]
|
||||
public bool IsAmiTargyMod { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.MSZGtantargy), ResourceType = typeof(TantargyResource))]
|
||||
public bool IsMszgTargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.MSZGtantargy), ResourceType = typeof(TantargyResource))]
|
||||
public string IsMszgTargy_BNAME { get { return Kreta.Framework.StringResourcesUtil.GetString(IsMszgTargy ? 133 : 134); } } //Igen, Nem
|
||||
|
||||
[Display(Name = nameof(TantargyResource.AmiTargy), ResourceType = typeof(TantargyResource))]
|
||||
public string IsAmiTargy_BNAME { get { return Kreta.Framework.StringResourcesUtil.GetString(IsAmiTargyMod ? 133 : 134); } } //Igen, Nem
|
||||
|
||||
[Display(Name = nameof(TantargyResource.FelnottoktatasTargy), ResourceType = typeof(TantargyResource))]
|
||||
public bool IsFelnottOktatasTargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.AltantargykentBizonyitvanyban), ResourceType = typeof(TantargyResource))]
|
||||
public bool AltantargyNyomtatvanyban { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.AltantargykentBizonyitvanyban), ResourceType = typeof(TantargyResource))]
|
||||
public string AltantargyNyomtatvanyban_BNAME { get { return Kreta.Framework.StringResourcesUtil.GetString(AltantargyNyomtatvanyban ? 133 : 134); } } //Igen, Nem
|
||||
|
||||
[Display(Name = nameof(TantargyResource.FelnottoktatasTargy), ResourceType = typeof(TantargyResource))]
|
||||
public bool IsFelnottOktatas { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.FelnottoktatasTargy), ResourceType = typeof(TantargyResource))]
|
||||
public string IsFelnottOktatas_BNAME { get { return Kreta.Framework.StringResourcesUtil.GetString(IsFelnottOktatas ? 133 : 134); } } //Igen, Nem
|
||||
|
||||
[Display(Name = nameof(TantargyResource.IsEgymi), ResourceType = typeof(TantargyResource))]
|
||||
public bool IsEgymi { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.IsEgymi), ResourceType = typeof(TantargyResource))]
|
||||
public string IsEgymi_BNAME { get { return Kreta.Framework.StringResourcesUtil.GetString(IsEgymi ? 133 : 134); } } //Igen, Nem
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TanulmanyiAtlagbaNemSzamitBele), ResourceType = typeof(TantargyResource))]
|
||||
public bool IsTanulmanyiAtlagbaNemSzamit { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TanulmanyiAtlagbaNemSzamitBele), ResourceType = typeof(TantargyResource))]
|
||||
public string IsTanulmanyiAtlagbaNemSzamit_BNAME { get { return Kreta.Framework.StringResourcesUtil.GetString(IsTanulmanyiAtlagbaNemSzamit ? 133 : 134); } } //Igen, Nem
|
||||
|
||||
[Display(Name = nameof(TantargyResource.NincsBeloleOra), ResourceType = typeof(TantargyResource))]
|
||||
public bool IsNincsBeloleOraMod { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.NincsBeloleOra), ResourceType = typeof(TantargyResource))]
|
||||
public string IsNincsBeloleOra_BNAME { get { return Kreta.Framework.StringResourcesUtil.GetString(IsNincsBeloleOraMod ? 133 : 134); } } //Igen, Nem
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OsztalynaplobanNemJelenikMeg), ResourceType = typeof(TantargyResource))]
|
||||
public bool IsOsztalynaplobanNemJelenikMeg { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OsztalynaplobanNemJelenikMeg), ResourceType = typeof(TantargyResource))]
|
||||
public string IsOsztalynaplobanNemJelenikMeg_BNAME { get { return IsOsztalynaplobanNemJelenikMeg ? IgenNemEnum.Igen.GetDisplayName(ClaimData.SelectedTanevID.Value) : IgenNemEnum.Nem.GetDisplayName(ClaimData.SelectedTanevID.Value); } }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OsztalynaplobanMegjelenik), ResourceType = typeof(TantargyResource))]
|
||||
public bool IsOsztalyOrarendjebenMegjelenik { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OsztalynaplobanMegjelenik), ResourceType = typeof(TantargyResource))]
|
||||
public string IsOsztalyokOrarendjebenMegjelenik_BNAME { get { return Kreta.Framework.StringResourcesUtil.GetString(IsOsztalyOrarendjebenMegjelenik ? 133 : 134); } } //Igen, Nem
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OsztalyEsTanuloiOrarendbenNemJelenikMeg), ResourceType = typeof(TantargyResource))]
|
||||
public bool IsOsztalyEsTanuloiOrarendbenNemJelenikMeg { get => !IsOsztalyOrarendjebenMegjelenik; set => IsOsztalyOrarendjebenMegjelenik = !value; }
|
||||
|
||||
[MaxLength(150, ErrorMessageResourceName = nameof(TantargyResource.ABizonyitvanybanMegjelenoNevMaximum150KarakterLehet), ErrorMessageResourceType = typeof(TantargyResource))]
|
||||
[Display(Name = nameof(TantargyResource.BizonyitvanybanMegjelenoNev), ResourceType = typeof(TantargyResource))]
|
||||
public string NevNyomtatvanyban { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.AngolTantargyNev), ResourceType = typeof(TantargyResource))]
|
||||
[MaxLength(150, ErrorMessageResourceName = nameof(TantargyResource.ATantargyNeveMaximum150KarakterLehet), ErrorMessageResourceType = typeof(TantargyResource))]
|
||||
public string TantargyAngolNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.NemetTantargyNev), ResourceType = typeof(TantargyResource))]
|
||||
[MaxLength(150, ErrorMessageResourceName = nameof(TantargyResource.ATantargyNeveMaximum150KarakterLehet), ErrorMessageResourceType = typeof(TantargyResource))]
|
||||
public string TantargyNemetNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.HorvatTantargyNev), ResourceType = typeof(TantargyResource))]
|
||||
[MaxLength(150, ErrorMessageResourceName = nameof(TantargyResource.ATantargyNeveMaximum150KarakterLehet), ErrorMessageResourceType = typeof(TantargyResource))]
|
||||
public string TantargyHorvatNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.RomanTantargyNev), ResourceType = typeof(TantargyResource))]
|
||||
[MaxLength(150, ErrorMessageResourceName = nameof(TantargyResource.ATantargyNeveMaximum150KarakterLehet), ErrorMessageResourceType = typeof(TantargyResource))]
|
||||
public string TantargyRomanNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.SzerbTantargyNev), ResourceType = typeof(TantargyResource))]
|
||||
[MaxLength(150, ErrorMessageResourceName = nameof(TantargyResource.ATantargyNeveMaximum150KarakterLehet), ErrorMessageResourceType = typeof(TantargyResource))]
|
||||
public string TantargySzerbNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Sorszam), ResourceType = typeof(TantargyResource))]
|
||||
[Range(Core.Constants.MinMaxValues.MinTantargySorszam, Core.Constants.MinMaxValues.MaxTantargySorszam, ErrorMessageResourceName = nameof(ErrorResource.Ervenytelen), ErrorMessageResourceType = typeof(ErrorResource))]
|
||||
public int Sorszam { get; set; }
|
||||
|
||||
[Display(Name = nameof(CommonResource.Megjegyzes), ResourceType = typeof(CommonResource))]
|
||||
[StringLength(500, ErrorMessageResourceName = nameof(CommonResource.AMegjegyzesSzovegeNemLehet500KarakternelHosszabb), ErrorMessageResourceType = typeof(ErrorResource))]
|
||||
public string Megjegyzes { get; set; }
|
||||
|
||||
public List<int> GyakorlatigenyessegKategoriak { get { return Kreta.Core.Constants.GyakorlatigenyessegTargyKategoriaTipusIdList; } }
|
||||
|
||||
public bool IsGyakorlatigenyessegKategoria { get { return ClaimData.IsSelectedTanev20_21OrLater && ClaimData.IsSzakkepzoIntezmeny && TargyKategoria.HasValue && GyakorlatigenyessegKategoriak.Contains(TargyKategoria.Value); } }
|
||||
|
||||
[RequiredIf(nameof(IsGyakorlatigenyessegKategoria), true, ErrorMessageResourceName = nameof(TantargyResource.GyakorlatigenyessegKitolteseKotelezo), ErrorMessageResourceType = typeof(TantargyResource))]
|
||||
[KretaRange(1, 99, ErrorMessageResourceName = nameof(TantargyResource.SzazalekosErtekNincsAMegengedettTartomanyban), ErrorMessageResourceType = typeof(TantargyResource))]
|
||||
[Display(Name = nameof(TantargyResource.Gyakorlatigenyesseg), ResourceType = typeof(TantargyResource))]
|
||||
public int? Gyakorlatigenyesseg { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.ErtekelesKorlatozas), ResourceType = typeof(TantargyResource))]
|
||||
public List<int> ErtekelesKorlatozasIdList { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.ErtekelesKorlatozas), ResourceType = typeof(TantargyResource))]
|
||||
public string ErtekelesKorlatozasStringList
|
||||
{
|
||||
get
|
||||
{
|
||||
var result = new List<string>();
|
||||
foreach (var item in ErtekelesKorlatozasList)
|
||||
{
|
||||
if (int.TryParse(item.Value, out int id))
|
||||
{
|
||||
if (ErtekelesKorlatozasIdList.Contains(id))
|
||||
{
|
||||
result.Add(item.Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return string.Join(", ", result);
|
||||
}
|
||||
}
|
||||
|
||||
public List<SelectListItem> ErtekelesKorlatozasList { get; set; }
|
||||
|
||||
private List<SelectListItem> GetErtekelesKorlatozasList()
|
||||
{
|
||||
var dictionary = EnumExtensions.EnumToDictionary<ErtekelesKorlatozas>(ClaimData.SelectedTanevID.Value, false, true);
|
||||
return dictionary.ToSelectListItemList();
|
||||
}
|
||||
|
||||
public void SetDefaultsForNew()
|
||||
{
|
||||
TargyKategoria = (int)TargyKategoriaTipusEnum.na;
|
||||
|
||||
IsFoTargy = true;
|
||||
|
||||
Sorszam = Core.Constants.MinMaxValues.MinTantargySorszam;
|
||||
|
||||
IsTanulmanyiAtlagbaNemSzamit = false;
|
||||
|
||||
ErtekelesKorlatozasIdList = Enum.GetValues(typeof(ErtekelesKorlatozas)).Cast<ErtekelesKorlatozas>().Cast<int>().ToList();
|
||||
|
||||
IsOsztalynaplobanNemJelenikMeg = false;
|
||||
IsOsztalyOrarendjebenMegjelenik = true;
|
||||
|
||||
AmiKepzesiJellemzokModel.MufajTipusId = (int)MufajTipusEnum.na;
|
||||
AmiKepzesiJellemzokModel.TanszakTipusId = (int)TanszakTipusEnum.na;
|
||||
}
|
||||
|
||||
public void SetErtekelesKorlatozasIdList(TantargyCO co)
|
||||
{
|
||||
ErtekelesKorlatozasIdList = new List<int>();
|
||||
|
||||
if (co.IsOsztalyzattalErtekelheto)
|
||||
{
|
||||
ErtekelesKorlatozasIdList.Add((int)ErtekelesKorlatozas.OsztalyzattalErtekelheto);
|
||||
}
|
||||
|
||||
if (co.IsSzovegesenErtekelheto)
|
||||
{
|
||||
ErtekelesKorlatozasIdList.Add((int)ErtekelesKorlatozas.SzovegesenErtekelheto);
|
||||
}
|
||||
|
||||
if (co.IsSzazalekosanErtekelheto)
|
||||
{
|
||||
ErtekelesKorlatozasIdList.Add((int)ErtekelesKorlatozas.SzazalekosanErtekelheto);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyOrarendiOraiGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OrarendiNapHetirendje), ResourceType = typeof(TantargyResource))]
|
||||
public string Hetirend_DNAME { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.HetNapja), ResourceType = typeof(TantargyResource))]
|
||||
public string Hetnapja_DNAME { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Ora), ResourceType = typeof(TantargyResource))]
|
||||
public int Ora { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OsztalyCsoport), ResourceType = typeof(TantargyResource))]
|
||||
public string OsztCsop { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Helyiseg), ResourceType = typeof(TantargyResource))]
|
||||
public string Terem { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.ErvenyessegKezdete), ResourceType = typeof(TantargyResource))]
|
||||
public DateTime ErvenyessegKezdete { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.ErvenyessegVege), ResourceType = typeof(TantargyResource))]
|
||||
public DateTime ErvenyessegVege { get; set; }
|
||||
}
|
||||
}
|
152
KretaWeb/Areas/Tantargy/Models/TantargySearchModel.cs
Normal file
152
KretaWeb/Areas/Tantargy/Models/TantargySearchModel.cs
Normal file
|
@ -0,0 +1,152 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargySearchModel
|
||||
{
|
||||
public TantargySearchModel()
|
||||
{
|
||||
}
|
||||
|
||||
public List<int> NemzetiDokumentumNyelvek { get; set; } = new List<int>();
|
||||
|
||||
public bool NemzetiDokumentumNyelvekMegjelenjenek
|
||||
{
|
||||
get
|
||||
{
|
||||
return NemzetiDokumentumNyelvek.Any(x => x == ((int)AnyanyelvEnum.horvat) || x == ((int)AnyanyelvEnum.szerb) || x == ((int)AnyanyelvEnum.roman));
|
||||
}
|
||||
}
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TantargyNev), ResourceType = typeof(TantargyResource))]
|
||||
public string TantargyNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TantargyKategoria), ResourceType = typeof(TantargyResource))]
|
||||
public int? TantargyKategoriaID { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.ESLTantargyKategoria), ResourceType = typeof(TantargyResource))]
|
||||
public int? EslTargykategoriaTipusId { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.ErtekelesKorlatozas), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsErtekelesKorlatozva { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Fotantargy), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsFotargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.KapcsolodoFotantargyNeve), ResourceType = typeof(TantargyResource))]
|
||||
public int? KeresesFotargyID { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.GyakorlatiTargy), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsGyakorlati { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TantargyRovidnev), ResourceType = typeof(TantargyResource))]
|
||||
public string RovidNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.BizonyitvanybanMegjelenoNev), ResourceType = typeof(TantargyResource))]
|
||||
public string BizonyitvanyNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.AltantargykentBizonyitvanyban), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsAltantargykentBizonyitvanyban { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.NincsBeloleOra), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsNincsBeloleOra { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OsztalynaplobanNemJelenikMeg), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsOsztalyNaplobanNemJelenikMeg { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OsztalyokOrarendjebenMegjelenik), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsOsztalyokOrarendjebenMegjelenik { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TantagyAtlagbaSzamitasa), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsTanulmanyiAtlagbaSzamit { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.AmiTargy), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsAmiTargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.KollegiumiTargy), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsKollegiumTargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.EgymiTargy), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsEgymiTargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.FelnottoktatasTargy), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsFelnottoktatasTargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.AngolTantargyNev), ResourceType = typeof(TantargyResource))]
|
||||
public string AngolNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.NemetTantargyNev), ResourceType = typeof(TantargyResource))]
|
||||
public string NemetNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.HorvatTantargyNev), ResourceType = typeof(TantargyResource))]
|
||||
public string HorvatNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.RomanTantargyNev), ResourceType = typeof(TantargyResource))]
|
||||
public string RomanNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.SzerbTantargyNev), ResourceType = typeof(TantargyResource))]
|
||||
public string SzerbNev { get; set; }
|
||||
|
||||
public bool? nincsTantargykategoria { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.MSZGtantargy), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsMszgTargyFltr { get; set; }
|
||||
|
||||
public bool IsFromSzervezet { get; set; }
|
||||
|
||||
public bool IsSzakkepzo { get; set; }
|
||||
|
||||
public static TantargySearchModel SetFilterTantargySearchModel(string filter)
|
||||
{
|
||||
TantargySearchModel result = new TantargySearchModel();
|
||||
|
||||
switch (filter)
|
||||
{
|
||||
case "nincskategoria":
|
||||
result.nincsTantargykategoria = true;
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public TantargySearchCo ConvertToCo()
|
||||
{
|
||||
return new TantargySearchCo()
|
||||
{
|
||||
BizonyitvanyNev = this.BizonyitvanyNev,
|
||||
IsAltantargykentBizonyitvanyban = this.IsAltantargykentBizonyitvanyban,
|
||||
IsNincsBeloleOra = this.IsNincsBeloleOra,
|
||||
IsOsztalyNaplobanNemJelenikMeg = this.IsOsztalyNaplobanNemJelenikMeg,
|
||||
IsOsztalyokOrarendjebenMegjelenik = this.IsOsztalyokOrarendjebenMegjelenik,
|
||||
IsTanulmanyiAtlagbaSzamit = this.IsTanulmanyiAtlagbaSzamit,
|
||||
IsAmiTargy = this.IsAmiTargy,
|
||||
IsKollegiumTargy = this.IsKollegiumTargy,
|
||||
IsEgymiTargy = this.IsEgymiTargy,
|
||||
IsFelnottoktatasTargy = this.IsFelnottoktatasTargy,
|
||||
IsMszgTargy = this.IsMszgTargyFltr,
|
||||
AngolNev = this.AngolNev,
|
||||
NemetNev = this.NemetNev,
|
||||
HorvatNev = this.HorvatNev,
|
||||
RomanNev = this.RomanNev,
|
||||
SzerbNev = this.SzerbNev,
|
||||
IsErtekelesKorlatozva = this.IsErtekelesKorlatozva,
|
||||
IsFotargy = this.IsFotargy,
|
||||
IsGyakorlati = this.IsGyakorlati,
|
||||
KeresesFotargyID = this.KeresesFotargyID,
|
||||
nincsTantargykategoria = this.nincsTantargykategoria,
|
||||
RovidNev = this.RovidNev,
|
||||
TantargyKategoriaID = this.TantargyKategoriaID,
|
||||
EslTargykategoriaTipusId = this.EslTargykategoriaTipusId,
|
||||
TantargyNev = this.TantargyNev,
|
||||
IsFromSzervezet = IsFromSzervezet,
|
||||
IsSzakkepzo = IsSzakkepzo
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyTanmeneteiGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OsztalyCsoport), ResourceType = typeof(TantargyResource))]
|
||||
public string OsztalyCsoport { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Pedagogus), ResourceType = typeof(TantargyResource))]
|
||||
public string Tanar { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.OraSorszama), ResourceType = typeof(TantargyResource))]
|
||||
public float Oraszam { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Tema), ResourceType = typeof(TantargyResource))]
|
||||
public string Tema { get; set; }
|
||||
}
|
||||
}
|
77
KretaWeb/Areas/Tantargy/Models/TantargyakGridModel.cs
Normal file
77
KretaWeb/Areas/Tantargy/Models/TantargyakGridModel.cs
Normal file
|
@ -0,0 +1,77 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Core.CustomAttributes;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyakGridModel : IKretaIdentity
|
||||
{
|
||||
public const string TantargyakExportAttributeId = nameof(TantargyakExportAttributeId);
|
||||
|
||||
public TantargyakGridModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public TantargyakGridModel(TantargyItemCo itemCo)
|
||||
{
|
||||
ID = itemCo.Id.ToString();
|
||||
TantargyNev = itemCo.Nev;
|
||||
TanevNev = itemCo.TanevNev;
|
||||
TargyKategoria = itemCo.TargykategoriaTipusId;
|
||||
TargyKategoriaNev = itemCo.TargykategoriaTipusNev;
|
||||
FoTargyNev = itemCo.FotargyNev;
|
||||
IsFotargy_BNAME = itemCo.IsFotargy.GetDisplayName();
|
||||
GyakorlatiTargy = itemCo.IsGyakorlatiTargy;
|
||||
GyakorlatiTargy_BNAME = itemCo.IsGyakorlatiTargy.GetDisplayName();
|
||||
IsTanulmanyiAtlagbaSzamit_BNAME = itemCo.IsTanulmanyiAtlagbaSzamit.GetDisplayName();
|
||||
IsErtekelesKorlatozva_BNAME = itemCo.IsErtekelesKorlatozva.GetDisplayName();
|
||||
Sorszam = itemCo.Sorszam;
|
||||
}
|
||||
|
||||
public string ID { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Nev), ResourceType = typeof(TantargyResource))]
|
||||
[SimpleExportColumn(TantargyakExportAttributeId, 00, nameof(TantargyResource.Nev), typeof(TantargyResource))]
|
||||
public string TantargyNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Tanev), ResourceType = typeof(TantargyResource))]
|
||||
[SimpleExportColumn(TantargyakExportAttributeId, 01, nameof(TantargyResource.Tanev), typeof(TantargyResource))]
|
||||
public string TanevNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Nev), ResourceType = typeof(TantargyResource))]
|
||||
public int TargyKategoria { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TantargyKategoria), ResourceType = typeof(TantargyResource))]
|
||||
[SimpleExportColumn(TantargyakExportAttributeId, 02, nameof(TantargyResource.TantargyKategoria), typeof(TantargyResource))]
|
||||
public string TargyKategoriaNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.KapcsolodoFotantargyNeve), ResourceType = typeof(TantargyResource))]
|
||||
[SimpleExportColumn(TantargyakExportAttributeId, 04, nameof(TantargyResource.KapcsolodoFotantargyNeve), typeof(TantargyResource))]
|
||||
public string FoTargyNev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Fotantargy), ResourceType = typeof(TantargyResource))]
|
||||
[SimpleExportColumn(TantargyakExportAttributeId, 03, nameof(TantargyResource.Fotantargy), typeof(TantargyResource))]
|
||||
public string IsFotargy_BNAME { get; set; }
|
||||
|
||||
public bool GyakorlatiTargy { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.GyakorlatiTargy), ResourceType = typeof(TantargyResource))]
|
||||
[SimpleExportColumn(TantargyakExportAttributeId, 05, nameof(TantargyResource.GyakorlatiTargy), typeof(TantargyResource))]
|
||||
public string GyakorlatiTargy_BNAME { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TantagyAtlagbaSzamitasa), ResourceType = typeof(TantargyResource))]
|
||||
[SimpleExportColumn(TantargyakExportAttributeId, 06, nameof(TantargyResource.TantagyAtlagbaSzamitasa), typeof(TantargyResource))]
|
||||
public string IsTanulmanyiAtlagbaSzamit_BNAME { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.ErtekelesKorlatozas), ResourceType = typeof(TantargyResource))]
|
||||
[SimpleExportColumn(TantargyakExportAttributeId, 07, nameof(TantargyResource.ErtekelesKorlatozas), typeof(TantargyResource))]
|
||||
public string IsErtekelesKorlatozva_BNAME { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Sorszam), ResourceType = typeof(TantargyResource))]
|
||||
public int Sorszam { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantargyfelosztasMentesModel
|
||||
{
|
||||
public int? TantargyID { get; set; }
|
||||
|
||||
public int? CsoportID { get; set; }
|
||||
|
||||
public int? TipusID { get; set; }
|
||||
public double? Oraszam { get; set; }
|
||||
public bool OsszevontOra { get; set; }
|
||||
public bool NemzetisegiOra { get; set; }
|
||||
public double? MegbizasiOraszam { get; set; }
|
||||
public double? TuloraSzam { get; set; }
|
||||
}
|
||||
}
|
36
KretaWeb/Areas/Tantargy/Models/TantervModModel.cs
Normal file
36
KretaWeb/Areas/Tantargy/Models/TantervModModel.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantervModModel
|
||||
{
|
||||
public TantervModModel()
|
||||
{
|
||||
}
|
||||
|
||||
public int? ID { get; set; }
|
||||
public string TantervIDArray { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TantervNev), ResourceType = typeof(TantargyResource))]
|
||||
public string Nev { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.KivalasztottTantervek), ResourceType = typeof(TantargyResource))]
|
||||
public string TantervNevArray { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.TantervreJellemzőCsoportipus), ResourceType = typeof(TantargyResource))]
|
||||
public int? CsoportTipusa { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.KezdoEvfolyam), ResourceType = typeof(TantargyResource))]
|
||||
public int? Evfolyamtol { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.VegzoEvfolyam), ResourceType = typeof(TantargyResource))]
|
||||
public int? Evfolyamig { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.KerettantervreEpulo), ResourceType = typeof(TantargyResource))]
|
||||
public int? KerettantervreEpulo { get; set; }
|
||||
|
||||
[Display(Name = nameof(TantargyResource.Kerettanterv), ResourceType = typeof(TantargyResource))]
|
||||
public int? IsKerettanterv { get; set; }
|
||||
}
|
||||
}
|
64
KretaWeb/Areas/Tantargy/Models/TantervModel.cs
Normal file
64
KretaWeb/Areas/Tantargy/Models/TantervModel.cs
Normal file
|
@ -0,0 +1,64 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Attributes;
|
||||
using Kreta.Web.Helpers.TabStrip;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantervModel
|
||||
{
|
||||
public TantervModel()
|
||||
{
|
||||
TabList = new List<TabStripItemModel>();
|
||||
}
|
||||
|
||||
public int? ID { get; set; }
|
||||
public List<TabStripItemModel> TabList { get; set; }
|
||||
|
||||
[KretaDisplayName(1589)] /*Tanterv név*/
|
||||
[KretaRequired(StringResourcesId = 2382/*Tanterv név megadása kötelező!*/)]
|
||||
[StringLength(maximumLength: 255, ErrorMessageResourceName = nameof(ErrorResource.Max255Karakter), ErrorMessageResourceType = typeof(ErrorResource))]
|
||||
public string Nev { get; set; }
|
||||
|
||||
[KretaDisplayName(1590)] /*Tantervre jellemző csoporttípus*/
|
||||
[KretaRequired(StringResourcesId = 2383/*Csoporttípus megadása kötelező!*/)]
|
||||
public int? CsoportTipusa { get; set; }
|
||||
|
||||
[KretaDisplayName(1590)] /*Tantervre jellemző csoporttípus*/
|
||||
public string CsoportTipusaNev { get { return CsoportTipusa.GetDisplayName<CsoportTipusEnum>(ClaimData.SelectedTanevID.Value); } }
|
||||
|
||||
[KretaDisplayName(1591)] /*Kezdő évfolyam*/
|
||||
[KretaRequired(StringResourcesId = 2384/*Kezdő évfolyam megadása kötelező!*/)]
|
||||
public int? Evfolyamtol { get; set; }
|
||||
|
||||
[KretaDisplayName(1591)] /*Kezdő évfolyam*/
|
||||
public string EvfolyamtolNev { get { return Evfolyamtol.GetDisplayName<EvfolyamTipusEnum>(ClaimData.SelectedTanevID.Value); } }
|
||||
|
||||
[KretaDisplayName(1592)] /*Végző évfolyam*/
|
||||
[KretaRequired(StringResourcesId = 2385/*Végző évfolyam megadása kötelező!*/)]
|
||||
public int? Evfolyamig { get; set; }
|
||||
|
||||
[KretaDisplayName(1592)] /*Végző évfolyam*/
|
||||
public string EvfolyamigNev { get { return Evfolyamig.GetDisplayName<EvfolyamTipusEnum>(ClaimData.SelectedTanevID.Value); } }
|
||||
|
||||
[KretaDisplayName(1593)] /*Kerettantervre épülő*/
|
||||
public bool? KerettantervreEpulo { get; set; }
|
||||
|
||||
[KretaDisplayName(1593)] /*Kerettantervre épülő*/
|
||||
public string KerettantervreEpulo_BNAME { get { return Kreta.Framework.StringResourcesUtil.GetString(KerettantervreEpulo.HasValue && KerettantervreEpulo.Value ? 133 : 134); } } //Igen, Nem
|
||||
|
||||
[StringLength(255, ErrorMessageResourceName = nameof(ErrorResource.AMegjegyzesMax255KarakterLehet), ErrorMessageResourceType = typeof(ErrorResource))]
|
||||
[KretaDisplayName(97)] /*Megjegyzés*/
|
||||
public string Megjegyzes { get; set; }
|
||||
|
||||
[KretaDisplayName(670)] /*Kerettanterv*/
|
||||
public bool? IsKerettanterv { get; set; }
|
||||
|
||||
[KretaDisplayName(670)] /*Kerettanterv*/
|
||||
public string IsKerettanterv_BNAME { get { return Kreta.Framework.StringResourcesUtil.GetString(IsKerettanterv.HasValue && IsKerettanterv.Value ? 133 : 134); } } //Igen, Nem
|
||||
}
|
||||
}
|
26
KretaWeb/Areas/Tantargy/Models/TantervSearchModel.cs
Normal file
26
KretaWeb/Areas/Tantargy/Models/TantervSearchModel.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using Kreta.Web.Attributes;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantervSearchModel
|
||||
{
|
||||
[KretaDisplayName(1589)] /*Tanterv név*/
|
||||
public string TantervNev { get; set; }
|
||||
|
||||
[KretaDisplayName(1590)] /*Tantervre jellemző csoporttípus*/
|
||||
public int? JellemzoCsopTipID { get; set; }
|
||||
|
||||
[KretaDisplayName(1591)] /*Kezdő évfolyam*/
|
||||
public int? KezdoEvfolyamID { get; set; }
|
||||
|
||||
[KretaDisplayName(1592)] /*Végző évfolyam*/
|
||||
public int? VegzoEvfolyamID { get; set; }
|
||||
|
||||
[KretaDisplayName(1593)] /*Kerettantervre épülő*/
|
||||
public int? IsKerettantervreEpul { get; set; }
|
||||
public bool IsKovetkezoTanev { get; set; }
|
||||
|
||||
[KretaDisplayName(1593)] /*Kerettantervre épülő*/
|
||||
public int? IsKerettantervSrc { get; set; }
|
||||
}
|
||||
}
|
28
KretaWeb/Areas/Tantargy/Models/TantervekGridModel.cs
Normal file
28
KretaWeb/Areas/Tantargy/Models/TantervekGridModel.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Web.Attributes;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantervekGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
|
||||
[KretaDisplayName(1589)] /*Tanterv név*/
|
||||
public string Nev { get; set; }
|
||||
|
||||
[KretaDisplayName(1590)] /*Tantervre jellemző csoporttípus*/
|
||||
public string CsoportTipusa_DNAME { get; set; }
|
||||
|
||||
[KretaDisplayName(1591)] /*Kezdő évfolyam*/
|
||||
public string Evfolyamtol_DNAME { get; set; }
|
||||
|
||||
[KretaDisplayName(1592)] /*Végző évfolyam*/
|
||||
public string Evfolyamig_DNAME { get; set; }
|
||||
|
||||
[KretaDisplayName(97)] /*Megjegyzés*/
|
||||
public string Megjegyzes { get; set; }
|
||||
|
||||
[KretaDisplayName(670)] /*Kerettanterv*/
|
||||
public string IsKerettanterv_BNAME { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Web.Attributes;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantervekOsztalyokGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
|
||||
[KretaDisplayName(458)] //Osztály neve
|
||||
public string Nev { get; set; }
|
||||
|
||||
[KretaDisplayName(442)] //Évfolyam
|
||||
public string Evfolyam_DNAME { get; set; }
|
||||
|
||||
[KretaDisplayName(3847)] //Létszám
|
||||
public string Letszam { get; set; }
|
||||
}
|
||||
}
|
16
KretaWeb/Areas/Tantargy/Models/TantervekTanulokGridModel.cs
Normal file
16
KretaWeb/Areas/Tantargy/Models/TantervekTanulokGridModel.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Web.Attributes;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Models
|
||||
{
|
||||
public class TantervekTanulokGridModel : IKretaIdentity
|
||||
{
|
||||
public string ID { get; set; }
|
||||
|
||||
[KretaDisplayName(455)] //Tanulo neve
|
||||
public string Nev { get; set; }
|
||||
|
||||
[KretaDisplayName(458)] //Osztály neve
|
||||
public string OsztalyNev { get; set; }
|
||||
}
|
||||
}
|
21
KretaWeb/Areas/Tantargy/TantargyAreaRegistration.cs
Normal file
21
KretaWeb/Areas/Tantargy/TantargyAreaRegistration.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using System.Web.Mvc;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy
|
||||
{
|
||||
public class TantargyAreaRegistration : AreaRegistration
|
||||
{
|
||||
public override string AreaName
|
||||
{
|
||||
get { return "Tantargy"; }
|
||||
}
|
||||
|
||||
public override void RegisterArea(AreaRegistrationContext context)
|
||||
{
|
||||
context.MapRoute(
|
||||
"Tantargy_default",
|
||||
"Tantargy/{controller}/{action}/{id}",
|
||||
new { action = "Index", id = UrlParameter.Optional }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
32
KretaWeb/Areas/Tantargy/Views/OraTerv/DetailGrid.cshtml
Normal file
32
KretaWeb/Areas/Tantargy/Views/OraTerv/DetailGrid.cshtml
Normal file
|
@ -0,0 +1,32 @@
|
|||
@using Kreta.Web.Helpers.Grid;
|
||||
@using Kreta.Web.Areas.Tantargy.Models;
|
||||
@using Kreta.Web.Security;
|
||||
@model int?
|
||||
|
||||
@{
|
||||
var rowFunctions = new List<RowFunction> { };
|
||||
if (!ClaimData.IsSelectedTanevIsElozo)
|
||||
{
|
||||
rowFunctions.Add(new RowFunction { NameResourceId = 116 /*Módosítás*/, ClientAction = "OraTervHelper.openModOraTervTantargyWindow", IconEnum = Kreta.Enums.ManualEnums.GridRowFunctionIconEnum.Modositas });
|
||||
rowFunctions.Add(new RowFunction { NameResourceId = 117 /*Törlés*/, ClientAction = "OraTervHelper.deleteOraTervTantargyConfirmWindow", IconEnum = Kreta.Enums.ManualEnums.GridRowFunctionIconEnum.Torles });
|
||||
}
|
||||
|
||||
var grid = Html.KretaGrid<OraTervDetailGridModel>(
|
||||
name: "TervDetailGrid_" + Model.Value.ToString(),
|
||||
getUrl: new GridApiUrl("OraTervApi", "GetOraTervDetailGrid", new Dictionary<string, string> { { "OraTervId", Model.Value.ToString() } }),
|
||||
useToolBar: false
|
||||
)
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(x => x.Tantargy);
|
||||
columns.Bound(x => x.EvesSorszam).Format("{0:n2}");
|
||||
})
|
||||
.RowFunction(Html, rowFunctions)
|
||||
.Sortable(sortable => sortable
|
||||
.AllowUnsort(true)
|
||||
.SortMode(GridSortMode.MultipleColumn));
|
||||
}
|
||||
|
||||
<div id="partialDetailGrid_@Model.ToString()">
|
||||
@(grid)
|
||||
</div>
|
258
KretaWeb/Areas/Tantargy/Views/OraTerv/Index.cshtml
Normal file
258
KretaWeb/Areas/Tantargy/Views/OraTerv/Index.cshtml
Normal file
|
@ -0,0 +1,258 @@
|
|||
@using Kreta.Framework;
|
||||
@using Kreta.Web.Helpers.Grid;
|
||||
@using Kreta.Web.Areas.Tantargy.Models;
|
||||
@using Kreta.Resources;
|
||||
@using Kreta.Web.Security;
|
||||
@model OraTervSearchModel
|
||||
|
||||
@section AddSearchPanel {
|
||||
@using (Html.SearchPanelSideBar("searchForm", "OraTervGrid"))
|
||||
{
|
||||
@Html.KretaTextBoxFor(x => x.NevSearch).RenderSearchPanelSideBar();
|
||||
@Html.KretaComboBoxFor(x => x.TantervIdSearch, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "OraTervApi", action = "GetTantervList" }), "Text", "Value").AutoBind(true).RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.EvfolyamIdSearch, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "OraTervApi", action = "GetEvfolyamList" }), "Text", "Value").AutoBind(true).RenderSearchPanelSideBar()
|
||||
}
|
||||
}
|
||||
|
||||
<div>
|
||||
@{
|
||||
var rowFunctionList = new List<RowFunction>();
|
||||
var functionCommands = new List<FunctionCommand>();
|
||||
|
||||
if (!ClaimData.IsSelectedTanevIsElozo)
|
||||
{
|
||||
functionCommands.Add(new FunctionCommand { NameResourceId = 3392 /*Óraterv hozzáadása*/, ClientAction = "OraTervHelper.openNewOraTervWindow" });
|
||||
|
||||
rowFunctionList.Add(new RowFunction { NameResourceId = 3393 /*Óraterv tantárgy hozzáadása*/, ClientAction = "OraTervHelper.openNewOraTervTantargyWindow" });
|
||||
rowFunctionList.Add(new RowFunction { NameResourceId = 116 /*Módosítás*/, ClientAction = "OraTervHelper.openModOraTervWindow", IconEnum = Kreta.Enums.ManualEnums.GridRowFunctionIconEnum.Modositas });
|
||||
if (!Model.IsKovetkezoTanev)
|
||||
{
|
||||
rowFunctionList.Add(new RowFunction { NameResourceId = 117 /*Törlés*/, ClientAction = "OraTervHelper.deleteOraTervConfirmWindow", IconEnum = Kreta.Enums.ManualEnums.GridRowFunctionIconEnum.Torles });
|
||||
|
||||
}
|
||||
rowFunctionList.Add(new RowFunction { NameResourceId = 3439 /*Összes tantárgy törlése*/, ClientAction = "OraTervHelper.deleteAllOraTervTantargyConfirmWindow" });
|
||||
}
|
||||
}
|
||||
|
||||
@(
|
||||
Html.KretaGrid<OraTervGridModel>(
|
||||
name: "OraTervGrid",
|
||||
getUrl: new GridApiUrl("OraTervApi", "GetOraTervGrid", new Dictionary<string, string> { }),
|
||||
dataParameterFunction: "searchForm",
|
||||
clientTemplate: "detailGrid-template",
|
||||
allowScrolling: true,
|
||||
clientTemplateUrl: @Url.Action("GetDetailGrid", "OraTerv", new { area = "Tantargy" })
|
||||
)
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.Nev);
|
||||
columns.Bound(c => c.EvFolyam_DNAME);
|
||||
})
|
||||
.RowFunction(Html, rowFunctionList)
|
||||
.FunctionCommand(Html, functionCommands)
|
||||
.AutoBind(false)
|
||||
.Sortable(sortable => sortable
|
||||
.AllowUnsort(true)
|
||||
.SortMode(GridSortMode.MultipleColumn))
|
||||
)
|
||||
</div>
|
||||
|
||||
@Html.KretaGridTemplate("detailGrid-template")
|
||||
|
||||
<script type="text/javascript">
|
||||
var OraTervHelper = (function () {
|
||||
var oraTervHelper = function () { };
|
||||
|
||||
var searchFormName = "searchForm";
|
||||
var gridName = "OraTervGrid";
|
||||
var formName = "OraTervForm";
|
||||
var tantargyFormName = "OraTervTantargyForm";
|
||||
|
||||
var url = {
|
||||
OpenNewOraTervPopUp: "@Url.Action("OpenOraTervNewPopUp", "OraTerv" , new { area = "Tantargy" })",
|
||||
OpenModOraTervPopUp: "@Url.Action("OpenOraTervModPopUp", "OraTerv" , new { area = "Tantargy" })",
|
||||
OpenModOraTervTantargyPopUp: "@Url.Action("OpenOraTervTantargyModPopUp", "OraTerv" , new { area = "Tantargy" })",
|
||||
OpenNewOraTervTargyPopUp: "@Url.Action("OpenOraTervTantargyNewPopUp", "OraTerv" , new { area = "Tantargy" })",
|
||||
SaveOraTerv: "@Url.HttpRouteUrl("ActionApi", new { controller = "OraTervApi", action = "SaveOraTervData" })",
|
||||
SaveOraTervTargy: "@Url.HttpRouteUrl("ActionApi", new { controller = "OraTervApi", action = "AddOraTervTargy" })",
|
||||
DeleteOraTerv: "@Url.HttpRouteUrl("ActionApi", new { controller = "OraTervApi", action = "DeleteOraTerv" })",
|
||||
DeleteOraTervTantargy: "@Url.HttpRouteUrl("ActionApi", new { controller = "OraTervApi", action = "DeleteOraTervTantargy" })",
|
||||
DeleteAllOraTervTantargy: "@Url.HttpRouteUrl("ActionApi", new { controller = "OraTervApi", action = "DeleteAllOraTervTantargy" })"
|
||||
}
|
||||
|
||||
oraTervHelper.openNewOraTervWindow = function (data) {
|
||||
var TantervValue = $('#TantervIdSearch').val();
|
||||
|
||||
if (TantervValue != '' && TantervValue != 0) {
|
||||
var postData = { TantervId: TantervValue };
|
||||
AjaxHelper.DoPost(url.OpenNewOraTervPopUp, postData, popUpNewWindow);
|
||||
}
|
||||
else {
|
||||
KretaWindowHelper.feedbackWindow("HIBA", "@(TantargyResource.OraTervHozzaadasaTantervHiba)", true);
|
||||
}
|
||||
}
|
||||
|
||||
oraTervHelper.newOraTervSave = function () {
|
||||
AjaxHelper.DoPostElement(url.SaveOraTerv, formName, newSaveFeedBackOk);
|
||||
}
|
||||
|
||||
oraTervHelper.newOraTervCancel = function () {
|
||||
KretaWindowHelper.destroyWindow("newOraTervWindow");
|
||||
}
|
||||
|
||||
oraTervHelper.openModOraTervWindow = function (rowData) {
|
||||
var postData = { Id: rowData.ID };
|
||||
AjaxHelper.DoPost(url.OpenModOraTervPopUp, postData, popUpModWindow);
|
||||
}
|
||||
|
||||
oraTervHelper.openModOraTervTantargyWindow = function (rowData) {
|
||||
var postData = { OraTervTantargyId: rowData.ID };
|
||||
AjaxHelper.DoPost(url.OpenModOraTervTantargyPopUp, postData, popUpModTantargyWindow);
|
||||
}
|
||||
|
||||
oraTervHelper.modTantargySave = function () {
|
||||
AjaxHelper.DoPostElement(url.SaveOraTervTargy, tantargyFormName, modSaveTantargyFeedBackOk);
|
||||
}
|
||||
|
||||
oraTervHelper.modTantargyCancel = function () {
|
||||
KretaWindowHelper.destroyWindow("modOraTervTantargyWindow");
|
||||
}
|
||||
|
||||
oraTervHelper.modOraTervSave = function () {
|
||||
AjaxHelper.DoPostElement(url.SaveOraTerv, formName, modSaveFeedBackOk);
|
||||
}
|
||||
|
||||
oraTervHelper.modOraTervCancel = function () {
|
||||
KretaWindowHelper.destroyWindow("modOraTervWindow");
|
||||
}
|
||||
|
||||
oraTervHelper.openNewOraTervTantargyWindow = function (rowData) {
|
||||
var postData = { OraTervId: rowData.ID };
|
||||
AjaxHelper.DoPost(url.OpenNewOraTervTargyPopUp, postData, popUpNewTantargyWindow);
|
||||
}
|
||||
|
||||
oraTervHelper.newTantargySave = function () {
|
||||
AjaxHelper.DoPostElement(url.SaveOraTervTargy, tantargyFormName, newSaveTantargyFeedBackOk);
|
||||
}
|
||||
|
||||
oraTervHelper.newTantargyCancel = function () {
|
||||
KretaWindowHelper.destroyWindow("newOraTervTantargyWindow");
|
||||
}
|
||||
|
||||
oraTervHelper.deleteOraTervConfirmWindow = function (rowData) {
|
||||
KretaWindowHelper.confirmWindow("@(CommonResource.Kerdes)", "@(CommonResource.BiztosanTorli)", deleteOraTerv, rowData.ID);
|
||||
}
|
||||
|
||||
oraTervHelper.deleteAllOraTervTantargyConfirmWindow = function (rowData) {
|
||||
KretaWindowHelper.confirmWindow("@(CommonResource.Kerdes)", "@(CommonResource.BiztosanTorli)", deleteAllOraTervTantargy, rowData.ID);
|
||||
}
|
||||
|
||||
oraTervHelper.deleteOraTervTantargyConfirmWindow = function (rowData) {
|
||||
KretaWindowHelper.confirmWindow("@(CommonResource.Kerdes)", "@(CommonResource.BiztosanTorli)", deleteOraTervTantargy, rowData.OratervTargyID);
|
||||
}
|
||||
|
||||
function popUpNewWindow(data) {
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@(StringResourcesUtil.GetString(3392))"; /*Óraterv hozzáadása*/
|
||||
config.content = data;
|
||||
config.maxWidth = "600px";
|
||||
config.height = "250px";
|
||||
|
||||
var modal = KretaWindowHelper.createWindow("newOraTervWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
}
|
||||
|
||||
function newSaveFeedBackOk() {
|
||||
//KretaWindowHelper.destroyWindow("newOraTervWindow");
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function popUpModWindow(data) {
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@(StringResourcesUtil.GetString(3394))"; /*Óraterv módosítása*/
|
||||
config.content = data;
|
||||
config.width = "500px";
|
||||
config.height = "250px";
|
||||
|
||||
var modal = KretaWindowHelper.createWindow("modOraTervWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
}
|
||||
|
||||
function modSaveFeedBackOk() {
|
||||
//KretaWindowHelper.destroyWindow("modOraTervWindow");
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function deleteOraTerv(data) {
|
||||
AjaxHelper.DoPost(url.DeleteOraTerv, data, deleteOraTervResponseOk, deleteOraTervResponseFail);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function deleteOraTervResponseOk() {
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function deleteOraTervResponseFail(data) {
|
||||
var message = data.responseJSON.Message;
|
||||
KretaWindowHelper.feedbackWindow(Globalization.Hiba /*HIBA*/, message, true, KretaWindowHelper.destroyAllWindow);
|
||||
}
|
||||
|
||||
function popUpNewTantargyWindow(data) {
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@(StringResourcesUtil.GetString(3395))"; /*Óraterv tantárgy hozzáadása*/
|
||||
config.content = data;
|
||||
config.width = "500px";
|
||||
config.height = "250px";
|
||||
|
||||
var modal = KretaWindowHelper.createWindow("newOraTervTantargyWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
}
|
||||
|
||||
function newSaveTantargyFeedBackOk() {
|
||||
//KretaWindowHelper.destroyWindow("newOraTervTantargyWindow");
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function deleteAllOraTervTantargy(data) {
|
||||
AjaxHelper.DoPost(url.DeleteAllOraTervTantargy, data, deleteAllOraTervTantargyResponseOk);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function deleteAllOraTervTantargyResponseOk() {
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function deleteOraTervTantargy(data) {
|
||||
AjaxHelper.DoPost(url.DeleteOraTervTantargy, data, deleteOraTervTantargyResponseOk);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function deleteOraTervTantargyResponseOk() {
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function popUpModTantargyWindow(data) {
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@(StringResourcesUtil.GetString(3867))"; /*Óraterv tantárgy módosítása*/
|
||||
config.content = data;
|
||||
config.width = "500px";
|
||||
config.height = "250px";
|
||||
|
||||
var modal = KretaWindowHelper.createWindow("modOraTervTantargyWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
}
|
||||
|
||||
function modSaveTantargyFeedBackOk() {
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
return oraTervHelper;
|
||||
})();
|
||||
</script>
|
|
@ -0,0 +1,18 @@
|
|||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@model OraTervTargyModel
|
||||
|
||||
<div class="container-fluid details">
|
||||
@using (Html.KretaForm("OraTervTantargyForm"))
|
||||
{
|
||||
@Html.KretaValidationSummary()
|
||||
|
||||
@Html.HiddenFor(x => x.OratervId)
|
||||
@Html.HiddenFor(x => x.OratervTantargyId)
|
||||
<div class="row">
|
||||
@Html.KretaNumericFor(x => x.EvesOraszam).Max(Kreta.Core.Constants.MinMaxValues.OratervTantargyEvesOraszamMaxValue).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.TantargyId, Model.TantargyList).RenderWithName()
|
||||
</div>
|
||||
}
|
||||
</div>
|
18
KretaWeb/Areas/Tantargy/Views/OraTerv/OraTerv_Bevitel.cshtml
Normal file
18
KretaWeb/Areas/Tantargy/Views/OraTerv/OraTerv_Bevitel.cshtml
Normal file
|
@ -0,0 +1,18 @@
|
|||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@model OraTervModel
|
||||
|
||||
<div class="container-fluid details">
|
||||
@using (Html.KretaForm("OraTervForm"))
|
||||
{
|
||||
@Html.KretaValidationSummary()
|
||||
|
||||
@Html.HiddenFor(x => x.TantervId)
|
||||
@Html.HiddenFor(x => x.OratervId)
|
||||
<div class="row">
|
||||
@Html.KretaTextBoxFor(x => x.Nev).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.EvfolyamId, Model.EvfolyamList).RenderWithName()
|
||||
</div>
|
||||
}
|
||||
</div>
|
|
@ -0,0 +1,45 @@
|
|||
@using Kreta.Web.Areas.Tantargy.Models;
|
||||
|
||||
@model TantargyFelosztasAdatokModel
|
||||
|
||||
<div class="container-fluid details">
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.MunkavallaloNev, 3, 3)
|
||||
@if (!Model.IsFromSzervezet)
|
||||
{
|
||||
@Html.KretaLabelFor(x => x.MunkakorTipusNev, 3, 3)
|
||||
}
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.FoglalkozasTipusNev, 3, 3)
|
||||
@if (!Model.IsFromSzervezet)
|
||||
{
|
||||
@Html.KretaLabelFor(x => x.FoglalkozasHelye, 3, 3)
|
||||
}
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.Csoport, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.Tantargynev, 3, 3)
|
||||
</div>
|
||||
@if (!Model.IsFromSzervezet)
|
||||
{
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.HetiOraszam, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.TuloraSzam, 3, 3)
|
||||
</div>
|
||||
}
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.Tanev, 3, 3)
|
||||
@if (!Model.IsFromSzervezet)
|
||||
{
|
||||
@Html.KretaLabelFor(x => x.MegbizasiOraszam, 3, 3)
|
||||
}
|
||||
</div>
|
||||
@if (!Model.IsFromSzervezet)
|
||||
{
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.NemzetisegiOra, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.OsszevontOra, 3, 3)
|
||||
</div>
|
||||
}
|
||||
</div>
|
|
@ -0,0 +1,270 @@
|
|||
@using Kreta.Web.Helpers.Grid
|
||||
@using Kreta.Web.Helpers
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@using Kreta.Resources
|
||||
|
||||
@model TantargyFelosztasFelveteleModel
|
||||
|
||||
<div class="container-fluid details">
|
||||
@{
|
||||
using (Html.KretaForm("tantargyFelosztasForm"))
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-6">
|
||||
@Html.KretaComboBoxFor(x => x.TanarId, Model.TanarList, htmlAttributes: new Dictionary<string, object>() { { "class", "fullwidth" } }, onChangeFunction: "TantargyFelosztasHelper.onDataChange()", isSingleElementSet: !Model.IsFromSzervezet).AutoBind(true).RenderWithName()
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@{
|
||||
var grid = Html.KretaGrid<TantargyFelosztasFelvetelGridModel>(
|
||||
"TantargyFelosztasFelvetelGrid",
|
||||
new GridApiUrl(Model.ApiControllerName, "GetTantargyFelosztasokFelvetel", new Dictionary<string, string>() { { "IsFromSzervezet", Model.IsFromSzervezet.ToString() } }),
|
||||
allowFilterable: false,
|
||||
dataBoundAdditionalFunction: "FelosztasFelvetelHelper.disableTantargyColumn();",
|
||||
useToolBar: false
|
||||
).TableHtmlAttributes(new {@class = "tableLayoutFixed"});
|
||||
grid.ConditionColumn(OsztalyCsoportResource.OsztalyCsoport, m => m.Valid,
|
||||
"<span style = \"float: right;\"> #: OsztalyCsoport # </span>", grid.GroupedComboBoxForColumnTemplate(Html, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetOsztalyCsoportListByEvfolyam", isDualisKepzohelyiCsoport = Model.IsFromSzervezet }), m => m.OsztalyCsoport, changeEvent: Model.IsFromSzervezet ? "FelosztasFelvetelHelper.osztalyCsoportChanged" : string.Empty));
|
||||
grid.ConditionColumn(TantargyResource.Tantargy, m => m.Valid,
|
||||
"<span style = \"float: right;\"> #: Tantargy # </span>", grid.ComboBoxForColumnTemplate(Html, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Model.ApiControllerName, action = "GetTantargyakDD" }), m => m.Tantargy));
|
||||
|
||||
if (!Model.IsFromSzervezet)
|
||||
{
|
||||
grid.ConditionColumn(OrarendResource.Oraszam, m => m.Valid,
|
||||
"<span style = \"float: right;\"> #: Oraszam # </span>", grid.NumericBoxForColumnTemplate(Html, m => m.Oraszam, max: Kreta.Core.Constants.General.TantargyfelosztasImportMaxOraszam, precision: 2, step: 0.25, min: 0), 100);
|
||||
grid.ConditionColumn(OrarendResource.Tulora, m => m.Valid,
|
||||
"<span style = \"float: right;\"> #: Tuloraszam # </span>", grid.NumericBoxForColumnTemplate(Html, m => m.Tuloraszam, max: Kreta.Core.Constants.General.TantargyfelosztasImportMaxOraszam, precision: 2, step: 0.25, min: 0), 100);
|
||||
grid.ConditionColumn(TantargyfelosztasResource.MegbizasiOraszam, m => m.Valid,
|
||||
"<span style = \"float: right;\"> #: MegbizasiOraszam # </span>", grid.NumericBoxForColumnTemplate(Html, m => m.MegbizasiOraszam, max: Kreta.Core.Constants.General.TantargyfelosztasImportMaxOraszam, precision: 2, step: 0.25, min: 0), 160);
|
||||
grid.ConditionColumn(TantargyResource.Oraszamkorrekcio, m => m.Valid,
|
||||
"<span style = \"float: left;\"> #: OsszevontOra_BNAME # </span>", grid.CheckBoxColumnTemplate("OsszevontOra", m => m.OsszevontOra, true), 100);
|
||||
grid.ConditionColumn(TantargyResource.NemzetisegiOra, m => m.Valid,
|
||||
"<span style = \"float: left;\"> #: NemzetisegiOra_BNAME # </span>", grid.CheckBoxColumnTemplate("NemzetisegiOra", m => m.NemzetisegiOra, true), 140);
|
||||
|
||||
}
|
||||
grid.Sortable(sortable => sortable
|
||||
.AllowUnsort(true)
|
||||
.SortMode(GridSortMode.MultipleColumn));
|
||||
}
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12">
|
||||
@(grid)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var FelosztasFelvetelHelper = (function() {
|
||||
var felosztasFelvetelHelper = function() {}
|
||||
|
||||
felosztasFelvetelHelper.Savefelosztas = function () {
|
||||
|
||||
if (checkTanar() && checkdataset()) {
|
||||
var modRows = KretaGridHelper.getModifiedRows("TantargyFelosztasFelvetelGrid");
|
||||
var felosztasData = [modRows.length];
|
||||
|
||||
if (!CommonUtils.parseBool("@Model.IsFromSzervezet")) {
|
||||
$.each(modRows, function (index, value) {
|
||||
felosztasData[index] = {
|
||||
CsoportID: value.input[0].value,
|
||||
TantargyID: value.input[1].value,
|
||||
Oraszam: value.input[2].value.replace(".", ","),
|
||||
TuloraSzam: value.input[3].value.replace(".", ","),
|
||||
MegbizasiOraszam: value.input[4].value.replace(".", ","),
|
||||
OsszevontOra: value.input[5].value,
|
||||
NemzetisegiOra: value.input[6].value
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.each(modRows, function (index, value) {
|
||||
felosztasData[index] = {
|
||||
CsoportID: value.input[0].value,
|
||||
TantargyID: value.input[1].value,
|
||||
}
|
||||
});
|
||||
}
|
||||
AjaxHelper.DoPost(
|
||||
"@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new {controller = Model.ApiControllerName, action = "SaveFelosztas" })",
|
||||
{ tanarID: $("#TanarId").val(), tanevId: $("#Tanev").val(), IsFromSzervezet: "@Model.IsFromSzervezet", felosztasok: felosztasData },
|
||||
sikeresMentes,
|
||||
sikertelenMentes);
|
||||
}
|
||||
}
|
||||
|
||||
felosztasFelvetelHelper.ValidateFelosztas = function () {
|
||||
|
||||
var allRows = KretaGridHelper.getAllRows("TantargyFelosztasFelvetelGrid");
|
||||
var modRows = KretaGridHelper.getModifiedRows("TantargyFelosztasFelvetelGrid");
|
||||
var vanegyezes = false;
|
||||
if (!CommonUtils.parseBool("@Model.IsFromSzervezet")) {
|
||||
$.each(modRows, function (index, value) {
|
||||
if (!vanegyezes) {
|
||||
$.each(allRows, function (i, v) {
|
||||
if (!vanegyezes &&
|
||||
value.input[0].value == v.OsztalyCsoportID &&
|
||||
value.input[1].value == v.TantargyID) {
|
||||
vanegyezes = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.each(modRows, function (index, value) {
|
||||
if (!vanegyezes) {
|
||||
$.each(allRows, function (i, v) {
|
||||
if (!vanegyezes &&
|
||||
value.input[0].value == v.OsztalyCsoportID &&
|
||||
value.input[1].value == v.TantargyID) {
|
||||
vanegyezes = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (vanegyezes) {
|
||||
KretaWindowHelper.confirmWindow("@(CommonResource.Kerdes)",
|
||||
"@(TantargyResource.ARogziteniKivantTantargyfelosztasSorokMarFelvitelreKerultSzeretneFrissiteniAJelenlegiTantargyfelosztast)",
|
||||
FelosztasFelvetelHelper.Savefelosztas);
|
||||
} else {
|
||||
FelosztasFelvetelHelper.Savefelosztas();
|
||||
}
|
||||
}
|
||||
|
||||
function sikeresMentes() {
|
||||
KretaWindowHelper.successFeedBackWindow(closeWindows,
|
||||
"@(CommonResource.AMuveletSikeresenMegtortentAModositastKuldjeElAFentartojanak)");
|
||||
}
|
||||
|
||||
function sikertelenMentes(e) {
|
||||
var msg = "@ErrorResource.SikertelenMentes";
|
||||
if (e.responseJSON.Message && e.responseJSON.Message != "") {
|
||||
msg = e.responseJSON.Message;
|
||||
}
|
||||
KretaWindowHelper.feedbackWindow("@ErrorResource.Hiba", msg, true);
|
||||
}
|
||||
|
||||
function checkdataset() {
|
||||
var hasError = false;
|
||||
var allRows = KretaGridHelper.getAllRows("TantargyFelosztasFelvetelGrid");
|
||||
var missingValue = false;
|
||||
var emptyRows = "";
|
||||
var isDualisFoglalkozas = CommonUtils.parseBool("@Model.IsFromSzervezet");
|
||||
var haveModifiedRows = KretaGridHelper.haveModifiedRows("TantargyFelosztasFelvetelGrid");
|
||||
$.each(allRows, function (index, value) {
|
||||
if (value.input.length != 0) {
|
||||
var thisRowEmpty = false;
|
||||
if (isDualisFoglalkozas && $.trim(value.input[0].value) == "" &&
|
||||
$.trim(value.input[1].value) == "") {
|
||||
thisRowEmpty = true;
|
||||
} else if (!isDualisFoglalkozas) {
|
||||
if ($.trim(value.input[0].value) == "" &&
|
||||
$.trim(value.input[1].value) == "" &&
|
||||
$.trim(value.input[2].value) == "") {
|
||||
thisRowEmpty = true;
|
||||
}
|
||||
}
|
||||
if (thisRowEmpty == false) {
|
||||
var isCurrentRowInvalid = false;
|
||||
var widget = $("#TantargyFelosztasFelvetelGrid_OsztalyCsoport_" + value.ID).data("kendoComboBox");
|
||||
if (widget.value() == widget.text()) {
|
||||
widget.value("");
|
||||
value.input[0].value = "";
|
||||
}
|
||||
if (isDualisFoglalkozas && value.input[0].value == "" ||
|
||||
value.input[1].value == "") {
|
||||
isCurrentRowInvalid = true;
|
||||
}
|
||||
else if (!isDualisFoglalkozas) {
|
||||
if (value.input[0].value == "" ||
|
||||
value.input[1].value == "" ||
|
||||
value.input[2].value == "") {
|
||||
isCurrentRowInvalid = true;
|
||||
} else if (value.input[3].value != "" || value.input[4].value != "") {
|
||||
var oraszam = parseFloat(value.input[2].value.replace(",", "."));
|
||||
var tulora = 0, megbizasiOraszam = 0;
|
||||
|
||||
if (value.input[3].value != "") {
|
||||
tulora = parseFloat(value.input[3].value.replace(",", "."));
|
||||
}
|
||||
if (value.input[4].value != "") {
|
||||
megbizasiOraszam = parseFloat(value.input[4].value.replace(",", "."));
|
||||
}
|
||||
|
||||
if (oraszam < tulora || oraszam < megbizasiOraszam) {
|
||||
isCurrentRowInvalid = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isCurrentRowInvalid) {
|
||||
missingValue = true;
|
||||
if (emptyRows == "") {
|
||||
emptyRows += (index + 1) + ".";
|
||||
} else {
|
||||
emptyRows += ", " + (index + 1) + ".";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!haveModifiedRows) {
|
||||
KretaWindowHelper.warningWindow(
|
||||
"@(CommonResource.Kotelezo)",
|
||||
"@(CommonResource.MenteshezKellLegalabbEgySor)");
|
||||
hasError = true;
|
||||
} else if (missingValue) {
|
||||
KretaWindowHelper.warningWindow(
|
||||
"@(CommonResource.Kotelezo)",
|
||||
"@(CommonResource.Az)" + emptyRows + "@(TantargyfelosztasResource.TTFFelvitelKotelezoAdat)",
|
||||
"undefined",
|
||||
"kitoltesKotelezo");
|
||||
hasError = true;
|
||||
}
|
||||
return !hasError;
|
||||
}
|
||||
|
||||
function checkTanar() {
|
||||
if ($("#TanarId").val() == "" || $("#Tanev").val() == "") {
|
||||
KretaWindowHelper.warningWindow(
|
||||
"@(CommonResource.Kotelezo)",
|
||||
"@(TantargyfelosztasResource.FelvitelhezTanrKotelezo)",
|
||||
"undefined",
|
||||
"tanarKotelezo");
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function closeWindows() {
|
||||
KretaGridHelper.refreshGrid("TantargyFelosztasGrid");
|
||||
KretaWindowHelper.destroyAllWindow();
|
||||
}
|
||||
|
||||
felosztasFelvetelHelper.osztalyCsoportChanged = function (e) {
|
||||
var name = $(e.sender.input)[0].name;
|
||||
var tantargyname = name.replace('OsztalyCsoport', 'Tantargy').replace('_input', '');
|
||||
var tantargy = $('#' + tantargyname);
|
||||
if (e.sender.value() != '' && tantargy.val() == '') {
|
||||
tantargy.data('kendoComboBox').value(@Model.DualisKepzesTantargyId);
|
||||
}
|
||||
}
|
||||
|
||||
felosztasFelvetelHelper.disableTantargyColumn = function () {
|
||||
if (CommonUtils.parseBool("@Model.IsFromSzervezet")) {
|
||||
var tantargyakComboDiv = $('[name^="TantargyFelosztasFelvetelGrid_Tantargy"]').parents("div .gridComboBox");
|
||||
if (!tantargyakComboDiv.hasClass("disabledItem")) {
|
||||
tantargyakComboDiv.addClass("disabledItem");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return felosztasFelvetelHelper;
|
||||
})();
|
||||
</script>
|
|
@ -0,0 +1,79 @@
|
|||
@using Kreta.Enums.ManualEnums
|
||||
@using Kreta.Resources
|
||||
@using Kreta.Web.Areas.Tantargy.Models;
|
||||
|
||||
@model TantargyFelosztasModositasaModel
|
||||
|
||||
<div class="container-fluid details">
|
||||
@{
|
||||
using (Html.KretaForm("tantargyFelosztasModositasForm"))
|
||||
{
|
||||
@Html.KretaValidationSummary()
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.TanarId, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetTanar", IsFromSzervezet = Model.IsFromSzervezet, tanarId = Model.TanarId })).AutoBind(true).RenderWithName(3, 3)
|
||||
</div>
|
||||
<div class="row @(Model.IsFromSzervezet ? "disabledItem" : string.Empty)">
|
||||
@Html.KretaComboBoxFor(x => x.TantargyId, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetTantargy" })).AutoBind(true).RenderWithName(3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.CsoportID, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetOsztalyCsoportListByEvfolyam", isDualisKepzohelyiCsoport = Model.IsFromSzervezet, tanarId = Model.TanarId, szervezetAdatokHalmaza = (int)SzervezetAdatokHalmazaEnum.SzervezetEsAlSzervezetek }), useGroup: true).AutoBind(true).RenderWithName(3, 3)
|
||||
</div>
|
||||
if (!Model.IsFromSzervezet)
|
||||
{
|
||||
<div class="row">
|
||||
@Html.KretaNumericFor(x => x.Oraszam).Min(0).Max(50).Value(Model.Oraszam).Step(0.25).RenderWithName(3, 3)
|
||||
@Html.KretaNumericFor(x => x.TuloraSzam).Min(0).Max(50).Value(Model.TuloraSzam).Step(0.25).RenderWithName(3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaCheckBoxFor(x => x.OsszevontOra).RenderWithName(3, 3)
|
||||
@Html.KretaCheckBoxFor(x => x.NemzetisegiOra).RenderWithName(3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaNumericFor(x => x.MegbizasiOraszam).Min(0).Max(50).Value(Model.MegbizasiOraszam).Step(0.25).RenderWithName(3, 3)
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.Hidden("Oraszam", Model.Oraszam.ToString("F2", System.Globalization.CultureInfo.GetCultureInfo("hu-HU")))
|
||||
}
|
||||
<div class="row">
|
||||
@Html.KretaCheckBoxFor(x => x.VisszamenolegesModositas).RenderWithName(3, 3)
|
||||
<div style="padding: 30px; color: #a94442;" id="VisszamenolegesTartalom">
|
||||
<p><em>@TantargyResource.VisszamenolegesModositasDescription</em></p>
|
||||
<p>
|
||||
<strong>@TantargyResource.DiakokSzama: @Html.Raw(Model.DiakokSzama)</strong>
|
||||
<br />
|
||||
<strong>@TantargyResource.TanorakSzama: @Html.Raw(Model.TanorakSzama)</strong>
|
||||
<br />
|
||||
<strong>@TantargyResource.ErtekelesekSzama: @Html.Raw(Model.ErtekelesekSzama)</strong>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaCheckBoxFor(x => x.KapcsolodoOrarendiOrakModositasa).RenderWithName(3, 3)
|
||||
</div>
|
||||
|
||||
@Html.HiddenFor(x => x.Id)
|
||||
@Html.HiddenFor(x => x.TipusId)
|
||||
@Html.HiddenFor(x => x.TanorakSzama)
|
||||
@Html.HiddenFor(x => x.ErtekelesekSzama)
|
||||
@Html.HiddenFor(x => x.MulasztasokSzama)
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function VisszamenolegesChange() {
|
||||
if ($("#VisszamenolegesModositas").is(':checked')) {
|
||||
$("#VisszamenolegesTartalom").show();
|
||||
}
|
||||
else {
|
||||
$("#VisszamenolegesTartalom").hide();
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(VisszamenolegesChange);
|
||||
|
||||
$("#VisszamenolegesModositas").change(VisszamenolegesChange);
|
||||
</script>
|
|
@ -0,0 +1,53 @@
|
|||
@using Kreta.Resources
|
||||
@using Kreta.Web.Helpers.Grid
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@model TanmenetOrakModel
|
||||
|
||||
<div style="height: 0 !important;">
|
||||
@*A formra be van állítva css szinten, hogy height: 100%, ami jó is az esetek 99%-ában, de itt pont nem...*@
|
||||
@using (Html.KretaForm("TanmenetOrakGridForm"))
|
||||
{
|
||||
@Html.HiddenFor(x => x.OsztalyId)
|
||||
@Html.HiddenFor(x => x.TantargyId)
|
||||
@Html.HiddenFor(x => x.FoglalkozasId)
|
||||
@Html.HiddenFor(x => x.TanmenetModalHeader)
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="k-content">
|
||||
@(
|
||||
Html.KretaGrid<TanmenetOrakGridModel>
|
||||
(
|
||||
"TanmenetOraiGrid",
|
||||
new GridApiUrl(Model.ApiControllerName, "GetTanmenetOrak", new Dictionary<string, string>
|
||||
{
|
||||
{ "foglalkozasID", Model.FoglalkozasId.ToString() },
|
||||
{ "OsztalyID", Model.OsztalyId.ToString() },
|
||||
{ "TantargyID", Model.TantargyId.ToString() }
|
||||
}),
|
||||
allowSorting: false,
|
||||
allowPaging: false,
|
||||
pageSizes: null,
|
||||
showSorszam: false
|
||||
)
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.Oraszam).Width("10%");
|
||||
})
|
||||
.TextBoxForColumn(Html, TanmenetResource.Tema, m => m.Tema, new Dictionary<string, object> { { "maxlength", 995 } })
|
||||
.FunctionCommand(Html, new List<FunctionCommand>
|
||||
{
|
||||
new FunctionCommand { Name = TanmenetResource.OsszesTemaTorlese, ClientAction="TanmenetHelper.osszesTemaTorles" }
|
||||
})
|
||||
.Editable()
|
||||
)
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var gridName = "TanmenetOraiGrid"
|
||||
$('#' + gridName).find('.k-textbox').keypress(function (e) {
|
||||
if (e.which == 13) {
|
||||
TanmenetHelper.enterPressed(e);
|
||||
}
|
||||
});
|
||||
</script>
|
197
KretaWeb/Areas/Tantargy/Views/Tanmenet/Index.cshtml
Normal file
197
KretaWeb/Areas/Tantargy/Views/Tanmenet/Index.cshtml
Normal file
|
@ -0,0 +1,197 @@
|
|||
@using Kreta.Framework
|
||||
@using Kreta.Resources
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@using Kreta.Web.Helpers.Grid;
|
||||
|
||||
@model TanmenetSearchModel
|
||||
|
||||
@{
|
||||
Layout = "~/Views/Shared/_MasterLayout.cshtml";
|
||||
}
|
||||
|
||||
@section AddSearchPanel {
|
||||
@using (Html.SearchPanelSideBar("searchForm", "TanmenetGrid"))
|
||||
{
|
||||
@Html.KretaComboBoxFor(x => x.OsztalyCsoportIdSearch, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetTanitottOsztalyCsoportListByTanarIdOrderByEvfolyam", isFromSzervezet = Model.IsFromSzervezet }), useGroup: true).AutoBind(true).RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.TantargyIdSearch, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Model.ApiControllerName, action = "GetTantargyList" })).AutoBind(true).RenderSearchPanelSideBar()
|
||||
}
|
||||
}
|
||||
|
||||
<div>
|
||||
@(
|
||||
Html.KretaGrid<TanmenetGridModel>
|
||||
(
|
||||
name: "TanmenetGrid",
|
||||
getUrl: new GridApiUrl(Model.ApiControllerName, "GetTanmenetGrid", new Dictionary<string, string> { }),
|
||||
allowScrolling: true,
|
||||
dataParameterFunction: "searchForm"
|
||||
)
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.TantargyNev);
|
||||
columns.Bound(c => c.OsztalyCsoportNev);
|
||||
columns.Bound(c => c.OraszamCount).Width("10%");
|
||||
})
|
||||
.FunctionCommand(Html, new List<FunctionCommand> {
|
||||
new FunctionCommand { Name = CommonResource.Uj, ClientAction="TanmenetHelper.openNewTanmenetWindow" },
|
||||
new FunctionCommand { Name = CommonResource.Importalas, ClientAction="TanmenetHelper.redirectToImport" }
|
||||
})
|
||||
.RowFunction(Html, new List<RowFunction>
|
||||
{
|
||||
new RowFunction { Name = CommonResource.Adatok, ClientAction = "TanmenetHelper.openModifyTanmenetGrid", IconEnum = Kreta.Enums.ManualEnums.GridRowFunctionIconEnum.Modositas },
|
||||
new RowFunction { Name = ImportExportCommonResource.Export, ClientAction = "TanmenetHelper.exportTanmenet", IconEnum = Kreta.Enums.ManualEnums.GridRowFunctionIconEnum.Excel },
|
||||
new RowFunction { Name = CommonResource.Torles, ClientAction = "TanmenetHelper.deleteConfirmWindow", IconEnum = Kreta.Enums.ManualEnums.GridRowFunctionIconEnum.Torles }
|
||||
})
|
||||
.Sortable(sortable => sortable
|
||||
.AllowUnsort(true)
|
||||
.SortMode(GridSortMode.MultipleColumn))
|
||||
)
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var TanmenetHelper = (function () {
|
||||
var tanmenetHelper = function () { };
|
||||
|
||||
var gridName = "TanmenetOraiGrid";
|
||||
|
||||
var url = {
|
||||
OpenNewTanmenet: "@Url.Action("OpenNewTanmenetWindow", Model.ControllerName , new { area = "Tantargy" })",
|
||||
OpenEditTanmenetGrid: "@Url.Action("OpenEditTanmenetGridWindow", Model.ControllerName , new { area = "Tantargy" })",
|
||||
RedirectToImport: "@(Url.Content("~/ImportExport/" + Model.ImportControllerName))",
|
||||
SaveTanmenet: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Model.ApiControllerName, action = "SaveTanmenet" })",
|
||||
ExportTanmenet: "@Url.Action("ExportTanmenet", Model.ControllerName, new { area = "Tantargy" })",
|
||||
Delete: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Model.ApiControllerName, action = "Delete" })"
|
||||
}
|
||||
|
||||
tanmenetHelper.redirectToImport = function () {
|
||||
window.location = url.RedirectToImport;
|
||||
}
|
||||
|
||||
tanmenetHelper.openNewTanmenetWindow = function () {
|
||||
AjaxHelper.DoGet(url.OpenNewTanmenet, {}, popupTanmenet);
|
||||
};
|
||||
|
||||
tanmenetHelper.openNewTanmenetGrid = function () {
|
||||
AjaxHelper.DoPostElement(url.OpenEditTanmenetGrid, "NewTanmenetForm", popupTanmenetGrid);
|
||||
};
|
||||
|
||||
tanmenetHelper.openModifyTanmenetGrid = function (data) {
|
||||
var tantargyId = data.TantargyID;
|
||||
var osztalyId = data.OsztalyCsoportID;
|
||||
var foglalkozasId = data.FoglalkozasID;
|
||||
AjaxHelper.DoGet(url.OpenEditTanmenetGrid, { TantargyId: tantargyId, OsztalyId: osztalyId, FoglalkozasId: foglalkozasId }, popupTanmenetGrid);
|
||||
};
|
||||
|
||||
tanmenetHelper.saveTanmenetOrak = function () {
|
||||
var rows = KretaGridHelper.getAllRows(gridName)
|
||||
var rowsData = [rows.length];
|
||||
$.each(rows, function (index, value) {
|
||||
rowsData[index] = {
|
||||
ID: value.ID,
|
||||
Oraszam: value.Oraszam,
|
||||
Tema: value.ki_Tema
|
||||
}
|
||||
});
|
||||
var result = {
|
||||
FoglalkozasId: $('#TanmenetOrakGridForm').prop('FoglalkozasId').value,
|
||||
TanmenetBejegyzesek: rowsData,
|
||||
};
|
||||
AjaxHelper.DoPost(url.SaveTanmenet, result, saveTanmenetSuccess, feedbackError);
|
||||
};
|
||||
|
||||
tanmenetHelper.newTanmenetCancel = function () {
|
||||
KretaWindowHelper.destroyWindow("NewTanmenetWindow");
|
||||
};
|
||||
|
||||
tanmenetHelper.editTanmenetGridCancel = function () {
|
||||
KretaWindowHelper.destroyWindow("EditTanmenetGridWindow");
|
||||
};
|
||||
|
||||
tanmenetHelper.osszesTemaTorles = function () {
|
||||
$("input[data-rowinputname='Tema']").val('');
|
||||
}
|
||||
|
||||
tanmenetHelper.enterPressed = function (e) {
|
||||
if (e.target.classList.contains("k-textbox") && $(e.target).closest("#TanmenetOraiGrid").length > 0) {
|
||||
var sorszamMezo = $(e.target).closest('[role=row]').children('[role=gridcell]:not(.gridTextbox)');
|
||||
var sorokszama = KretaGridHelper.getKendoGridData(gridName).dataSource.data().length;
|
||||
if (sorszamMezo.length > 0) {
|
||||
var sorindex = sorszamMezo[0].textContent;
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
var rowgroup = $(e.target).closest('[role=rowgroup]');
|
||||
if (sorindex == sorokszama) {
|
||||
$(e.target).blur();
|
||||
TanmenetHelper.ujSor();
|
||||
}
|
||||
|
||||
$(rowgroup.children('[role=row]')[sorindex]).find('.k-textbox').focus();
|
||||
}
|
||||
}
|
||||
|
||||
tanmenetHelper.exportTanmenet = function (rowData) {
|
||||
var postData = {
|
||||
TantargyId: rowData.TantargyID,
|
||||
OsztalyId: rowData.OsztalyCsoportID
|
||||
};
|
||||
AjaxHelper.ShowIndicator();
|
||||
setTimeout(AjaxHelper.DoPost(url.ExportTanmenet, postData, saveFile), 1000);
|
||||
}
|
||||
|
||||
tanmenetHelper.deleteConfirmWindow = function (rowData) {
|
||||
KretaWindowHelper.confirmWindow("@CommonResource.Kerdes", "@CommonResource.BiztosanTorli", deleteTanmenet, rowData);
|
||||
}
|
||||
|
||||
function deleteTanmenet(rowData) {
|
||||
AjaxHelper.DoPost(url.Delete, rowData.FoglalkozasID, deleteResponseOk, feedbackError);
|
||||
}
|
||||
|
||||
function deleteResponseOk() {
|
||||
KretaWindowHelper.successFeedBackWindow();
|
||||
KretaGridHelper.refreshGridSearchPanel("TanmenetGrid", "searchForm");
|
||||
}
|
||||
|
||||
function saveFile(fileContent) {
|
||||
var dataURI = "data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64," + fileContent;
|
||||
|
||||
kendo.saveAs({
|
||||
dataURI: dataURI,
|
||||
fileName: "@(TanmenetResource.ExportFileName).xlsx",
|
||||
});
|
||||
setTimeout(AjaxHelper.HideIndicator(), 2000);
|
||||
}
|
||||
|
||||
function popupTanmenet(data) {
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@TanmenetResource.OpenTanmenetTitle";
|
||||
config.content = data;
|
||||
config.minWidth = "400px";
|
||||
config.width = "400px";
|
||||
config.height = "300px";
|
||||
var modal = KretaWindowHelper.createWindow("NewTanmenetWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
}
|
||||
|
||||
function popupTanmenetGrid(data) {
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = kendo.htmlEncode($("#TanmenetModalHeader", data).val());
|
||||
config.content = data;
|
||||
var modal = KretaWindowHelper.createWindow("EditTanmenetGridWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
}
|
||||
|
||||
function saveTanmenetSuccess() {
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow);
|
||||
KretaGridHelper.refreshGridSearchPanel("TanmenetGrid", "searchForm");
|
||||
}
|
||||
|
||||
function feedbackError(data) {
|
||||
var message = data.responseJSON.Message;
|
||||
KretaWindowHelper.feedbackWindow("@(CommonResource.Hiba)", message, true);
|
||||
}
|
||||
|
||||
return tanmenetHelper;
|
||||
})();
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@using Kreta.Web.Classes
|
||||
|
||||
@model NewTanmenetModel
|
||||
|
||||
<div class="container-fluid details">
|
||||
@using (Html.KretaForm("NewTanmenetForm"))
|
||||
{
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.FoglalkozasId, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Model.ApiControllerName, action = "GetFoglalkozasList" }), "Text", "Value").RenderWithName(3, 9)
|
||||
</div>
|
||||
@Html.KretaValidationSummary()
|
||||
}
|
||||
</div>
|
85
KretaWeb/Areas/Tantargy/Views/Tanorak/Index.cshtml
Normal file
85
KretaWeb/Areas/Tantargy/Views/Tanorak/Index.cshtml
Normal file
|
@ -0,0 +1,85 @@
|
|||
@using Kreta.Resources;
|
||||
@using Kreta.Framework;
|
||||
@using Kreta.Web.Helpers.Grid;
|
||||
@using Kreta.Web.Areas.Tantargy.Models;
|
||||
@using Kreta.BusinessLogic.Classes;
|
||||
@model TanorakSearchModel
|
||||
|
||||
@section AddSearchPanel {
|
||||
@using (Html.SearchPanelSideBar("searchForm", "TanorakGrid"))
|
||||
{
|
||||
@Html.KretaRangeDatePickerSideBar(model => model.IdoszakKezdete, model => Model.IdoszakVege)
|
||||
@Html.KretaComboBoxFor(x => x.OsztalyCsoportId, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetOsztalyCsoportListByEvfolyam" }), useGroup: true).RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.TantargyId, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetTantargy" })).RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.Helyetesitett, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" })).RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.TanarId, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetTanar" })).AutoBind(true).RenderSearchPanelSideBar()
|
||||
}
|
||||
}
|
||||
|
||||
<div>
|
||||
@(
|
||||
Html.KretaGrid<TanorakGridModel>
|
||||
(
|
||||
name: "TanorakGrid",
|
||||
getUrl: new GridApiUrl("TanorakApi", "GetTanorakGrid"),
|
||||
dataParameterFunction: "searchForm",
|
||||
useToolBar: true,
|
||||
allowExcelExport: true,
|
||||
allowScrolling: true,
|
||||
excelExportFileName: "TanorakExport",
|
||||
sort: sort => sort.Add(m => m.Datum).Ascending()
|
||||
)
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.ID).Hidden();
|
||||
columns.Bound(c => c.Datum).Width("10%").Format(SDAFormat.Format[SDAFormat.FormatType.ShortDate]);
|
||||
columns.Bound(c => c.OraSorsz).Width("10%");
|
||||
columns.Bound(c => c.HetNapja_DNAME).Sortable(false);
|
||||
columns.Bound(c => c.OsztCsopNev);
|
||||
columns.Bound(c => c.TargyNev);
|
||||
columns.Bound(c => c.IsHelyetesitett_BNAME);
|
||||
columns.Bound(c => c.TanarNev);
|
||||
columns.Bound(c => c.Tema);
|
||||
columns.Bound(c => c.IsEgyediNap_BNAME);
|
||||
|
||||
})
|
||||
.RowFunction(Html, new List<RowFunction> {
|
||||
new RowFunction { NameResourceId = 118 /*Adatok*/, ClientAction= "TanorakHelper.openTanorakAdatok", IconEnum = Kreta.Enums.ManualEnums.GridRowFunctionIconEnum.Adatok }
|
||||
})
|
||||
.Sortable(sortable => sortable
|
||||
.AllowUnsort(true)
|
||||
.SortMode(GridSortMode.MultipleColumn))
|
||||
)
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var TanorakHelper = (function () {
|
||||
var tanorakHelper = function () { };
|
||||
|
||||
var gridName = "TanorakGrid";
|
||||
var searchFormName = "searchForm";
|
||||
|
||||
var url = {
|
||||
OpenAdatokPopup: "@Url.Action("OpenAdatokPopup", "Tanorak", new { area = "Tantargy" })"
|
||||
}
|
||||
|
||||
tanorakHelper.openTanorakAdatok = function (rowData) {
|
||||
AjaxHelper.DoGet(url.OpenAdatokPopup, { ID: rowData.ID }, popUpTanorakAdatok);
|
||||
}
|
||||
|
||||
function popUpTanorakAdatok(data) {
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@(StringResourcesUtil.GetString(1922))"; /*Tanóra adatai*/
|
||||
config.content = data;
|
||||
|
||||
var modal = KretaWindowHelper.createWindow("TanorakAdatok", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
}
|
||||
|
||||
tanorakHelper.adatokCancel = function () {
|
||||
KretaWindowHelper.destroyWindow("TanorakAdatok");
|
||||
}
|
||||
|
||||
return tanorakHelper;
|
||||
})();
|
||||
</script>
|
34
KretaWeb/Areas/Tantargy/Views/Tanorak/TanorakAdatok.cshtml
Normal file
34
KretaWeb/Areas/Tantargy/Views/Tanorak/TanorakAdatok.cshtml
Normal file
|
@ -0,0 +1,34 @@
|
|||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@model TanoraAdatokModel
|
||||
|
||||
<div class="container-fluid details">
|
||||
@Html.HiddenFor(x => x.Id)
|
||||
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.Datum, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.HetNapja, 3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.OraKezdete, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.OraVege, 3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.Oraszam, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.HelyNev, 3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.OsztCsopNev, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.TargyNev, 3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@if (Model.Megtartott.HasValue && Model.Megtartott.Value)
|
||||
{
|
||||
@Html.KretaLabelFor(x => x.OraSorszama, 3, 3)
|
||||
}
|
||||
@Html.KretaLabelFor(x => x.Tema, 3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.TanarNev, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.MegtartottString, 3, 3)
|
||||
</div>
|
||||
</div>
|
469
KretaWeb/Areas/Tantargy/Views/TantargyFelosztas/Index.cshtml
Normal file
469
KretaWeb/Areas/Tantargy/Views/TantargyFelosztas/Index.cshtml
Normal file
|
@ -0,0 +1,469 @@
|
|||
@using Kreta.Web.Security
|
||||
@using Kreta.Enums.ManualEnums
|
||||
@using Kreta.Resources
|
||||
@using Kreta.Web.Areas.Tantargy.Models;
|
||||
@using Kreta.Web.Helpers.Grid;
|
||||
|
||||
@model TantargyFelosztasModel
|
||||
|
||||
@section AddSearchPanel {
|
||||
@using (Html.SearchPanelSideBar("searchForm", "TantargyFelosztasGrid"))
|
||||
{
|
||||
@Html.HiddenFor(x => x.IsFromSzervezet)
|
||||
|
||||
if (!Model.IsFromSzervezet && ClaimData.IsVegyes)
|
||||
{
|
||||
@Html.KretaComboBoxFor(x => x.SearchFeladatKategoriaId, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetFeladatKategoriaSzuro" }), "Text", "Value").AutoBind(true).RenderSearchPanelSideBar()
|
||||
}
|
||||
|
||||
@Html.KretaComboBoxFor(x => x.SearchOsztalCsoport, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetOsztalyCsoportListByEvfolyam", isDualisKepzohelyiCsoport = Model.IsFromSzervezet, tanarId = ClaimData.FelhasznaloId, szervezetAdatokHalmaza = (int)SzervezetAdatokHalmazaEnum.SzervezetEsAlSzervezetek }), "Text", "Value", useGroup: true).RenderSearchPanelSideBar()
|
||||
|
||||
if (!Model.IsFromSzervezet)
|
||||
{
|
||||
@Html.KretaCheckBoxFor(x => x.Osztalybontasokkal).RenderSearchPanelSideBar()
|
||||
@Html.KretaCheckBoxFor(x => x.KapcsolodoCsoportokkal).RenderSearchPanelSideBar()
|
||||
}
|
||||
|
||||
@Html.KretaComboBoxFor(x => x.SearchTanar, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetTanar", isFromSzervezet = Model.IsFromSzervezet }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
|
||||
if (!Model.IsFromSzervezet)
|
||||
{
|
||||
@Html.KretaComboBoxFor(x => x.SearchTantargy, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetTantargy" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.SearchFeladatellatasihely, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetFeladatellatasiHelyek" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaNumericFor(x => x.SearchOraszam).Min(0).Max(Kreta.Core.Constants.General.TantargyfelosztasImportMaxOraszam).Step(0.25).RenderSearchPanelSideBar()
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.KretaTextBoxFor(x => x.DualisKepzohelyNeve).RenderSearchPanelSideBar()
|
||||
@Html.KretaTextBoxFor(x => x.DualisKepzohelyAdoszama).RenderSearchPanelSideBar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@section AddTip {
|
||||
<ul id="tipList" style="display: none;">
|
||||
<li>@(TantargyResource.Tipp) @(TantargyResource.AzIntezmenyRovidNeveJelenikMegAKretaRendszerFelsoSorabanHaTulHosszuAzIntezmenyNeveKerjukAdjonMegRovidNevet)</li>
|
||||
<li>@(TantargyResource.Tipp) @(TantargyResource.AzIntezmenyAdataiAKretaRendszerTelepitesekorAutomatikusanBekerulnekASzoftverbe)</li>
|
||||
<li>@(TantargyResource.Tipp) @(TantargyResource.AmennyibenAzIntezmenyiAdatokonValtoztatniSzuksegesKerjukVegyeFelAKapcsolatotFenntartojavalIsIlletveJelezzeAKirNek)</li>
|
||||
</ul>
|
||||
}
|
||||
|
||||
@{
|
||||
List<RowFunction> TTFelosztasRowFunctionList = new List<RowFunction>();
|
||||
List<RowFunction> TTFelosztasConditionalRowFunctionList = new List<RowFunction>();
|
||||
if (ClaimManager.HasPackage("Adminisztrator", "Dualis_Admin", "IsSzakiranyuOktatasertFelelos") && !ClaimData.IsSelectedTanevIsElozo)
|
||||
{
|
||||
(Model.IsFromSzervezet ? TTFelosztasConditionalRowFunctionList : TTFelosztasRowFunctionList).Add(new RowFunction { Name = CommonResource.Modositas, ClientAction = "TantargyFelosztasHelper.Modify", IconEnum = GridRowFunctionIconEnum.Modositas });
|
||||
}
|
||||
|
||||
TTFelosztasRowFunctionList.Add(new RowFunction { Name = CommonResource.Adatok, ClientAction = "TantargyFelosztasHelper.Detail", IconEnum = GridRowFunctionIconEnum.Adatok });
|
||||
|
||||
List<FunctionCommand> TTFelosztasFunctionCommandList = new List<FunctionCommand>();
|
||||
|
||||
if (ClaimManager.HasPackage("Adminisztrator", "Dualis_Admin", "IsSzakiranyuOktatasertFelelos") && !ClaimData.IsSelectedTanevIsElozo)
|
||||
{
|
||||
(Model.IsFromSzervezet ? TTFelosztasConditionalRowFunctionList : TTFelosztasRowFunctionList).Add(new RowFunction { Name = CommonResource.Torles, ClientAction = "TantargyFelosztasHelper.Delete", IconEnum = GridRowFunctionIconEnum.Torles });
|
||||
|
||||
TTFelosztasFunctionCommandList.Add(new FunctionCommand { Name = CommonResource.Uj, ClientAction = "TantargyFelosztasHelper.New" });
|
||||
TTFelosztasFunctionCommandList.Add(new FunctionCommand { Name = CommonResource.KijeloltekTorlese, ClientAction = "TantargyFelosztasHelper.DeleteSelected", Classes = "kendo-gridFunctionKommandRed" });
|
||||
}
|
||||
|
||||
if (ClaimManager.HasPackage("Fenntarto") && !ClaimData.IsSelectedTanevIsElozo)
|
||||
{
|
||||
if (Model.VeglegesTTF)
|
||||
{
|
||||
TTFelosztasFunctionCommandList.Add(new FunctionCommand { Name = TantargyResource.Elutasitas, ClientAction = "TantargyFelosztasHelper.Elutasitas" });
|
||||
TTFelosztasFunctionCommandList.Add(new FunctionCommand { Name = TantargyResource.Elfogadas, ClientAction = "TantargyFelosztasHelper.Elfogadas" });
|
||||
}
|
||||
}
|
||||
|
||||
TTFelosztasFunctionCommandList.Add(new FunctionCommand
|
||||
{
|
||||
Name = TantargyResource.Export.ToUpper(),
|
||||
NestedCommands = new List<FunctionCommand>
|
||||
{
|
||||
new FunctionCommand { Name = ImportExportCommonResource.Export, ClientAction = "TantargyFelosztasHelper.getExport" },
|
||||
}
|
||||
});
|
||||
|
||||
if (!Model.IsFromSzervezet)
|
||||
{
|
||||
var exports = TTFelosztasFunctionCommandList.Last().NestedCommands;
|
||||
exports.Add(new FunctionCommand { Name = TantargyResource.ExportEgyszeru, ClientAction = "TantargyFelosztasHelper.SimpleExport" });
|
||||
exports.Add(new FunctionCommand { Name = TantargyResource.Exportkereszttablas, ClientAction = "TantargyFelosztasHelper.LepedoExport" });
|
||||
exports.Add(new FunctionCommand { Name = TantargyResource.ExportKereszttablasOsztalyokkal, ClientAction = "TantargyFelosztasHelper.LepedoOsztalyExport" });
|
||||
}
|
||||
|
||||
var grid = Html.KretaGrid<TantargyFelosztasGridModel>
|
||||
(
|
||||
name: "TantargyFelosztasGrid",
|
||||
getUrl: new GridApiUrl(Model.ApiControllerName, "GetTantargyFelosztasok", new Dictionary<string, string>() { { "isFromSzervezet", Model.IsFromSzervezet.ToString() } }),
|
||||
allowFilterable: false,
|
||||
allowPaging: true,
|
||||
allowScrolling: true,
|
||||
dataParameterFunction: "searchForm"
|
||||
)
|
||||
|
||||
//tantargyFelosztasHelper.Detail
|
||||
.SelectBoxColumn(Html, string.Empty)
|
||||
.LinkButtonColumn("", x => x.TanarElotagNelkul, "TantargyFelosztasHelper.ModifyOrOpenInfo", GridButtonsEnum.Reszletek, customField: "Tanar")
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(x => x.Tanev).Width("10%");
|
||||
columns.Bound(x => x.OsztalyCsoport);
|
||||
columns.Bound(x => x.Tantargy);
|
||||
columns.Bound(x => x.DualisKepzohelyNeve).Visible(Model.IsFromSzervezet);
|
||||
columns.Bound(x => x.DualisKepzohelyAdoszama).Visible(Model.IsFromSzervezet);
|
||||
columns.Bound(x => x.OsszevontOra_BNAME).Width("10%").Visible(!Model.IsFromSzervezet);
|
||||
columns.Bound(x => x.NemzetisegiOra_BNAME).Width("10%").Visible(!Model.IsFromSzervezet);
|
||||
columns.Bound(x => x.MegbizasiOraszam).Width("10%").Visible(!Model.IsFromSzervezet);
|
||||
columns.Bound(x => x.TuloraSzam).Width("10%").Visible(!Model.IsFromSzervezet);
|
||||
|
||||
columns.Bound(x => x.Oraszam).Width("10%").ClientTemplate("#=TantargyFelosztasHelper.calculateOraszam(data)#")
|
||||
.ClientFooterTemplate(TantargyResource.OldalonOsszesen +": #= TantargyFelosztasHelper.calculateOraszamOsszes()#").Visible(!Model.IsFromSzervezet);
|
||||
})
|
||||
.FunctionCommand(Html, TTFelosztasFunctionCommandList)
|
||||
.Sortable(sortable => sortable
|
||||
.AllowUnsort(true)
|
||||
.SortMode(GridSortMode.MultipleColumn));
|
||||
|
||||
if (Model.IsFromSzervezet)
|
||||
{
|
||||
grid
|
||||
.RowFunction(Html, TTFelosztasRowFunctionList, iconCount: TTFelosztasRowFunctionList.Count())
|
||||
.ConditionalRowFunction(Html, TTFelosztasConditionalRowFunctionList, "TantargyFelosztasHelper.isSzerkesztheto", iconCount: TTFelosztasConditionalRowFunctionList.Count());
|
||||
}
|
||||
else
|
||||
{
|
||||
grid
|
||||
.RowFunction(Html, TTFelosztasRowFunctionList);
|
||||
}
|
||||
}
|
||||
|
||||
<div>
|
||||
@(grid)
|
||||
</div>
|
||||
@if (!Model.IsFromSzervezet)
|
||||
{
|
||||
<div style="font-weight: 700; text-align: right; margin-right: 10vw;">@TantargyResource.Osszesen: @(((double)ViewBag.Oraszam).ToString("0.##")) (@(((double)ViewBag.TtfKorrekcioOraszam).ToString("0.##")))</div>
|
||||
}
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
if (!CommonUtils.isNullOrUndefined("@ClaimData.FelhelySzuro") && !CommonUtils.isNullOrUndefined($("#SearchFeladatellatasihely").data("kendoComboBox"))) {
|
||||
$("#SearchFeladatellatasihely").data("kendoComboBox").value("@ClaimData.FelhelySzuro");
|
||||
}
|
||||
});
|
||||
var TantargyFelosztasHelper = (function () {
|
||||
var tantargyFelosztasHelper = function () { };
|
||||
|
||||
var searchFormName = "searchForm";
|
||||
var gridName = "TantargyFelosztasGrid";
|
||||
|
||||
var url = {
|
||||
OpenTantargyfelosztasFelvetelePopUp: "@Url.Action("OpenTantargyFelosztasFelvetelePopUp", Model.ControllerName, new { area = "Tantargy" })",
|
||||
OpenTantargyfelosztasAdatokPopUp: "@Url.Action("OpenTantargyFelosztasAdatokPopUp", Model.ControllerName, new { area = "Tantargy" })",
|
||||
DeleteTantargyFelosztas: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Model.ApiControllerName, action = "DeleteTantargyFelosztas" })",
|
||||
DeleteSelectedTantargyFelosztas: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new {controller = Model.ApiControllerName, action= "DeleteSelectedTantargyFelosztas" })",
|
||||
OpenTantargyFelosztasModisitasPopUp: "@Url.Action("OpenTantargyFelosztasModositasPopUp", Model.ControllerName, new { area = "Tantargy", IsFromSzervezet = Model.IsFromSzervezet })",
|
||||
ModifyFelosztas: "@Url.HttpRouteUrl("ActionApi", new { controller = Model.ApiControllerName, action = "ModifyTantargyFelosztas" })",
|
||||
ModifyConfirmContent: "@Url.HttpRouteUrl("ActionApi", new { controller = Model.ApiControllerName, action = "ModifyTantargyFelosztasConfirmContent" })",
|
||||
SimpleExport: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Model.ApiControllerName, action = "ExportEgyszeruTantargyfelosztas" })",
|
||||
LepedoExport: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.TantargyFelosztasApi, action = "ExportLepedoTantargyfelosztas" })",
|
||||
LepedoOsztalyExport: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.TantargyFelosztasApi, action = "ExportLepedoOsztalyTantargyfelosztas" })",
|
||||
ValidateTantargyFelosztasModify: "@Url.HttpRouteUrl("ActionApi", new { controller = Model.ApiControllerName, action = "ValidateTantargyFelosztasModify" })",
|
||||
|
||||
Elfogadas: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.TantargyFelosztasApi, action = "Elfogadas" })",
|
||||
Elutasitas: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.TantargyFelosztasApi, action = "Elutasitas" })",
|
||||
OpenElutasitasWindow: "@Url.Action("OpenElutasitasWindow","TantargyFelosztas", new { area = "Tantargy" })",
|
||||
StoreSelectedTanar: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Model.ApiControllerName, action = "StoreSelectedTanar" })",
|
||||
GetExport: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Model.ApiControllerName, action = "GetExport" })",
|
||||
}
|
||||
|
||||
tantargyFelosztasHelper.New = function () {
|
||||
openTantargyFelosztasFelveteleWindow();
|
||||
};
|
||||
|
||||
tantargyFelosztasHelper.Delete = function (d) {
|
||||
KretaWindowHelper.confirmWindow("@(CommonResource.Torles)", "@(TantargyResource.BiztosanTorliAFelosztast)", function () { manageDelete(d.ID); });
|
||||
};
|
||||
|
||||
tantargyFelosztasHelper.DeleteSelected = function () {
|
||||
var selectedRows = KretaGridHelper.getSelectedRowsByGridName(gridName);
|
||||
if (selectedRows.length > 0) {
|
||||
KretaWindowHelper.confirmWindow("@(CommonResource.Torles)", "@(CommonResource.BiztosanTorolniSzeretneAKijeloltElemeket)", function () { deleteSelected(selectedRows); });
|
||||
}
|
||||
else {
|
||||
KretaWindowHelper.feedbackWindow("@(IntezmenyResource.Torles)", "@(IntezmenyResource.AKijeloltElemekTorlesehezJeloljonKiLegalabbEgyElemet)", true, KretaWindowHelper.destroyAllWindow);
|
||||
}
|
||||
}
|
||||
|
||||
function deleteSelected(selectedRows) {
|
||||
var parameters = [];
|
||||
if (CommonUtils.parseBool("@Model.IsFromSzervezet") && !selectedRows.every((x) => tantargyFelosztasHelper.isSzerkesztheto(x)))
|
||||
{
|
||||
KretaWindowHelper.warningWindow("@(CommonResource.Figyelmeztetes)", "@(IntezmenyResource.NincsMindenKijeloltElemhezSzerkesztesTorlesJogosultsaga)");
|
||||
return;
|
||||
}
|
||||
$.each(selectedRows, function (index, value) {
|
||||
parameters.push(value.ID);
|
||||
});
|
||||
|
||||
AjaxHelper.DoPost(url.DeleteSelectedTantargyFelosztas, parameters, deleteSelectedResponseOk, deleteSelectedResponseError);
|
||||
}
|
||||
|
||||
function deleteSelectedResponseError(data) {
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
AjaxHelper.ShowError(data);
|
||||
}
|
||||
|
||||
function deleteSelectedResponseOk() {
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow, "@(!Model.IsFromSzervezet ? CommonResource.AMuveletSikeresenMegtortentAModositastKuldjeElAFentartojanak : CommonResource.AMuveletSikeresenMegtortent)");
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
tantargyFelosztasHelper.Modify = function (d) {
|
||||
refreshGrid();
|
||||
openTantargyFelosztasModositasaWindow(d.ID);
|
||||
};
|
||||
|
||||
tantargyFelosztasHelper.Detail = function (d) {
|
||||
openTantargyFelosztasAdatokWindow(d.ID);
|
||||
};
|
||||
tantargyFelosztasHelper.CloseWindow = function () {
|
||||
closeAllWindow();
|
||||
};
|
||||
|
||||
tantargyFelosztasHelper.ValidateFelosztas = function () {
|
||||
AjaxHelper.DoPostElement(url.ValidateTantargyFelosztasModify, "tantargyFelosztasModositasForm", modifyFelosztasValidator);
|
||||
}
|
||||
|
||||
function modifyFelosztasValidator(duplicated) {
|
||||
if (duplicated) {
|
||||
KretaWindowHelper.confirmWindow("@(CommonResource.Kerdes)", "@(TantargyResource.AModositaniKivantTantargyfelosztasMarSzerepel)", TantargyFelosztasHelper.ModifyFelosztas);
|
||||
}
|
||||
else {
|
||||
TantargyFelosztasHelper.ModifyFelosztas();
|
||||
}
|
||||
};
|
||||
|
||||
tantargyFelosztasHelper.ModifyFelosztas = function () {
|
||||
AjaxHelper.DoPostElement(url.ModifyConfirmContent, "tantargyFelosztasModositasForm", modifyFelosztasConfirm)
|
||||
};
|
||||
|
||||
function modifyFelosztasConfirm(content) {
|
||||
if (content) {
|
||||
KretaWindowHelper.confirmWindow(
|
||||
"@CommonResource.Figyelem",
|
||||
content,
|
||||
function () {
|
||||
AjaxHelper.DoPostElement(url.ModifyFelosztas, "tantargyFelosztasModositasForm", sikeresModositas);
|
||||
},
|
||||
null,
|
||||
null,
|
||||
"@CommonResource.Tovabb",
|
||||
"@CommonResource.Megse"
|
||||
);
|
||||
}
|
||||
else {
|
||||
AjaxHelper.DoPostElement(url.ModifyFelosztas, "tantargyFelosztasModositasForm", sikeresModositas);
|
||||
}
|
||||
};
|
||||
|
||||
tantargyFelosztasHelper.SimpleExport = function () {
|
||||
KretaGridHelper.getExportBySearchForm(gridName, url.SimpleExport, searchFormName);
|
||||
}
|
||||
|
||||
tantargyFelosztasHelper.LepedoExport = function () {
|
||||
KretaGridHelper.getExportBySearchForm(gridName, url.LepedoExport, searchFormName);
|
||||
}
|
||||
|
||||
tantargyFelosztasHelper.LepedoOsztalyExport = function () {
|
||||
KretaGridHelper.getExportBySearchForm(gridName, url.LepedoOsztalyExport, searchFormName);
|
||||
}
|
||||
|
||||
tantargyFelosztasHelper.FormazottExport = function () {
|
||||
AjaxHelper.ShowIndicator();
|
||||
setTimeout(AjaxHelper.DoPost("@Url.Action("ExportFormazottTantargyfelosztas", "TantargyFelosztas", new { area = "Tantargy" })", null, savefile), 1000);
|
||||
}
|
||||
|
||||
tantargyFelosztasHelper.getExport = function () {
|
||||
KretaGridHelper.getExportBySearchForm(gridName, url.GetExport, searchFormName);
|
||||
}
|
||||
|
||||
function savefile(e) {
|
||||
if (e.isBase64()) {
|
||||
var dataUri = "data:text/plain;base64," + e;
|
||||
|
||||
kendo.saveAs({
|
||||
dataURI: dataUri,
|
||||
fileName: "@(TantargyResource.Tantargyfelosztas_Export)_@(DateTime.Now.ToString("yyyy_MM_dd")).xlsx"
|
||||
});
|
||||
} else {
|
||||
KretaWindowHelper.warningWindow("@(CommonResource.Figyelem)", e);
|
||||
}
|
||||
|
||||
setTimeout(AjaxHelper.HideIndicator(), 2000);
|
||||
}
|
||||
|
||||
tantargyFelosztasHelper.Elfogadas = function () {
|
||||
elfogadas();
|
||||
}
|
||||
|
||||
tantargyFelosztasHelper.Elutasitas = function () {
|
||||
elutasitas();
|
||||
}
|
||||
|
||||
tantargyFelosztasHelper.SaveElutasitas = function () {
|
||||
AjaxHelper.DoPostElement(url.Elutasitas, "ElutasitasMenteseForm", sikeresElutasitas);
|
||||
}
|
||||
|
||||
tantargyFelosztasHelper.CloseElutasitasWindow = function () {
|
||||
closeAllWindow();
|
||||
}
|
||||
|
||||
function manageDelete(id) {
|
||||
AjaxHelper.DoPost(url.DeleteTantargyFelosztas, id, function () { refreshGrid(); sikeresTorles(); });
|
||||
};
|
||||
function closeAllWindow() {
|
||||
KretaWindowHelper.destroyAllWindow();
|
||||
};
|
||||
function openTantargyFelosztasAdatokWindow(id) {
|
||||
AjaxHelper.DoPost(url.OpenTantargyfelosztasAdatokPopUp, { "id": id, "isFromSzervezet": "@Model.IsFromSzervezet" }, popFelosztasAdatokWindow);
|
||||
};
|
||||
|
||||
function popFelosztasAdatokWindow(data) {
|
||||
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@(TantargyResource.TantargyfelosztasAdatok)";
|
||||
config.content = data;
|
||||
|
||||
var modal = KretaWindowHelper.createWindow("tantargyFelosztasAdatokWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
};
|
||||
|
||||
function openTantargyFelosztasModositasaWindow(id) {
|
||||
AjaxHelper.DoPost(url.OpenTantargyFelosztasModisitasPopUp, { "id": id }, popFelosztasModositasWindow);
|
||||
};
|
||||
|
||||
function popFelosztasModositasWindow(data) {
|
||||
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@(TantargyResource.TantargyfelosztasModositasa)";
|
||||
config.content = data;
|
||||
|
||||
var modal = KretaWindowHelper.createWindow("tantargyFelosztasModositasWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
};
|
||||
|
||||
function openTantargyFelosztasFelveteleWindow() {
|
||||
AjaxHelper.DoPost(url.OpenTantargyfelosztasFelvetelePopUp, null, popNewFelosztasWindow);
|
||||
};
|
||||
|
||||
function popNewFelosztasWindow(data) {
|
||||
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@(TantargyResource.TantargyfelosztasFelvetele)";
|
||||
config.content = data;
|
||||
|
||||
var modal = KretaWindowHelper.createWindow("tantargyFelosztasFelveteleWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
};
|
||||
|
||||
function refreshGrid() {
|
||||
KretaGridHelper.refreshGrid("TantargyFelosztasGrid");
|
||||
};
|
||||
|
||||
function sikeresModositas() {
|
||||
KretaWindowHelper.successFeedBackWindow(closeAllWindow, "@(CommonResource.AMuveletSikeresenMegtortentAModositastKuldjeElAFentartojanak)");
|
||||
refreshGrid();
|
||||
};
|
||||
|
||||
function sikeresTorles() {
|
||||
KretaWindowHelper.successFeedBackWindow(null, "@(CommonResource.AMuveletSikeresenMegtortentAModositastKuldjeElAFentartojanak)");
|
||||
};
|
||||
|
||||
function elfogadas() {
|
||||
AjaxHelper.DoPost(url.Elfogadas, null, sikeresElfogadas);
|
||||
};
|
||||
|
||||
function sikeresElfogadas() {
|
||||
KretaWindowHelper.feedbackWindow("@(CommonResource.Siker)", "@(TantargyResource.SikeresElfogadas)", false, function () { location.reload(true) });
|
||||
};
|
||||
|
||||
function elutasitas() {
|
||||
AjaxHelper.DoPost(url.OpenElutasitasWindow, null, popElutasitasWindow);
|
||||
};
|
||||
|
||||
function popElutasitasWindow(data) {
|
||||
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@(TantargyResource.ElutasitasIndoklasa)";
|
||||
config.content = data;
|
||||
|
||||
var modal = KretaWindowHelper.createWindow("TTFElutasitasWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
};
|
||||
|
||||
function sikeresElutasitas() {
|
||||
KretaWindowHelper.feedbackWindow("@(CommonResource.Siker)", "@(TantargyResource.SikeresElutasitas)", false, function () { location.reload(true) });
|
||||
};
|
||||
|
||||
tantargyFelosztasHelper.onDataChange = function () {
|
||||
if ($.isNumeric($('#TanarId').val())) {
|
||||
AjaxHelper.DoPost(url.StoreSelectedTanar, $('#TanarId').val());
|
||||
KretaGridHelper.refreshGridSearchPanel("TantargyFelosztasFelvetelGrid", "tantargyFelosztasForm");
|
||||
}
|
||||
else {
|
||||
$('#TanarId').data('kendoComboBox').value('');
|
||||
}
|
||||
}
|
||||
|
||||
tantargyFelosztasHelper.calculateOraszam = function (data) {
|
||||
if (data.TtfKorrekcioOraszam > 0) {
|
||||
return `${data.Oraszam} (${data.TtfKorrekcioOraszam} )`;
|
||||
}
|
||||
else {
|
||||
return `${data.Oraszam}`;
|
||||
}
|
||||
};
|
||||
|
||||
tantargyFelosztasHelper.calculateOraszamOsszes = function () {
|
||||
var dataSource = KretaGridHelper.getKendoGridData(gridName).dataSource.data();
|
||||
|
||||
if (dataSource && dataSource.length > 0) {
|
||||
var oraszamOsszes = 0;
|
||||
var ttfKorrekcioOraszamOssz = 0;
|
||||
|
||||
$.each(dataSource, function (_, value) {
|
||||
oraszamOsszes = (Number(oraszamOsszes) + Number(value.Oraszam)).toFixed(2);
|
||||
ttfKorrekcioOraszamOssz = (Number(ttfKorrekcioOraszamOssz) + Number(value.TtfKorrekcioOraszam)).toFixed(2);
|
||||
});
|
||||
|
||||
if (ttfKorrekcioOraszamOssz > 0) {
|
||||
return `${Number(oraszamOsszes)} (${Number(ttfKorrekcioOraszamOssz)})`;
|
||||
}
|
||||
else {
|
||||
return `${Number(oraszamOsszes)}`;
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
tantargyFelosztasHelper.isSzerkesztheto = function (data) {
|
||||
return CommonUtils.parseBool(data.IsSzerkesztheto);
|
||||
}
|
||||
|
||||
tantargyFelosztasHelper.ModifyOrOpenInfo = function (data) {
|
||||
if (tantargyFelosztasHelper.isSzerkesztheto(data)) {
|
||||
tantargyFelosztasHelper.Modify(data);
|
||||
}
|
||||
else {
|
||||
tantargyFelosztasHelper.Detail(data);
|
||||
}
|
||||
}
|
||||
|
||||
return tantargyFelosztasHelper;
|
||||
})();
|
||||
</script>
|
|
@ -0,0 +1,10 @@
|
|||
@using Kreta.Web.Areas.Tantargy.Models;
|
||||
|
||||
@model ElutasitasModel
|
||||
|
||||
<div class="container-fluid details">
|
||||
@using (Html.KretaForm("ElutasitasMenteseForm"))
|
||||
{
|
||||
@Html.KretaTextAreaFor(x => x.ElutasitasSzoveg, 20)
|
||||
}
|
||||
</div>
|
437
KretaWeb/Areas/Tantargy/Views/Tantargyak/Index.cshtml
Normal file
437
KretaWeb/Areas/Tantargy/Views/Tantargyak/Index.cshtml
Normal file
|
@ -0,0 +1,437 @@
|
|||
@using Kreta.Framework;
|
||||
@using Kreta.Web.Helpers.Grid;
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@using Kreta.Web.Classes
|
||||
@using Kreta.Enums.ManualEnums
|
||||
@using Kreta.Web.Security;
|
||||
@using Kreta.Resources
|
||||
@model TantargySearchModel
|
||||
|
||||
@{
|
||||
Layout = "~/Views/Shared/_MasterLayout.cshtml";
|
||||
var fullUrl = this.Url.Action("Posts", "Edit", new { id = 5 }, this.Request.Url.Scheme);
|
||||
}
|
||||
|
||||
@section AddSearchPanel {
|
||||
@using (Html.SearchPanelSideBar("searchForm", "TantargyakGrid"))
|
||||
{
|
||||
@Html.KretaTextBoxFor(model => model.TantargyNev).RenderSearchPanelSideBar()
|
||||
@Html.KretaTextBoxFor(model => model.RovidNev).RenderSearchPanelSideBar()
|
||||
@Html.KretaTextBoxFor(model => model.BizonyitvanyNev).RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.IsErtekelesKorlatozva, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.TantargyKategoriaID, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetTargyKategoriaList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.EslTargykategoriaTipusId, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetESLTantargykategoriaList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.IsFotargy, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.KeresesFotargyID, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetFotargyakList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.IsGyakorlati, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.IsAltantargykentBizonyitvanyban, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.IsNincsBeloleOra, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.IsOsztalyNaplobanNemJelenikMeg, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.IsOsztalyokOrarendjebenMegjelenik, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.IsTanulmanyiAtlagbaSzamit, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.IsAmiTargy, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.IsMszgTargyFltr, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.IsKollegiumTargy, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.IsEgymiTargy, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.IsFelnottoktatasTargy, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaTextBoxFor(model => model.AngolNev).RenderSearchPanelSideBar()
|
||||
@Html.KretaTextBoxFor(model => model.NemetNev).RenderSearchPanelSideBar()
|
||||
if (Model.NemzetiDokumentumNyelvekMegjelenjenek)
|
||||
{
|
||||
@Html.KretaTextBoxFor(model => model.HorvatNev).RenderSearchPanelSideBar()
|
||||
@Html.KretaTextBoxFor(model => model.RomanNev).RenderSearchPanelSideBar()
|
||||
@Html.KretaTextBoxFor(model => model.SzerbNev).RenderSearchPanelSideBar()
|
||||
}
|
||||
@Html.HiddenFor(x => x.nincsTantargykategoria)
|
||||
}
|
||||
}
|
||||
|
||||
@section AddTip {
|
||||
<ul id="tipList" style="display: none;">
|
||||
<li>@(StringResourcesUtil.GetString(4136)) @(StringResourcesUtil.GetString(4140))</li>
|
||||
<li>@(StringResourcesUtil.GetString(4136)) @(StringResourcesUtil.GetString(4141))</li>
|
||||
<!--<li>@(StringResourcesUtil.GetString(4136)) @(StringResourcesUtil.GetString(4142))</li>-->
|
||||
<li>@(StringResourcesUtil.GetString(4136)) @(StringResourcesUtil.GetString(4143))</li>
|
||||
</ul>
|
||||
}
|
||||
|
||||
@{
|
||||
List<RowFunction> TantargyRowFunctionList = new List<RowFunction>();
|
||||
TantargyRowFunctionList.Add(new RowFunction { NameResourceId = 118 /*Adatok*/, ClientAction = "TantargyHelper.openTantargyProperties", IconEnum = GridRowFunctionIconEnum.Adatok });
|
||||
|
||||
List<FunctionCommand> TantargyFunctionCommandList = new List<FunctionCommand>();
|
||||
if (ClaimManager.HasPackage("Adminisztrator"))
|
||||
{
|
||||
if (!ClaimData.IsSelectedTanevIsElozo)
|
||||
{
|
||||
TantargyFunctionCommandList.Add(new FunctionCommand { NameResourceId = 115 /*Új*/, ClientAction = "TantargyHelper.openTantargyModifyAdd" });
|
||||
TantargyFunctionCommandList.Add(new FunctionCommand { NameResourceId = 116 /*Módosítás*/, ClientAction = "TantargyHelper.openSelectModWindow" });
|
||||
TantargyFunctionCommandList.Add(new FunctionCommand { NameResourceId = 4750 /*Kijelöltek törlése*/, ClientAction = "TantargyHelper.deleteSelectedTantargy", Classes = "kendo-gridFunctionKommandRed" });
|
||||
}
|
||||
|
||||
TantargyFunctionCommandList.Add(
|
||||
new FunctionCommand
|
||||
{
|
||||
Name = ImportExportCommonResource.Export.ToUpper(),
|
||||
NestedCommands = new List<FunctionCommand> {
|
||||
new FunctionCommand { Name = ImportExportCommonResource.Export, ClientAction = "TantargyHelper.getExport" },
|
||||
new FunctionCommand { Name = TantargyResource.TantargyakMindenAdata, ClientAction = "TantargyHelper.exportTantargyakMindenAdata" }
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
var grid = Html.KretaGrid<TantargyakGridModel>
|
||||
(
|
||||
name: "TantargyakGrid",
|
||||
getUrl: new GridApiUrl(Constants.ApiControllers.TantargyakApi, "GetTantargyakGrid", new Dictionary<string, string> { }),
|
||||
dataParameterFunction: "searchForm",
|
||||
allowScrolling: true,
|
||||
sort: sort => sort.Add(m => m.TantargyNev).Ascending()
|
||||
)
|
||||
.SelectBoxColumn(Html, 0)
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.Sorszam);
|
||||
});
|
||||
|
||||
if (!ClaimData.IsSelectedTanevIsElozo)
|
||||
{
|
||||
grid.LinkButtonColumn("", c => c.TantargyNev, "TantargyHelper.openTantargyOrModify", GridButtonsEnum.Modositas);
|
||||
}
|
||||
else
|
||||
{
|
||||
grid.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.TantargyNev);
|
||||
});
|
||||
}
|
||||
|
||||
grid.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.TargyKategoriaNev);
|
||||
columns.Bound(c => c.IsFotargy_BNAME).Width("10%");
|
||||
columns.Bound(c => c.FoTargyNev);
|
||||
columns.Bound(c => c.GyakorlatiTargy_BNAME);
|
||||
columns.Bound(c => c.IsTanulmanyiAtlagbaSzamit_BNAME);
|
||||
columns.Bound(c => c.IsErtekelesKorlatozva_BNAME);
|
||||
})
|
||||
.RowFunction(Html, TantargyRowFunctionList)
|
||||
.FunctionCommand(Html, TantargyFunctionCommandList)
|
||||
.Sortable(sortable => sortable
|
||||
.AllowUnsort(true)
|
||||
.SortMode(GridSortMode.MultipleColumn));
|
||||
|
||||
if (ClaimManager.HasPackage("Adminisztrator") && !ClaimData.IsSelectedTanevIsElozo)
|
||||
{
|
||||
var conditionalRowFunctions = new List<RowFunction> { };
|
||||
conditionalRowFunctions.Add(new RowFunction { NameResourceId = 116 /*Módosítás*/, ClientAction = "TantargyHelper.openTantargyModifyAdd", IconEnum = Kreta.Enums.ManualEnums.GridRowFunctionIconEnum.Modositas });
|
||||
conditionalRowFunctions.Add(new RowFunction { NameResourceId = 117 /*Törlés*/, ClientAction = "TantargyHelper.deleteTantargyConfirmWindow", IconEnum = Kreta.Enums.ManualEnums.GridRowFunctionIconEnum.Torles });
|
||||
grid.ConditionalRowFunction(Html, conditionalRowFunctions, "TantargyHelper.isSzerkesztheto", conditionalRowFunctions.Count);
|
||||
}
|
||||
}
|
||||
|
||||
<div>
|
||||
@(grid)
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
if ($("#menucaption").text().trim() === "") {
|
||||
$("#menucaption").text("@Html.Raw(StringResourcesUtil.GetString(9 /*Tantárgyak*/))");
|
||||
}
|
||||
});
|
||||
|
||||
var TantargyHelper = (function () {
|
||||
var tantargyHelper = function () { };
|
||||
|
||||
var formName = "TantargyForm";
|
||||
var gridName = "TantargyakGrid";
|
||||
var searchFormName = "searchForm";
|
||||
var modFormName = "TantargyModForm";
|
||||
var isCsoportosModositas = false;
|
||||
|
||||
var url = {
|
||||
OpenTantargyProperties: "@Url.Action("OpenTantargyPropertiesTab", "Tantargyak" , new { area = "Tantargy" })",
|
||||
OpenTeremModifyAddPopup: "@Url.Action("OpenTantargyModifyAddPopup", "Tantargyak", new { area = "Tantargy" })",
|
||||
OpenSelectedMod: "@Url.Action("OpenModPopup", "Tantargyak", new { area = "Tantargy" })",
|
||||
SaveModifiedOrNewTantargy: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "TantargyakApi", action = "SaveModifiedOrNewTantargy" })",
|
||||
DeleteTantargy: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "TantargyakApi", action = "DeleteTantargy" })",
|
||||
DeleteSelectedTantargy: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "TantargyakApi", action = "DeleteSelectedTantargy" })",
|
||||
SaveModTantargy: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { Controller = "TantargyakApi", action = "SaveModTantargy" })",
|
||||
GetExport: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.TantargyakApi, action = "GetExport" })",
|
||||
ExportTantargyakMindenAdata: "@Url.Action("ExportTantargyakMindenAdata", "Tantargyak", new {area = "Tantargy" })",
|
||||
GetFotargyakhozTartozikAltargy: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new {controller = "TantargyakApi", action = "GetFotargyakhozTartozikAltargy" })",
|
||||
GetSzorgalomElegtelenTantargyList: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { Controller = "TantargyakApi", action = "GetSzorgalomElegtelenTantargyList" })"
|
||||
}
|
||||
|
||||
tantargyHelper.hideOrShowComboBox = function () {
|
||||
var popUpIsFotargy = $("#IsFoTargy");
|
||||
var popUpFotargyId = $("#FoTargyCombo");
|
||||
|
||||
if (popUpIsFotargy.data("kendoComboBox").value() === "0") {
|
||||
popUpFotargyId.show();
|
||||
} else {
|
||||
popUpFotargyId.hide();
|
||||
}
|
||||
}
|
||||
|
||||
tantargyHelper.openTantargyProperties = function (rowData) {
|
||||
AjaxHelper.DoGet(url.OpenTantargyProperties, { tantargyID: rowData.ID }, popupTantargyProperties);
|
||||
}
|
||||
|
||||
tantargyHelper.openTantargyOrModify = function (rowData) {
|
||||
if (CommonUtils.parseBool("@ClaimManager.HasPackage("Fenntarto")") || rowData.TantargyNev == "@Html.Raw(TantargyResource.DualisKepzes)" || rowData.TantargyNev == "@Html.Raw(TantargyResource.ApaczaiKonzultacio)") {
|
||||
tantargyHelper.openTantargyProperties(rowData);
|
||||
} else {
|
||||
tantargyHelper.openTantargyModifyAdd(rowData);
|
||||
}
|
||||
}
|
||||
|
||||
tantargyHelper.openTantargyModifyAdd = function (rowData) {
|
||||
if (CommonUtils.isUndefined(rowData.ID)) {
|
||||
AjaxHelper.DoGet(url.OpenTeremModifyAddPopup, { tantargyID: rowData.ID }, popupTantargyAdd);
|
||||
}
|
||||
else {
|
||||
AjaxHelper.DoGet(url.OpenTeremModifyAddPopup, { tantargyID: rowData.ID }, popupTantargyModify);
|
||||
}
|
||||
}
|
||||
|
||||
tantargyHelper.openSelectModWindow = function (data) {
|
||||
var selectedRows = KretaGridHelper.getSelectedRowsByGridName("TantargyakGrid");
|
||||
|
||||
if (selectedRows.length == 0) {
|
||||
KretaWindowHelper.warningWindow("@(TantargyResource.Figyelmeztetes)", "@(TantargyResource.ACsoportosModositashozLegalabbEgyElemKivalasztasaSzukseges)");
|
||||
}
|
||||
else if (selectedRows.length == 1) {
|
||||
if (selectedRows[0].TantargyNev == "@Html.Raw(TantargyResource.DualisKepzes)") {
|
||||
KretaWindowHelper.feedbackWindow("@ErrorResource.Hiba", "@(TantargyResource.DualisKepzesTantargyNemModosithatoMertVedettElem)", true);
|
||||
}
|
||||
else if (selectedRows[0].TantargyNev == "@Html.Raw(TantargyResource.ApaczaiKonzultacio)") {
|
||||
KretaWindowHelper.feedbackWindow("@ErrorResource.Hiba", "@(TantargyResource.ApaczaiKonzultacioTantargyNemModosithatoMertVedettElem)", true);
|
||||
}
|
||||
else {
|
||||
AjaxHelper.DoGet(url.OpenTeremModifyAddPopup, { tantargyID: selectedRows[0].ID }, popupTantargyModify);
|
||||
}
|
||||
}
|
||||
else {
|
||||
var parameters = [];
|
||||
var isDualisSelected = false;
|
||||
var isApaczaiKonzultacioSelected = false;
|
||||
|
||||
$.each(selectedRows, function (index, value) {
|
||||
if (value.TantargyNev == "@Html.Raw(TantargyResource.DualisKepzes)") {
|
||||
isDualisSelected = true;
|
||||
} else if (value.TantargyNev == "@Html.Raw(TantargyResource.ApaczaiKonzultacio)") {
|
||||
isApaczaiKonzultacioSelected = true;
|
||||
} else {
|
||||
parameters.push({ ID: value.ID, TantargyNev: value.TantargyNev });
|
||||
}
|
||||
});
|
||||
|
||||
if (!isDualisSelected && !isApaczaiKonzultacioSelected) {
|
||||
AjaxHelper.DoPost(url.OpenSelectedMod, parameters, popupTantargyModify);
|
||||
}
|
||||
else {
|
||||
if (isDualisSelected) {
|
||||
KretaWindowHelper.feedbackWindow("@ErrorResource.Hiba", "@(TantargyResource.DualisKepzesTantargyNemModosithatoMertVedettElem)", true);
|
||||
}
|
||||
if (isApaczaiKonzultacioSelected) {
|
||||
KretaWindowHelper.feedbackWindow("@ErrorResource.Hiba", "@(TantargyResource.ApaczaiKonzultacioTantargyNemModosithatoMertVedettElem)", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getTantargynevekAminelVanBeirvaEgyes(tantargyIdArray) {
|
||||
AjaxHelper.DoPost(url.GetSzorgalomElegtelenTantargyList, tantargyIdArray, szorgalomTantargyEgyesekConfirmWindow);
|
||||
}
|
||||
|
||||
function szorgalomTantargyEgyesekConfirmWindow(data) {
|
||||
var tantargyArray = $.parseJSON(data);
|
||||
if (isCsoportosModositas) {
|
||||
if (tantargyArray.length == 0) {
|
||||
KretaWindowHelper.confirmWindow("@(TantargyResource.Kerdes)", "@(TantargyResource.BiztosanModositaniSzeretneAKijeloltElemeket)", tantargyHelper.modifySave);
|
||||
}
|
||||
else {
|
||||
KretaWindowHelper.confirmWindow("@(TantargyResource.Kerdes)", "@(TantargyResource.SzorgalomTargyKategoriabaSoroltTantargyaknalEgyesErtekelesTobbesModositas) <br/> @(TantargyResource.BiztosanMentiAModositasokat)".replace("{0}", tantargyArray.join(', ')), tantargyHelper.modifySave);
|
||||
}
|
||||
}
|
||||
else if (tantargyArray.length > 0) {
|
||||
KretaWindowHelper.confirmWindow("@(TantargyResource.Kerdes)", "@(TantargyResource.SzorgalomTargyKategoriabaSoroltTantargyaknalEgyesErtekeles) <br/> @(TantargyResource.BiztosanMentiAModositasokat)", tantargyHelper.modifyAddSave);
|
||||
}
|
||||
else {
|
||||
tantargyHelper.modifyAddSave();
|
||||
}
|
||||
}
|
||||
|
||||
tantargyHelper.modifySave = function () {
|
||||
KretaGridHelper.resetHeaderCheckbox(gridName);
|
||||
AjaxHelper.DoPostElement(url.SaveModTantargy, modFormName, modifyAddSaveFeedBackOk);
|
||||
}
|
||||
|
||||
tantargyHelper.modifyAddSave = function () {
|
||||
AjaxHelper.DoPostElement(url.SaveModifiedOrNewTantargy, formName, modifyAddSaveFeedBackOk);
|
||||
}
|
||||
|
||||
tantargyHelper.deleteTantargyConfirmWindow = function (rowData) {
|
||||
KretaWindowHelper.confirmWindow("@(TantargyResource.Kerdes)", "@(TantargyResource.BiztosanTorli)", deleteTantargy, rowData.ID);
|
||||
}
|
||||
|
||||
tantargyHelper.deleteSelectedTantargy = function (rowData) {
|
||||
var selectedRows = KretaGridHelper.getSelectedRowsByGridName(gridName);
|
||||
if (selectedRows.length > 0) {
|
||||
KretaWindowHelper.confirmWindow("@(TantargyResource.Figyelmeztetes)", "@(TantargyResource.ARendszerCsakAzonSorokatTorliAmelyeknekNincsenekKapcsolataiARendszerbenBiztosanTorliAzAdatokat)", deleteSelectedTantargy);
|
||||
}
|
||||
else {
|
||||
KretaWindowHelper.feedbackWindow("@(TantargyResource.Figyelmeztetes)", "@(TantargyResource.AKijeloltElemekTorlesehezJeloljonKiLegalabbEgyElemet)", true, KretaWindowHelper.destroyAllWindow);
|
||||
}
|
||||
}
|
||||
|
||||
tantargyHelper.propertiesCancel = function () {
|
||||
KretaWindowHelper.destroyWindow("TantargyPropertiesWindow");
|
||||
}
|
||||
|
||||
tantargyHelper.modifyAddCancel = function () {
|
||||
KretaWindowHelper.destroyWindow("TantargyModifyAddWindow");
|
||||
}
|
||||
|
||||
tantargyHelper.saveCsoportosModifyAddTantargy = function () {
|
||||
isCsoportosModositas = true;
|
||||
var tantargyIdArray = $('#' + modFormName).toObject().TantargyakIDArray.split(',');
|
||||
var tantargykategoriaId = $('#TargyKategoria')[0].value;
|
||||
if (tantargykategoriaId == "@((int)Kreta.Enums.TargyKategoriaTipusEnum.Szorgalom)") {
|
||||
|
||||
getTantargynevekAminelVanBeirvaEgyes(tantargyIdArray);
|
||||
}
|
||||
else {
|
||||
KretaWindowHelper.confirmWindow("@(TantargyResource.Kerdes)", "@(TantargyResource.BiztosanModositaniSzeretneAKijeloltElemeket)", tantargyHelper.modifySave);
|
||||
}
|
||||
}
|
||||
|
||||
tantargyHelper.saveModifyAddTantargy = function () {
|
||||
isCsoportosModositas = false;
|
||||
var tantargyIdArray = [];
|
||||
var tantargyId = $('#' + formName).toObject().ID;
|
||||
tantargyIdArray.push(tantargyId);
|
||||
var tantargykategoriaId = $('#TargyKategoria')[0].value;
|
||||
if (tantargykategoriaId == "@((int)Kreta.Enums.TargyKategoriaTipusEnum.Szorgalom)" && typeof tantargyId !== "undefined") {
|
||||
getTantargynevekAminelVanBeirvaEgyes(tantargyIdArray);
|
||||
}
|
||||
else {
|
||||
tantargyHelper.modifyAddSave();
|
||||
}
|
||||
}
|
||||
|
||||
tantargyHelper.getExport = function () {
|
||||
KretaGridHelper.getExportBySearchForm(gridName, url.GetExport, searchFormName)
|
||||
}
|
||||
|
||||
tantargyHelper.exportTantargyakGrid = function () {
|
||||
window.location = url.ExportTantargyakGrid + "?" + $.param(KretaGridHelper.getSearchParametersWithoutInputNames(searchFormName));
|
||||
}
|
||||
|
||||
tantargyHelper.exportTantargyakMindenAdata = function () {
|
||||
window.location = url.ExportTantargyakMindenAdata + "?" + $.param(KretaGridHelper.getSearchParametersWithoutInputNames(searchFormName));
|
||||
}
|
||||
|
||||
tantargyHelper.isSzerkesztheto = function (rowData) {
|
||||
return (rowData.TantargyNev != "@Html.Raw(TantargyResource.DualisKepzes)") && (rowData.TantargyNev != "@Html.Raw(TantargyResource.ApaczaiKonzultacio)");
|
||||
}
|
||||
|
||||
function popupTantargyProperties(data) {
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@(TantargyResource.TantargyAdatai)";
|
||||
config.content = data;
|
||||
var modal = KretaWindowHelper.createWindow("TantargyPropertiesWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
}
|
||||
|
||||
function popupTantargyModify(data) {
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@(TantargyResource.TantargyModositasa)";
|
||||
config.content = data;
|
||||
var modal = KretaWindowHelper.createWindow("TantargyModifyAddWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
|
||||
var title = $("#TantargyModifyAddWindow_wnd_title").text();
|
||||
var targynev = $(".tantargynev").val();
|
||||
var rovidTargynev = $("#TantargyRovidNev").val();
|
||||
|
||||
if (targynev !== undefined) {
|
||||
title += " - " + targynev;
|
||||
if (!CommonUtils.isNullOrWhiteSpace(rovidTargynev)) {
|
||||
title += " - " + rovidTargynev;
|
||||
}
|
||||
|
||||
$("#TantargyModifyAddWindow_wnd_title").text(title);
|
||||
}
|
||||
}
|
||||
|
||||
function popupTantargyAdd(data) {
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@(TantargyResource.TantargyFelvetele)";
|
||||
config.content = data;
|
||||
var modal = KretaWindowHelper.createWindow("TantargyModifyAddWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
}
|
||||
|
||||
function deleteTantargy(data) {
|
||||
AjaxHelper.DoPost(url.DeleteTantargy, data, deleteTantargyResponseOk, deleteFeedbackFail);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function deleteSelectedTantargy() {
|
||||
var selectedRows = KretaGridHelper.getSelectedRowsByGridName(gridName);
|
||||
if (selectedRows.length > 0) {
|
||||
var parameters = [];
|
||||
$.each(selectedRows, function(index, value) {
|
||||
parameters.push(value.ID);
|
||||
});
|
||||
|
||||
AjaxHelper.DoPost(url.DeleteSelectedTantargy, parameters, deleteSelectedTantargyResponseOk, deleteSelectedTantargyResponseError);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function deleteSelectedTantargyResponseError(data) {
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
AjaxHelper.ShowError(data);
|
||||
}
|
||||
|
||||
function modifyAddSaveFeedBackOk() {
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function deleteTantargyResponseOk() {
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function deleteSelectedTantargyResponseOk(data) {
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow, data.Message);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function deleteFeedbackFail(data) {
|
||||
var message = data.responseJSON.Message;
|
||||
KretaWindowHelper.feedbackWindow(Globalization.Hiba /*HIBA*/, message, true, KretaWindowHelper.destroyAllWindow);
|
||||
}
|
||||
|
||||
tantargyHelper.ValidateFotargyAltarggyaAlakithato = function (tantargyIdList) {
|
||||
var parameters = [];
|
||||
$.each(tantargyIdList, function (index, value) {
|
||||
parameters.push(tantargyIdList[index]);
|
||||
});
|
||||
AjaxHelper.DoPost(url.GetFotargyakhozTartozikAltargy, parameters, null, validateFotargyAltarggyaAlakithatoError)
|
||||
}
|
||||
|
||||
function validateFotargyAltarggyaAlakithatoError(data) {
|
||||
$("#IsFoTargy").prop("checked", true);
|
||||
AjaxHelper.ShowError(data);
|
||||
}
|
||||
|
||||
return tantargyHelper;
|
||||
})();
|
||||
</script>
|
|
@ -0,0 +1,92 @@
|
|||
@using Kreta.Enums
|
||||
@using Kreta.Resources
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
|
||||
@model TantargyModel
|
||||
|
||||
<div class="container-fluid details">
|
||||
@Html.HiddenFor(x => x.ID)
|
||||
@Html.HiddenFor(x => x.GyakorlatigenyessegKategoriak)
|
||||
|
||||
<div class="row">
|
||||
@Html.KretaTextBoxFor(x => x.TantargyNev, new Dictionary<string, object> { { "class", "tantargynev" } }).RenderWithName(3, 3)
|
||||
@Html.KretaTextBoxFor(x => x.TantargyRovidNev).RenderWithName(3, 3)
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@Html.KretaNumericFor(x => x.Sorszam).Min(Kreta.Core.Constants.MinMaxValues.MinTantargySorszam).Max(Kreta.Core.Constants.MinMaxValues.MaxTantargySorszam).RenderWithName(3, 3)
|
||||
@Html.KretaTextBoxFor(x => x.NevNyomtatvanyban).RenderWithName(3, 3)
|
||||
@Html.KretaTextBox("NevNyomtatvanybanHider", true, new Dictionary<string, object> { { "readonly", "true" }, { "data-labelmsg", TantargyResource.BizonyitvanybanMegjelenoNev } }).RenderWithName(3, 3)
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.TargyKategoria, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetTargyKategoriaList" }), "Text", "Value", new Dictionary<string, object>() { { "style", "width: 75%" } }).AutoBind(true).RenderWithName(3, 3)
|
||||
@Html.KretaComboBoxFor(x => x.ESLTargyKategoria, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetESLTantargykategoriaList" })).AutoBind(true).RenderWithName(3, 3)
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@Html.KretaNumericFor(x => x.Gyakorlatigenyesseg).Min(1).Max(99).Decimals(0).RenderWithName(3, 3)
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@Html.KretaCheckBoxFor(x => x.IsFoTargy).RenderWithName(3, 3, allSizeSame: true)
|
||||
@Html.KretaCheckBoxFor(x => x.GyakorlatiTargy).RenderWithName(3, 3, allSizeSame: true)
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@Html.KretaCheckBoxFor(x => x.AltantargyNyomtatvanyban).RenderWithName(3, 3, allSizeSame: true)
|
||||
@if (Model.ID != null && Model.ID > 0)
|
||||
{
|
||||
@Html.KretaComboBoxFor(x => x.FoTargyID, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetFotargyakListWithoutSameTargy" }) + "?targyId=" + Model.ID.ToString(), "Text", "Value").AutoBind(true).RenderWithName(3, 3)
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.KretaComboBoxFor(x => x.FoTargyID, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetFotargyakList" }), "Text", "Value").AutoBind(true).RenderWithName(3, 3)
|
||||
}
|
||||
</div>
|
||||
|
||||
@*<div class="row"></div>*@
|
||||
|
||||
<div class="row">
|
||||
@Html.KretaTextBoxFor(x => x.Megjegyzes).RenderWithName(3, 9)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
|
||||
$('#IsFoTargy').unbind("change");
|
||||
$('#IsFoTargy').bind("change", foTargyChange);
|
||||
$('#IsFoTargy').bind("change", foTantargySelectRequired);
|
||||
$('#IsFoTargy').trigger("change");
|
||||
|
||||
$('#AltantargyNyomtatvanyban').unbind("change");
|
||||
$('#AltantargyNyomtatvanyban').bind("change", foTantargySelectRequired);
|
||||
$('#AltantargyNyomtatvanyban').trigger("change");
|
||||
|
||||
});
|
||||
|
||||
function foTantargySelectRequired() {
|
||||
var isAltantargyNyomtatvanyban = KretaCheckBoxHelper.getValue("AltantargyNyomtatvanyban");
|
||||
var isFoTantargy = KretaCheckBoxHelper.getValue("IsFoTargy");
|
||||
if (isAltantargyNyomtatvanyban || !isFoTantargy) {
|
||||
$("#FoTargyID").parent().parent().removeClass('disabledItem');
|
||||
if ($("[for*='FoTargyID']").text().indexOf("*") === -1) {
|
||||
$("[for*='FoTargyID']").append($("<span>", { "class": "required-indicator", "style": "padding-left:4px" }).text("*"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("[for*='FoTargyID'] .required-indicator").remove();
|
||||
}
|
||||
}
|
||||
|
||||
function foTargyChange() {
|
||||
var isFotargy = KretaCheckBoxHelper.getValue("IsFoTargy");
|
||||
if (!isFotargy) {
|
||||
$("#FoTargyID").parent().parent().removeClass('disabledItem');
|
||||
} else {
|
||||
$("#FoTargyID").parent().parent().addClass('disabledItem');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
|
@ -0,0 +1,29 @@
|
|||
@using Kreta.Web.Areas.Tantargy.Models;
|
||||
@using Kreta.Enums;
|
||||
|
||||
@model TantargyModel
|
||||
|
||||
<div class="container-fluid details">
|
||||
<div class="row">
|
||||
@Html.KretaTextBoxFor(x => x.TantargyAngolNev).RenderWithName(3, 3)
|
||||
@Html.KretaTextBoxFor(x => x.TantargyNemetNev).RenderWithName(3, 3)
|
||||
</div>
|
||||
|
||||
@if (Model.NemzetiDokumentumNyelvekMegjelenjenek)
|
||||
{
|
||||
<div class="row">
|
||||
@if (Model.NemzetiDokumentumNyelvek.Any(x => x == ((int)AnyanyelvEnum.horvat)))
|
||||
{
|
||||
@Html.KretaTextBoxFor(x => x.TantargyHorvatNev).RenderWithName(3, 3)
|
||||
}
|
||||
@if (Model.NemzetiDokumentumNyelvek.Any(x => x == ((int)AnyanyelvEnum.roman)))
|
||||
{
|
||||
@Html.KretaTextBoxFor(x => x.TantargyRomanNev).RenderWithName(3, 3)
|
||||
}
|
||||
@if (Model.NemzetiDokumentumNyelvek.Any(x => x == ((int)AnyanyelvEnum.szerb)))
|
||||
{
|
||||
@Html.KretaTextBoxFor(x => x.TantargySzerbNev).RenderWithName(3, 3)
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
|
@ -0,0 +1,182 @@
|
|||
@using Kreta.Web.Areas.Tantargy.Models;
|
||||
@using Kreta.Web.Security;
|
||||
@using Kreta.Resources;
|
||||
|
||||
@model TantargyModel
|
||||
|
||||
@Scripts.Render("~/bundles/AmiKepzesiJellemzokHelper")
|
||||
|
||||
<div class="container-fluid details">
|
||||
<div class="row">
|
||||
@Html.KretaCheckBoxFor(x => x.IsTanulmanyiAtlagbaNemSzamit).RenderWithName(3, 3, allSizeSame: true, tooltipResource: TantargyResource.TanulmanyiAtlagNemSzamitBeleTooltip)
|
||||
@Html.KretaCheckBoxFor(x => x.IsNincsBeloleOraMod).RenderWithName(3, 3, allSizeSame: true, tooltipResource: TantargyResource.NincsbeloleOraTooltip)
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@Html.KretaCheckBoxFor(x => x.IsOsztalynaplobanNemJelenikMeg).RenderWithName(3, 3, allSizeSame: true, tooltipResource: TantargyResource.OsztalynaplobanNemJelenikMegTooltip)
|
||||
@Html.KretaCheckBoxFor(x => x.IsOsztalyEsTanuloiOrarendbenNemJelenikMeg).RenderWithName(3, 3, allSizeSame: true, tooltipResource: TantargyResource.OsztalyEsTanuloiOrarendbenNemJelenikMegTooltip)
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@Html.KretaMultiSelectFor(x => x.ErtekelesKorlatozasIdList, Model.ErtekelesKorlatozasList).RenderWithName(3, 9, tooltipResource: TantargyResource.ErtekelesKorlatozasToolTip)
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@Html.KretaCheckBoxFor(x => x.IsFelnottOktatas).RenderWithName(3, 3, allSizeSame: true)
|
||||
@Html.KretaCheckBoxFor(x => x.IsKollegiumiTargy).RenderWithName(3, 3, allSizeSame: true)
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@Html.KretaCheckBoxFor(x => x.IsEgymi).RenderWithName(3, 3, allSizeSame: true)
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@Html.KretaCheckBoxFor(x => x.IsAmiTargyMod).RenderWithName(3, 3, allSizeSame: true)
|
||||
@Html.KretaCheckBoxFor(x => x.IsMszgTargy).RenderWithName(3, 3, allSizeSame: true)
|
||||
</div>
|
||||
|
||||
<div id="AmiKepzesiJellemzokModelForm">
|
||||
@Html.Partial("_AmiKepzesiJellemzok_Partial", Model.AmiKepzesiJellemzokModel)
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var amiKepzesiJellemzokHelper = new AmiKepzesiJellemzokHelper();
|
||||
var osztalyOrarendjebenNemJelenikMegElozoErtek;
|
||||
|
||||
$(document).ready(function () {
|
||||
setGyakorlatigenyessegMezo();
|
||||
if ($("#IsFoTargy").is(':checked')) {
|
||||
$("#FoTargyID").data("kendoComboBox").enable(false);
|
||||
var nyomtatvanyban = $("#AltantargyNyomtatvanyban");
|
||||
nyomtatvanyban.prop("disabled", true);
|
||||
nyomtatvanyban.prop("checked", false);
|
||||
}
|
||||
|
||||
osztalyOrarendjebenNemJelenikMegElozoErtek = document.getElementById("IsOsztalyEsTanuloiOrarendbenNemJelenikMeg").checked;
|
||||
changeOsztalyTanuloOrarendCheckbox();
|
||||
originalErtekelesKorlatozasIdList = undefined;
|
||||
$('#IsOsztalynaplobanNemJelenikMeg').unbind("change");
|
||||
$('#IsOsztalynaplobanNemJelenikMeg').bind("change", IsOsztalynaplobanNemJelenikMeg_change);
|
||||
$('#IsOsztalynaplobanNemJelenikMeg').trigger("change");
|
||||
|
||||
setAmiMszgTargyDisable("IsAmiTargyMod", "IsMszgTargy");
|
||||
setAmiMszgTargyDisable("IsMszgTargy", "IsAmiTargyMod");
|
||||
setMufajTanszakVisibility();
|
||||
});
|
||||
|
||||
$("#IsAmiTargyMod").change(function () {
|
||||
setAmiMszgTargyDisable("IsAmiTargyMod", "IsMszgTargy");
|
||||
setMufajTanszakVisibility();
|
||||
});
|
||||
|
||||
$("#IsMszgTargy").change(function () {
|
||||
setAmiMszgTargyDisable("IsMszgTargy", "IsAmiTargyMod");
|
||||
setMufajTanszakVisibility();
|
||||
});
|
||||
|
||||
$("#TargyKategoria").change(function () {
|
||||
setGyakorlatigenyessegMezo();
|
||||
});
|
||||
|
||||
$("#IsFoTargy").change(function () {
|
||||
var fotargy = $("#FoTargyID");
|
||||
var nyomtatvanyban = $("#AltantargyNyomtatvanyban");
|
||||
if (this.checked) {
|
||||
fotargy.data("kendoComboBox").enable(false);
|
||||
nyomtatvanyban.prop("disabled", true);
|
||||
fotargy.data("kendoComboBox").value("");
|
||||
nyomtatvanyban.prop("checked", false);
|
||||
}
|
||||
else {
|
||||
var tantargyIdList = [];
|
||||
tantargyIdList.push(@Model.ID);
|
||||
TantargyHelper.ValidateFotargyAltarggyaAlakithato(tantargyIdList)
|
||||
fotargy.data("kendoComboBox").enable(true);
|
||||
nyomtatvanyban.prop("disabled", $('#IsOsztalynaplobanNemJelenikMeg').is(':checked'));
|
||||
fotargy.data("kendoComboBox").value("");
|
||||
}
|
||||
});
|
||||
|
||||
function setGyakorlatigenyessegMezo() {
|
||||
var gyakorlatigenyessegKategoriak = CommonUtils.JSONparse("@Html.Raw(Json.Encode(@Model.GyakorlatigenyessegKategoriak))");
|
||||
var showGyakorlatigenyessegDiv = gyakorlatigenyessegKategoriak.contains(parseInt($("#TargyKategoria").val()));
|
||||
if (showGyakorlatigenyessegDiv && CommonUtils.parseBool("@(ClaimData.IsSelectedTanev20_21OrLater && ClaimData.IsSzakkepzoIntezmeny)")) {
|
||||
$("#Gyakorlatigenyesseg").parents("div .row").show();
|
||||
}
|
||||
else {
|
||||
$("#Gyakorlatigenyesseg").parents("div .row").hide();
|
||||
KretaNumericHelper.setValue("Gyakorlatigenyesseg", null);
|
||||
}
|
||||
}
|
||||
|
||||
$("#IsNincsBeloleOraMod").change(function () {
|
||||
changeOsztalyTanuloOrarendCheckbox();
|
||||
});
|
||||
|
||||
function changeOsztalyTanuloOrarendCheckbox() {
|
||||
var isNincsbeloleora = $("#IsNincsBeloleOraMod").is(':checked');
|
||||
var osztalyOrarendjebenNemJelenikMeg = $("#IsOsztalyEsTanuloiOrarendbenNemJelenikMeg");
|
||||
|
||||
if (isNincsbeloleora) {
|
||||
osztalyOrarendjebenNemJelenikMegElozoErtek = osztalyOrarendjebenNemJelenikMeg.is(':checked');
|
||||
osztalyOrarendjebenNemJelenikMeg.prop("checked", true)
|
||||
osztalyOrarendjebenNemJelenikMeg.attr("disabled", true);
|
||||
}
|
||||
else {
|
||||
osztalyOrarendjebenNemJelenikMeg.attr("disabled", false);
|
||||
osztalyOrarendjebenNemJelenikMeg.prop("checked", osztalyOrarendjebenNemJelenikMegElozoErtek)
|
||||
}
|
||||
}
|
||||
|
||||
var originalErtekelesKorlatozasIdList;
|
||||
|
||||
function IsOsztalynaplobanNemJelenikMeg_change(e) {
|
||||
var ertKorlList = $('#ErtekelesKorlatozasIdList').data('kendoMultiSelect');
|
||||
var isFotargy = $('#IsFoTargy');
|
||||
var altargyBizonyitvanyban = $('#AltantargyNyomtatvanyban');
|
||||
var bizonyitvanybanMegjelenoNev = $('#NevNyomtatvanyban').parent();
|
||||
var bizonyitvanybanMegjelenoNevLabel = $('label[for="NevNyomtatvanyban"]').parent();
|
||||
var bizonyitvanybanMegjelenoNevHider = $('#NevNyomtatvanybanHider').parent();
|
||||
var bizonyitvanybanMegjelenoNevHiderLabel = $('label[for="NevNyomtatvanybanHider"]').parent();
|
||||
if (this.checked) {
|
||||
originalErtekelesKorlatozasIdList = ertKorlList.value();
|
||||
ertKorlList.value([]);
|
||||
bizonyitvanybanMegjelenoNev.hide();
|
||||
bizonyitvanybanMegjelenoNevLabel.hide();
|
||||
bizonyitvanybanMegjelenoNevHider.show();
|
||||
bizonyitvanybanMegjelenoNevHiderLabel.show();
|
||||
}
|
||||
else {
|
||||
ertKorlList.value(originalErtekelesKorlatozasIdList);
|
||||
bizonyitvanybanMegjelenoNev.show();
|
||||
bizonyitvanybanMegjelenoNevLabel.show();
|
||||
bizonyitvanybanMegjelenoNevHider.hide();
|
||||
bizonyitvanybanMegjelenoNevHiderLabel.hide();
|
||||
}
|
||||
ertKorlList.readonly(this.checked);
|
||||
altargyBizonyitvanyban.prop("disabled", isFotargy.is(":checked") || this.checked);
|
||||
};
|
||||
|
||||
function setMufajTanszakVisibility() {
|
||||
var isAmiTargy = KretaCheckBoxHelper.getValue("IsAmiTargyMod");
|
||||
|
||||
if (isAmiTargy) {
|
||||
$("#AmiKepzesiJellemzokModelForm").show();
|
||||
amiKepzesiJellemzokHelper.setAmiKepzesiJellemzokRequiredProperty(true);
|
||||
} else {
|
||||
$("#AmiKepzesiJellemzokModelForm").hide();
|
||||
amiKepzesiJellemzokHelper.setAmiKepzesiJellemzokRequiredProperty(false);
|
||||
}
|
||||
}
|
||||
|
||||
function setAmiMszgTargyDisable(valueName, displayName) {
|
||||
var value = KretaCheckBoxHelper.getValue(valueName);
|
||||
|
||||
if (value) {
|
||||
$("#" + displayName).parent().addClass("disabledItem");
|
||||
}
|
||||
else {
|
||||
$("#" + displayName).parent().removeClass("disabledItem");
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,97 @@
|
|||
@using Kreta.Enums
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@using Kreta.Resources;
|
||||
@model TantargyModel
|
||||
|
||||
<div class="container-fluid details">
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.TantargyNev, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.TantargyRovidNev, 3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.NevNyomtatvanyban, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.ErtekelesKorlatozasStringList, 3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.TargyKategoriaNev, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.ESLTargyKategoriaNev, 3, 3)
|
||||
</div>
|
||||
@if (Model.IsGyakorlatigenyessegKategoria)
|
||||
{
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.Gyakorlatigenyesseg, 3, 3)
|
||||
</div>
|
||||
}
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.IsFoTargy_BNAME, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.FoTargyNev, 3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.IsTanulmanyiAtlagbaNemSzamit_BNAME, 3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.GyakorlatiTargy_BNAME, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.AltantargyNyomtatvanyban_BNAME, 3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.IsNincsBeloleOra_BNAME, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.IsKollegiumiTargy_BNAME, 3, 3)
|
||||
@*@Html.KretaLabelFor(x => x.IsOsztalynaplobanMegjelenik_BNAME, 3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.IsOsztalyokOrarendjebenMegjelenik_BNAME, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.IsTantargyAtlagSzamit_BNAME, 3, 3)*@
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.IsEgymi_BNAME, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.IsFelnottOktatas_BNAME, 3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.IsAmiTargy_BNAME, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.IsMszgTargy_BNAME, 3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.Sorszam, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.Tanev, 3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.TantargyAngolNev, 3, 3)
|
||||
@Html.KretaLabelFor(x => x.TantargyNemetNev, 3, 3)
|
||||
</div>
|
||||
@if (Model.NemzetiDokumentumNyelvekMegjelenjenek)
|
||||
{
|
||||
<div class="row">
|
||||
@if (Model.NemzetiDokumentumNyelvek.Any(x => x.ToString() == ((int)AnyanyelvEnum.horvat).ToString()))
|
||||
{
|
||||
@Html.KretaLabelFor(x => x.TantargyHorvatNev, 3, 3)
|
||||
}
|
||||
@if (Model.NemzetiDokumentumNyelvek.Any(x => x.ToString() == ((int)AnyanyelvEnum.roman).ToString()))
|
||||
{
|
||||
@Html.KretaLabelFor(x => x.TantargyRomanNev, 3, 3)
|
||||
}
|
||||
@if (Model.NemzetiDokumentumNyelvek.Any(x => x.ToString() == ((int)AnyanyelvEnum.szerb).ToString()))
|
||||
{
|
||||
@Html.KretaLabelFor(x => x.TantargySzerbNev, 3, 3)
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.Megjegyzes, 3, 3)
|
||||
</div>
|
||||
|
||||
@if (Model.IsAmiTargyMod)
|
||||
{
|
||||
<h4 class="normaltexttransform">@OsztalyCsoportResource.AmiKepzesiJellemzok</h4>
|
||||
<div class="amiKepzesiAdatokTitleContainer">
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(model => model.AmiKepzesiJellemzokModel.MuveszetiAg_DNAME, 3, 3)
|
||||
@Html.KretaLabelFor(model => model.AmiKepzesiJellemzokModel.TanszakTipus_DNAME, 3, 3)
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(model => model.AmiKepzesiJellemzokModel.MufajTipus_DNAME, 3, 3)
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
|
@ -0,0 +1,37 @@
|
|||
@using Kreta.BusinessLogic.Classes
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@using Kreta.Web.Areas.TanuloErtekeles.Models.TanuloErtekeles
|
||||
@using Kreta.Web.Helpers.Grid;
|
||||
|
||||
@model TantargyModel
|
||||
|
||||
@section AddCss {
|
||||
@Styles.Render(Constants.General.TanuloErtekelesCSS)
|
||||
}
|
||||
|
||||
<div>
|
||||
@(
|
||||
Html.KretaGrid<TanuloErtekelesListGridModel>
|
||||
(
|
||||
"TantargyErtekeleseiGrid",
|
||||
new GridApiUrl("TantargyakApi", "GetTantargyErtekelesListGrid", new Dictionary<string, string> { { "tantargyId", Model.ID.ToString() } }),
|
||||
sort: sort =>
|
||||
{
|
||||
sort.Add(m => m.TanuloNevElotagNelkul).Ascending();
|
||||
sort.Add(m => m.OsztalyCsoportNev).Ascending();
|
||||
})
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.TanuloNevElotagNelkul).SetDisplayProperty("TanuloNev");
|
||||
columns.Bound(c => c.OsztalyCsoportNev).Width("13%").SetDisplayPropertyWithToolip("OsztalyCsoportNev");
|
||||
columns.Bound(c => c.Datum).Width("90px").Format(SDAFormat.Format[SDAFormat.FormatType.ShortDate]);
|
||||
columns.Bound(c => c.ErtekelesTema).Width("14%").SetDisplayPropertyWithToolip("ErtekelesTema");
|
||||
columns.Bound(c => c.TanuloErtekelesText).Width("15%").SetDisplayPropertyWithToolip("TanuloErtekelesText", additionalClasses: "MagatartasSzorgalomSortores").Sortable(false);
|
||||
columns.Bound(c => c.ErtekelesModId_DNAME).Width("13%").SetDisplayPropertyWithToolip("ErtekelesModId_DNAME");
|
||||
columns.Bound(c => c.ErtekeloNyomtatasiNevElotagNelkul).Width("14%").SetDisplayPropertyWithToolip("ErtekeloNyomtatasiNev");
|
||||
})
|
||||
.Sortable(sortable => sortable
|
||||
.AllowUnsort(true)
|
||||
.SortMode(GridSortMode.MultipleColumn))
|
||||
)
|
||||
</div>
|
|
@ -0,0 +1,26 @@
|
|||
@using Kreta.Framework;
|
||||
@using Kreta.Web.Helpers.Grid;
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@using Kreta.Web.Classes
|
||||
@using Kreta.Enums.ManualEnums
|
||||
@model TantargyModel
|
||||
|
||||
<div>
|
||||
@(
|
||||
Html.KretaGrid<TantargyFoglalkozasaiGridModel>
|
||||
(
|
||||
name: "TantargyFoglalkozasaiGrid",
|
||||
getUrl: new GridApiUrl("TantargyakApi", "GetTantargyFoglalkozasaiGrid", new Dictionary<string, string> { { "tantargyID", Model.ID.ToString() } })
|
||||
)
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.OsztalyCsoport);
|
||||
columns.Bound(c => c.Tanar);
|
||||
columns.Bound(c => c.Oraszam).Width("10%");
|
||||
columns.Bound(c => c.Tipus_DNAME);
|
||||
})
|
||||
.Sortable(sortable => sortable
|
||||
.AllowUnsort(true)
|
||||
.SortMode(GridSortMode.MultipleColumn))
|
||||
)
|
||||
</div>
|
|
@ -0,0 +1,25 @@
|
|||
@using Kreta.BusinessLogic.Classes
|
||||
@using Kreta.Web.Helpers.Grid;
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@model TantargyModel
|
||||
|
||||
<div>
|
||||
@(
|
||||
Html.KretaGrid<TantargyMegtartottTanoraiGridModel>
|
||||
(
|
||||
name: "TantargyMegtartottTanoraiGrid",
|
||||
getUrl: new GridApiUrl("TantargyakApi", "GetTantargyMegtartottTanoraiGrid", new Dictionary<string, string> { { "tantargyID", Model.ID.ToString() } })
|
||||
)
|
||||
.Columns(columns =>
|
||||
{
|
||||
@*columns.Bound(c => c.EvesSorszam).Width("10%");*@
|
||||
columns.Bound(c => c.OsztalyCsoport);
|
||||
columns.Bound(c => c.Tema);
|
||||
columns.Bound(c => c.Datum).Width("10%").Format(SDAFormat.Format[SDAFormat.FormatType.ShortDate]);
|
||||
columns.Bound(c => c.Oraszam).Width("10%");
|
||||
})
|
||||
.Sortable(sortable => sortable
|
||||
.AllowUnsort(true)
|
||||
.SortMode(GridSortMode.MultipleColumn))
|
||||
)
|
||||
</div>
|
|
@ -0,0 +1,12 @@
|
|||
@using Kreta.Web.Helpers
|
||||
@using Kreta.Web.Models.EditorTemplates;
|
||||
@model TabStripModel
|
||||
|
||||
@using (Html.KretaForm("TantargyForm"))
|
||||
{
|
||||
@Html.KretaValidationSummary()
|
||||
|
||||
<div id="NewTantargyTabStrip">@Html.Partial(@"EditorTemplates\TabStrip", Model.TabList)</div>
|
||||
@Html.KretaTabStrip("NewTantargyTabStrip").RenderOnModal();
|
||||
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
@using Kreta.Web.Helpers
|
||||
@using Kreta.Resources
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@model TantargyModModel
|
||||
|
||||
@* Ez a többes módosítás felülete *@
|
||||
<style>
|
||||
#TantargyTabstrip {
|
||||
height: 95%;
|
||||
}
|
||||
|
||||
#TobbesTantargyModKivalasztottTantargyNevek {
|
||||
min-height: 36px;
|
||||
max-height: 5%;
|
||||
width: calc(100% - 205px);
|
||||
display: inline-flex;
|
||||
font-weight: bold;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
#TobbesTantargyModKivalasztottTantargyNevekCim {
|
||||
padding-left: 13px;
|
||||
padding-top: 13px;
|
||||
min-height: 36px;
|
||||
max-height: 5%;
|
||||
width: 188px;
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#TobbesTantargyModPopUpContainer {
|
||||
height: calc(100% - 13px);
|
||||
}
|
||||
|
||||
#TantargyModWindow .modalContainer .modalContent > .k-content {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
@using (Html.KretaForm("TantargyModForm"))
|
||||
{
|
||||
@Html.KretaValidationSummary()
|
||||
|
||||
@Html.HiddenFor(x => x.ID)
|
||||
@Html.HiddenFor(x => x.TantargyakIDArray)
|
||||
|
||||
<div id="TobbesTantargyModPopUpContainer">
|
||||
<div id="TobbesTantargyModKivalasztottTantargyNevekCim">
|
||||
@TantargyResource.KivalasztottTantargyak
|
||||
</div>
|
||||
<div id="TobbesTantargyModKivalasztottTantargyNevek">
|
||||
@Model.TantargyakNevArray
|
||||
</div>
|
||||
|
||||
<div id="TantargyTabstrip">
|
||||
@Html.Partial(@"EditorTemplates\TabStrip", Model.TabList)
|
||||
</div>
|
||||
</div>
|
||||
@Html.KretaTabStrip("TantargyTabstrip").RenderOnModal()
|
||||
}
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
if ($("#IsFoTargy").is(':checked')) {
|
||||
$("div[name*='AltantargyAdat']").addClass('displayNone');
|
||||
}
|
||||
else {
|
||||
$("div[name*='AltantargyAdat']").removeClass('displayNone');
|
||||
}
|
||||
});
|
||||
|
||||
$("#IsFoTargy").change(function () {
|
||||
if (this.checked) {
|
||||
$("div[name*='AltantargyAdat']").addClass('displayNone');
|
||||
$("#FoTargyID").data("kendoComboBox").value("");
|
||||
}
|
||||
else {
|
||||
var tantargyIdList = [];
|
||||
tantargyIdList.push(@Model.TantargyakIDArray);
|
||||
TantargyHelper.ValidateFotargyAltarggyaAlakithato(tantargyIdList);
|
||||
$("div[name*='AltantargyAdat']").removeClass('displayNone');
|
||||
$("#FoTargyID").data("kendoComboBox").value("");
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$("#AltantargyNyomtatvanyban").change(function () {
|
||||
if ($("#AltantargyNyomtatvanyban").data('kendoComboBox').select().valueOf() == 0) {
|
||||
$("#IsFoTargy").data('kendoComboBox').select(1);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$("#IsFoTargy").change(function () {
|
||||
if ($("#IsFoTargy").data('kendoComboBox').select().valueOf() == 0) {
|
||||
$("#AltantargyNyomtatvanyban").data('kendoComboBox').select(1);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$("#TargyKategoria").change(function () {
|
||||
var tantargykategoriaId = $('#TargyKategoria')[0].value;
|
||||
if (tantargykategoriaId == "@((int)Kreta.Enums.TargyKategoriaTipusEnum.Szorgalom)") {
|
||||
var tantargyIdList = [];
|
||||
tantargyIdList.push(@Model.TantargyakIDArray);
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
|
@ -0,0 +1,30 @@
|
|||
@using Kreta.Framework;
|
||||
@using Kreta.Web.Helpers.Grid;
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@using Kreta.Web.Classes
|
||||
@using Kreta.BusinessLogic.Classes
|
||||
@model TantargyModel
|
||||
|
||||
<div>
|
||||
@(
|
||||
Html.KretaGrid<TantargyOrarendiOraiGridModel>
|
||||
(
|
||||
name: "TantargyOrarendiOraiGrid",
|
||||
getUrl: new GridApiUrl("TantargyakApi", "GetTantargyOrarendiOraiGrid", new Dictionary<string, string> { { "tantargyID", Model.ID.ToString() } })
|
||||
)
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.Hetirend_DNAME).Width("10%");
|
||||
columns.Bound(c => c.Hetnapja_DNAME).Width("15%").Sortable(false);
|
||||
columns.Bound(c => c.Ora).Width("10%");
|
||||
columns.Bound(c => c.OsztCsop);
|
||||
columns.Bound(c => c.Terem);
|
||||
columns.Bound(c => c.ErvenyessegKezdete).Format(SDAFormat.Format[SDAFormat.FormatType.ShortDate]).Width("10%");
|
||||
columns.Bound(c => c.ErvenyessegVege).Format(SDAFormat.Format[SDAFormat.FormatType.ShortDate]).Width("10%");
|
||||
})
|
||||
.Sortable(sortable => sortable
|
||||
.AllowUnsort(true)
|
||||
.SortMode(GridSortMode.MultipleColumn))
|
||||
)
|
||||
|
||||
</div>
|
|
@ -0,0 +1,5 @@
|
|||
@using Kreta.Web.Helpers
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@model TantargyModel
|
||||
|
||||
@Html.KretaTabStripAjax("tabstrip", Model.TabList)
|
|
@ -0,0 +1,23 @@
|
|||
@using Kreta.Web.Helpers.Grid;
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@model TantargyModel
|
||||
|
||||
<div>
|
||||
@(
|
||||
Html.KretaGrid<TantargyTanmeneteiGridModel>
|
||||
(
|
||||
name: "TantargyTanmeneteiGrid",
|
||||
getUrl: new GridApiUrl("TantargyakApi", "GetTantargyTanmeneteiGrid", new Dictionary<string, string> { { "tantargyID", Model.ID.ToString() } })
|
||||
)
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.OsztalyCsoport);
|
||||
columns.Bound(c => c.Tanar);
|
||||
columns.Bound(c => c.Oraszam).Width("10%");
|
||||
columns.Bound(c => c.Tema);
|
||||
})
|
||||
.Sortable(sortable => sortable
|
||||
.AllowUnsort(true)
|
||||
.SortMode(GridSortMode.MultipleColumn))
|
||||
)
|
||||
</div>
|
|
@ -0,0 +1,79 @@
|
|||
@using Kreta.Web.Helpers
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@using Kreta.Enums.ManualEnums
|
||||
@model TantargyModModel
|
||||
|
||||
<div class="container-fluid details">
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.TargyKategoria, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetTargyKategoriaList" }), "Text", "Value", new Dictionary<string, object>() { { "style", "width: 75%" } }).AutoBind(true).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.ESLTargyKategoria, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetESLTantargykategoriaList" })).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.IsFoTargy, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value", onChangeFunction: "TantargyHelper.hideOrShowComboBox()").AutoBind(true).RenderWithName()
|
||||
</div>
|
||||
<div id="FoTargyCombo" class="row" name="AltantargyAdat">
|
||||
@Html.KretaComboBoxFor(x => x.FoTargyID, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetFotargyakListWithoutSameTargyTobbesModify" }) + "?targyIdArrayString=" + Model.TantargyakIDArray, "Text", "Value", new Dictionary<string, object>() { { "style", "width: 75%" } }).AutoBind(true).RenderWithName()
|
||||
</div>
|
||||
<div class="row displayNone" name="AltantargyAdat">
|
||||
@Html.KretaComboBoxFor(x => x.AltantargyNyomtatvanyban, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" })).AutoBind(true).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.GyakorlatiTargy, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" })).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaNumericFor(x => x.Sorszam).Min(Kreta.Core.Constants.MinMaxValues.MinTantargySorszam).Max(Kreta.Core.Constants.MinMaxValues.MaxTantargySorszam).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.IsAmiTargyMod, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" })).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.IsMszgTargyMod, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" })).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.IsKollegiumiTargy, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" })).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.IsFelnottOktatasTargy, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" })).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.IsNincsBeloleOraMod, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" })).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.IsEgymiTargyMod, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" })).RenderWithName()
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
|
||||
TantargyHelper.hideOrShowComboBox();
|
||||
var $isAmiTargy = $("#IsAmiTargyMod");
|
||||
var $isAmiTargyComboBox = $isAmiTargy.data("kendoComboBox");
|
||||
$isAmiTargy.on("focusout", isAmiTargychanged);
|
||||
$isAmiTargy.on("change", isAmiTargychanged);
|
||||
|
||||
var $isMszgTargy = $("#IsMszgTargyMod");
|
||||
var $isMszgTargyComboBox = $isMszgTargy.data("kendoComboBox");
|
||||
$isMszgTargy.on("focusout", isMszgTargychanged);
|
||||
$isMszgTargy.on("change", isMszgTargychanged);
|
||||
|
||||
function isAmiTargychanged() {
|
||||
if (!CommonUtils.isNullOrUndefined($isAmiTargyComboBox)
|
||||
&& !CommonUtils.isNullOrUndefined($isMszgTargyComboBox)
|
||||
&& $isAmiTargyComboBox.value() == "@((int)IgenNemEnum.Igen)") {
|
||||
$isMszgTargyComboBox.value("@((int)IgenNemEnum.Nem)");
|
||||
}
|
||||
}
|
||||
|
||||
function isMszgTargychanged() {
|
||||
if (!CommonUtils.isNullOrUndefined($isAmiTargyComboBox)
|
||||
&& !CommonUtils.isNullOrUndefined($isMszgTargyComboBox)
|
||||
&& $isMszgTargyComboBox.value() == "@((int)IgenNemEnum.Igen)") {
|
||||
$isAmiTargyComboBox.value("@((int)IgenNemEnum.Nem)");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
208
KretaWeb/Areas/Tantargy/Views/Tantervek/Index.cshtml
Normal file
208
KretaWeb/Areas/Tantargy/Views/Tantervek/Index.cshtml
Normal file
|
@ -0,0 +1,208 @@
|
|||
@using Kreta.Framework;
|
||||
@using Kreta.Web.Helpers.Grid;
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@using Kreta.Resources
|
||||
@using Kreta.Enums.ManualEnums
|
||||
@using Kreta.Web.Security;
|
||||
@model TantervSearchModel
|
||||
|
||||
@{
|
||||
Layout = "~/Views/Shared/_MasterLayout.cshtml";
|
||||
}
|
||||
|
||||
@section AddSearchPanel {
|
||||
@using (Html.SearchPanelSideBar("searchForm", "TantervekGrid"))
|
||||
{
|
||||
@Html.KretaTextBoxFor(model => model.TantervNev).RenderSearchPanelSideBar();
|
||||
@Html.KretaComboBoxFor(x => x.JellemzoCsopTipID, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetCsoportTipusList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.KezdoEvfolyamID, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "TantervekApi", action = "GetEvfolyamListS" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.VegzoEvfolyamID, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "TantervekApi", action = "GetEvfolyamListS" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.IsKerettantervreEpul, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.IsKerettantervSrc, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
}
|
||||
}
|
||||
|
||||
<script type="text/javascript">
|
||||
var TantervGridHelper = (function () {
|
||||
var tantervGridHelper = function () { };
|
||||
|
||||
tantervGridHelper.setRowDeleting = function (rowData) {
|
||||
if (($("#TantervekGrid").data('kendoGrid').dataSource.data().length != 1 && '@Model.IsKovetkezoTanev' == 'False'))
|
||||
return true;
|
||||
}
|
||||
|
||||
return tantervGridHelper;
|
||||
})();
|
||||
</script>
|
||||
|
||||
@{
|
||||
var rowFunctions = new List<RowFunction> { };
|
||||
var functionCommands = new List<FunctionCommand> { };
|
||||
|
||||
rowFunctions.Add(new RowFunction { NameResourceId = 118 /*Adatok*/, ClientAction = "TantervHelper.openTantervProperties", IconEnum = GridRowFunctionIconEnum.Adatok });
|
||||
if (!ClaimData.IsSelectedTanevIsElozo)
|
||||
{
|
||||
functionCommands.Add(new FunctionCommand { NameResourceId = 115 /*Új*/, ClientAction = "TantervHelper.openTantervModifyAdd" });
|
||||
functionCommands.Add(new FunctionCommand { NameResourceId = 116 /*Módosítás*/, ClientAction = "TantervHelper.openSelectModWindow" });
|
||||
|
||||
rowFunctions.Add(new RowFunction { NameResourceId = 116 /*Módosítás*/, ClientAction = "TantervHelper.openTantervModifyAdd", IconEnum = GridRowFunctionIconEnum.Modositas });
|
||||
}
|
||||
|
||||
var grid = Html.KretaGrid<TantervekGridModel>
|
||||
(
|
||||
name: "TantervekGrid",
|
||||
getUrl: new GridApiUrl("TantervekApi", "GetTantervekGrid", new Dictionary<string, string> { }),
|
||||
allowScrolling: true,
|
||||
dataParameterFunction: "searchForm"
|
||||
)
|
||||
.SelectBoxColumn(Html, 0) /* */
|
||||
.LinkButtonColumn("", c => c.Nev, "TantervHelper.openTantervModifyAdd", GridButtonsEnum.Reszletek)
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.CsoportTipusa_DNAME);
|
||||
columns.Bound(c => c.Evfolyamtol_DNAME).Width("10%");
|
||||
columns.Bound(c => c.Evfolyamig_DNAME).Width("10%");
|
||||
columns.Bound(c => c.IsKerettanterv_BNAME).Width("10%");
|
||||
columns.Bound(c => c.Megjegyzes);
|
||||
})
|
||||
.RowFunction(Html, rowFunctions);
|
||||
|
||||
if (!ClaimData.IsSelectedTanevIsElozo)
|
||||
{
|
||||
grid.ConditionalRowFunction(Html, new List<RowFunction>
|
||||
{
|
||||
new RowFunction { NameResourceId = 117 /*Törlés*/, ClientAction = "TantervHelper.deleteTantervConfirmWindow", IconEnum = GridRowFunctionIconEnum.Torles }
|
||||
}, "TantervGridHelper.setRowDeleting");
|
||||
}
|
||||
|
||||
grid.FunctionCommand(Html, functionCommands)
|
||||
.Sortable(sortable => sortable
|
||||
.AllowUnsort(true)
|
||||
.SortMode(GridSortMode.MultipleColumn));
|
||||
}
|
||||
|
||||
<div>
|
||||
@(grid)
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var TantervHelper = (function () {
|
||||
var tantervHelper = function () { };
|
||||
|
||||
var formName = "TantervForm";
|
||||
var gridName = "TantervekGrid";
|
||||
var searchFormName = "searchForm";
|
||||
var modFormName = "tantervModForm";
|
||||
|
||||
var url = {
|
||||
OpenTantervProperties: "@Url.Action("OpenTantervProperties", "Tantervek" , new { area = "Tantargy" })",
|
||||
OpenTantervModifyAddPopup: "@Url.Action("OpenTantervModifyAdd", "Tantervek", new { area = "Tantargy" })",
|
||||
OpenModPopUp: "@Url.Action("OpenModPopUp", "Tantervek", new { area = "Tantargy" })",
|
||||
SaveModifiedOrNewTanterv: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "TantervekApi", action = "SaveModifiedOrNewTanterv" })",
|
||||
DeleteTanterv: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "TantervekApi", action = "DeleteTanterv" })",
|
||||
SaveModTanterv: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "TantervekApi", action = "SaveModTanterv" })"
|
||||
}
|
||||
|
||||
tantervHelper.openTantervProperties = function (rowData) {
|
||||
AjaxHelper.DoGet(url.OpenTantervProperties, { tantervID: rowData.ID }, popupTantervProperties);
|
||||
}
|
||||
|
||||
tantervHelper.propertiesCancel = function (rowData) {
|
||||
KretaWindowHelper.destroyWindow("TantervPropertiesWindow");
|
||||
}
|
||||
|
||||
tantervHelper.openTantervModifyAdd = function (rowData) {
|
||||
if (CommonUtils.isNullOrUndefined(rowData.ID)) {
|
||||
AjaxHelper.DoGet(url.OpenTantervModifyAddPopup, { tantervID: rowData.ID }, popupTantervAdd);
|
||||
}
|
||||
else {
|
||||
AjaxHelper.DoGet(url.OpenTantervModifyAddPopup, { tantervID: rowData.ID }, popupTantervModify);
|
||||
}
|
||||
}
|
||||
|
||||
tantervHelper.openSelectModWindow = function (data) {
|
||||
var selectedRows = KretaGridHelper.getSelectedRowsByGridName("TantervekGrid");
|
||||
if (selectedRows.length == 0) {
|
||||
KretaWindowHelper.warningWindow("@StringResourcesUtil.GetString(368)", "@(StringResourcesUtil.GetString(4554))"/*A csoportos módosításhoz legalább egy elem kiválasztása szükséges!*/);
|
||||
}
|
||||
else if (selectedRows.length == 1) {
|
||||
AjaxHelper.DoGet(url.OpenTantervModifyAddPopup, { tantervID: selectedRows[0].ID }, popupTantervModify);
|
||||
}
|
||||
else {
|
||||
var parameters = [];
|
||||
$.each(selectedRows, function (index, value) {
|
||||
parameters.push({ ID: value.ID, Nev: value.Nev });
|
||||
});
|
||||
|
||||
AjaxHelper.DoPost(url.OpenModPopUp, parameters, popupTantervModify);
|
||||
}
|
||||
}
|
||||
|
||||
tantervHelper.modifySave = function () {
|
||||
KretaGridHelper.resetHeaderCheckbox(gridName);
|
||||
AjaxHelper.DoPostElement(url.SaveModTanterv, modFormName, modifyAddSaveFeedBackOk);
|
||||
}
|
||||
|
||||
tantervHelper.modifyAddSave = function () {
|
||||
AjaxHelper.DoPostElement(url.SaveModifiedOrNewTanterv, formName, modifyAddSaveFeedBackOk);
|
||||
}
|
||||
|
||||
tantervHelper.modifyAddCancel = function (rowData) {
|
||||
KretaWindowHelper.destroyWindow("TantervModifyAddWindow");
|
||||
}
|
||||
|
||||
tantervHelper.confirmCsopModWindow = function () {
|
||||
KretaWindowHelper.confirmWindow("@(CommonResource.Kerdes)", "@(StringResourcesUtil.GetString(4756))" /*Biztosan módosítani szeretné a kijelölt elemeket?*/, tantervHelper.modifySave);
|
||||
}
|
||||
|
||||
tantervHelper.deleteTantervConfirmWindow = function (rowData) {
|
||||
KretaWindowHelper.confirmWindow("@(CommonResource.Kerdes)", "@(CommonResource.BiztosanTorli)", deleteTanterv, rowData.ID);
|
||||
}
|
||||
|
||||
function popupTantervProperties(data) {
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@(StringResourcesUtil.GetString(1625))"; /*Tanterv adatai*/
|
||||
config.content = data;
|
||||
var modal = KretaWindowHelper.createWindow("TantervPropertiesWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
}
|
||||
|
||||
function popupTantervModify(data) {
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@(StringResourcesUtil.GetString(1627))"; /*Tanterv módosítása*/
|
||||
config.content = data;
|
||||
var modal = KretaWindowHelper.createWindow("TantervModifyAddWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
}
|
||||
|
||||
function popupTantervAdd(data) {
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "@(StringResourcesUtil.GetString(3807))"; /*Új tanterv*/
|
||||
config.content = data;
|
||||
var modal = KretaWindowHelper.createWindow("TantervModifyAddWindow", config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
}
|
||||
|
||||
function modifyAddSaveFeedBackOk() {
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function deleteTanterv(data) {
|
||||
AjaxHelper.DoPost(url.DeleteTanterv, data, deleteTantervResponseOk, deleteFeedbackFail);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function deleteTantervResponseOk() {
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow);
|
||||
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
||||
}
|
||||
|
||||
function deleteFeedbackFail(data) {
|
||||
var message = data.responseJSON.Message;
|
||||
KretaWindowHelper.feedbackWindow(Globalization.Hiba /*HIBA*/, message, true, KretaWindowHelper.destroyAllWindow);
|
||||
}
|
||||
|
||||
return tantervHelper;
|
||||
})();
|
||||
</script>
|
|
@ -0,0 +1,32 @@
|
|||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@model TantervModel
|
||||
|
||||
<div class="container-fluid details">
|
||||
@using (Html.KretaForm("TantervForm"))
|
||||
{
|
||||
@Html.KretaValidationSummary()
|
||||
|
||||
@Html.HiddenFor(x => x.ID)
|
||||
<div class="row">
|
||||
@Html.KretaTextBoxFor(x => x.Nev).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.CsoportTipusa, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetCsoportTipusList" }), "Text", "Value").AutoBind(true).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.Evfolyamtol, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetEvfolyamList" }), "Text", "Value").AutoBind(true).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.Evfolyamig, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetEvfolyamList" }), "Text", "Value").AutoBind(true).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaCheckBoxFor(x => x.KerettantervreEpulo).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaCheckBoxFor(x => x.IsKerettanterv).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaTextBoxFor(x => x.Megjegyzes).RenderWithName()
|
||||
</div>
|
||||
}
|
||||
</div>
|
|
@ -0,0 +1,40 @@
|
|||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@model TantervModModel
|
||||
|
||||
@using (Html.KretaForm("tantervModForm"))
|
||||
{
|
||||
@Html.KretaValidationSummary()
|
||||
|
||||
@Html.HiddenFor(x => x.ID)
|
||||
@Html.HiddenFor(x => x.TantervIDArray)
|
||||
|
||||
<div class="container-fluid details">
|
||||
@if (string.IsNullOrWhiteSpace(Model.TantervIDArray))
|
||||
{
|
||||
<div class="row">
|
||||
@Html.KretaTextBoxFor(x => x.Nev).Enable(false).RenderWithName(6, 6)
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.TantervNevArray, 6, 6)
|
||||
</div>
|
||||
}
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.CsoportTipusa, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetCsoportTipusList" }), "Text", "Value").AutoBind(true).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.Evfolyamtol, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetEvfolyamList" }), "Text", "Value").AutoBind(true).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.Evfolyamig, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetEvfolyamList" }), "Text", "Value").AutoBind(true).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.KerettantervreEpulo, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" })).RenderWithName()
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.IsKerettanterv, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetIgenNemEnumList" })).RenderWithName()
|
||||
</div>
|
||||
</div>
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
@using Kreta.Web.Helpers;
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@model TantervModel
|
||||
|
||||
@Html.KretaTabStripAjax("tabstrip",Model.TabList)
|
|
@ -0,0 +1,26 @@
|
|||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@model TantervModel
|
||||
|
||||
<div class="container-fluid details">
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.Nev)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.CsoportTipusaNev)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.EvfolyamtolNev)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.EvfolyamigNev)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.KerettantervreEpulo_BNAME)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.IsKerettanterv_BNAME)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaLabelFor(x => x.Megjegyzes)
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,24 @@
|
|||
@using Kreta.Framework
|
||||
@using Kreta.Web.Helpers.Grid
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@using Kreta.Web.Classes
|
||||
@model TantervModel
|
||||
|
||||
<div>
|
||||
@(
|
||||
Html.KretaGrid<TantervekOsztalyokGridModel>
|
||||
(
|
||||
name: "TantervOsztalyokGrid",
|
||||
getUrl: new GridApiUrl("TantervekApi", "GetTantervOSztalyai", new Dictionary<string, string> { { "tantervID", Model.ID.ToString() } })
|
||||
)
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.Nev);
|
||||
columns.Bound(c => c.Evfolyam_DNAME).Width("10%");
|
||||
columns.Bound(c => c.Letszam).Width("10%");
|
||||
})
|
||||
.Sortable(sortable => sortable
|
||||
.AllowUnsort(true)
|
||||
.SortMode(GridSortMode.MultipleColumn))
|
||||
)
|
||||
</div>
|
|
@ -0,0 +1,23 @@
|
|||
@using Kreta.Framework
|
||||
@using Kreta.Web.Helpers.Grid
|
||||
@using Kreta.Web.Areas.Tantargy.Models
|
||||
@using Kreta.Web.Classes
|
||||
@model TantervModel
|
||||
|
||||
<div>
|
||||
@(
|
||||
Html.KretaGrid<TantervekTanulokGridModel>
|
||||
(
|
||||
name: "TantervTanulokGrid",
|
||||
getUrl: new GridApiUrl("TantervekApi", "GetTantervTanuloi", new Dictionary<string, string> { { "tantervID", Model.ID.ToString() } })
|
||||
)
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.Nev);
|
||||
columns.Bound(c => c.OsztalyNev);
|
||||
})
|
||||
.Sortable(sortable => sortable
|
||||
.AllowUnsort(true)
|
||||
.SortMode(GridSortMode.MultipleColumn))
|
||||
)
|
||||
</div>
|
3
KretaWeb/Areas/Tantargy/Views/_ViewStart.cshtml
Normal file
3
KretaWeb/Areas/Tantargy/Views/_ViewStart.cshtml
Normal file
|
@ -0,0 +1,3 @@
|
|||
@{
|
||||
Layout = "~/Views/Shared/_MasterLayout.cshtml";
|
||||
}
|
38
KretaWeb/Areas/Tantargy/Views/web.config
Normal file
38
KretaWeb/Areas/Tantargy/Views/web.config
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<pages pageBaseType="System.Web.Mvc.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc" />
|
||||
<add namespace="System.Web.Mvc.Ajax" />
|
||||
<add namespace="System.Web.Mvc.Html" />
|
||||
<add namespace="System.Web.Routing" />
|
||||
<add namespace="Kreta.Web" />
|
||||
<add namespace="Kreta.BusinessLogic.Utils" />
|
||||
<add namespace="Kendo.Mvc.UI" />
|
||||
<add namespace="Kreta.Web.Helpers" />
|
||||
<add namespace="System.Web.Optimization" />
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web.webPages.razor>
|
||||
|
||||
<appSettings>
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
</appSettings>
|
||||
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<remove name="BlockViewHandler"/>
|
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
Loading…
Add table
Add a link
Reference in a new issue