init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,100 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.BusinessLogic.Utils;
|
||||
using Kreta.Core;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class KozmuszamlaController : Controller
|
||||
{
|
||||
// GET: Adatszolgaltatasok/KozmuSzamlak
|
||||
public ActionResult Index()
|
||||
{
|
||||
KozmuszamlaSearchModel model = new KozmuszamlaSearchModel();
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
public ActionResult OpenKozmuszamlaPopup(int? id)
|
||||
{
|
||||
bool isModify = id.IsEntityId();
|
||||
KozmuszamlaModel kozmuszamlaModel;
|
||||
if (isModify)
|
||||
{
|
||||
KozmuszamlaCO co = new KozmuszamlaHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType()).GetKozmuszamlaById(id.Value);
|
||||
kozmuszamlaModel = new KozmuszamlaModel
|
||||
{
|
||||
Id = co.Id.Value,
|
||||
BefizetesDatuma = co.BefizetesDatuma,
|
||||
FizetesiHatarido = co.FizetesiHatarido,
|
||||
Fizetve = co.Fizetve ? 1 : 0,
|
||||
InvaliditasOka = co.InvaliditasOka,
|
||||
Kelte = co.Kelte,
|
||||
Kibocsato = co.Kibocsato,
|
||||
KozmuszamlaTipusId = co.KozmuszamlaTipusId.Value,
|
||||
Osszeg = co.Osszeg.Value,
|
||||
PenznemId = co.PenznemId.Value,
|
||||
KozmuszamlaTipusList = GetKozmuszamlaTipusList(),
|
||||
PenznemTipusList = GetPenznemTipusList(),
|
||||
MerohelyId = co.MerohelyId,
|
||||
MerohelyList = GetMerohelyList()
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
kozmuszamlaModel = new KozmuszamlaModel
|
||||
{
|
||||
BefizetesDatuma = DateTime.UtcNow,
|
||||
FizetesiHatarido = DateTime.UtcNow,
|
||||
InvaliditasOka = "",
|
||||
Kelte = DateTime.UtcNow,
|
||||
Kibocsato = "",
|
||||
KozmuszamlaTipusId = (int)KozmuSzamlaTipusEnum.Egyeb,
|
||||
PenznemId = (int)PenznemTipusEnum.Forint,
|
||||
Fizetve = 0,
|
||||
Osszeg = 0,
|
||||
KozmuszamlaTipusList = GetKozmuszamlaTipusList(),
|
||||
PenznemTipusList = GetPenznemTipusList(),
|
||||
MerohelyId = null,
|
||||
MerohelyList = GetMerohelyList()
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
var popupModel = new PopUpModel(kozmuszamlaModel, "New_Modify_Popup");
|
||||
popupModel.AddCancelBtn(popupModel, "KozmuszamlaHelper.KozmuszamlaPopupCancel");
|
||||
popupModel.AddOkBtn(popupModel, "KozmuszamlaHelper.KozmuszamlaPopupSave");
|
||||
|
||||
return PartialView(Constants.General.PopupView, popupModel);
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetMerohelyList()
|
||||
{
|
||||
var ds = new MerohelyHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetNemToroltMerohelyek();
|
||||
var merohelyDictionary = ds.Tables[0].AsEnumerable()
|
||||
.ToDictionary(row => row.Field<int>(0).ToString(), row => row.Field<string>(1));
|
||||
|
||||
return merohelyDictionary.ToSelectItemList();
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetPenznemTipusList()
|
||||
=> ((int)GeneratedAdatszotarTipusEnum.PenznemTipus).GetItemsByType(ClaimData.SelectedTanevID.Value, true).ToSelectItemList();
|
||||
|
||||
private List<SelectListItem> GetKozmuszamlaTipusList()
|
||||
=> ((int)GeneratedAdatszotarTipusEnum.KozmuSzamlaTipus).GetItemsByType(ClaimData.SelectedTanevID.Value, true).ToSelectItemList();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue