init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
154
KretaWeb/Areas/Adatszolgaltatasok/Views/Merohely/Index.cshtml
Normal file
154
KretaWeb/Areas/Adatszolgaltatasok/Views/Merohely/Index.cshtml
Normal file
|
@ -0,0 +1,154 @@
|
|||
@using Kreta.Web.Helpers
|
||||
@using Kreta.Web.Helpers.Grid
|
||||
@using Kreta.Web.Areas.Adatszolgaltatasok.Models
|
||||
@using Kreta.Enums.ManualEnums
|
||||
@using Kreta.Resources
|
||||
@model MerohelySearchModel
|
||||
|
||||
@{
|
||||
Layout = "~/Views/Shared/_MasterLayout.cshtml";
|
||||
}
|
||||
|
||||
@section AddSearchPanel {
|
||||
@using (Html.SearchPanelSideBar("merohelySearchForm", "MerohelyGrid"))
|
||||
{
|
||||
@Html.KretaTextBoxFor(model => model.MerohelyNevSearch).RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.MerohelyTipusIdSearch, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "MerohelyApi", action = "GetMerohelyTipusList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
@Html.KretaComboBoxFor(x => x.MerohelyMukodesiHelyIdSearch, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetMukodesiHelyList" }), "Text", "Value").RenderSearchPanelSideBar()
|
||||
}
|
||||
}
|
||||
|
||||
<div>
|
||||
@(
|
||||
Html.KretaGrid<MerohelyGridModel>
|
||||
(
|
||||
name: "MerohelyGrid",
|
||||
getUrl: new GridApiUrl("MerohelyApi", "GetMerohelyGrid", new Dictionary<string, string> { }),
|
||||
dataParameterFunction: "merohelySearchForm",
|
||||
sort: sort => sort.Add(m => m.Nev).Ascending(),
|
||||
|
||||
clientTemplateUrl: Url.Action("GetMerohelyDetailGrid", "Merohely", new { area = "Adatszolgaltatasok" }),
|
||||
clientTemplate: "detailGrid-template",
|
||||
clientTemplateWholeDataRow: true,
|
||||
allowSorting: false,
|
||||
allowScrolling: false
|
||||
)
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.MerooraAzonosito);
|
||||
columns.Bound(c => c.Nev);
|
||||
columns.Bound(c => c.MerohelyId).Hidden();
|
||||
columns.Bound(c => c.MerohelyTipus_DNAME);
|
||||
columns.Bound(c => c.MukodesihelyNev);
|
||||
})
|
||||
)
|
||||
</div>
|
||||
|
||||
@Html.KretaGridTemplate("detailGrid-template")
|
||||
|
||||
<script type="text/javascript">
|
||||
var MerohelyHelper = (function () {
|
||||
var merohelyHelper = function () { };
|
||||
|
||||
var formData = null;
|
||||
var gridName = "MerohelyGrid";
|
||||
|
||||
var newModifyMeroallasPopupName = "meroallasWindow";
|
||||
var meroallasImagePopupName = "meroallasImageWindow";
|
||||
var newModifyMeroallasFormName = "meroallasNewModifyForm";
|
||||
|
||||
var url = {
|
||||
OpenMeroallasPopup: "@Url.Action("OpenMeroallasPopup", "Merohely", new {area = "Adatszolgaltatasok" })",
|
||||
SaveMeroallas: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new {controller = "MerohelyApi", action = "SaveMeroallas"})",
|
||||
DeleteMeroallas: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new {controller = "MerohelyApi", action = "DeleteMeroallas" })",
|
||||
OpenMeroallasImagePopup: "@Url.Action("OpenMeroallasImagePopup", "Merohely", new {area = "Adatszolgaltatasok" })",
|
||||
};
|
||||
|
||||
//Mérőállás
|
||||
merohelyHelper.OpenMeroallasUjPopup = function (data)
|
||||
{
|
||||
var postData = {
|
||||
"id": null,
|
||||
"merohelyId": data
|
||||
};
|
||||
AjaxHelper.DoPost(url.OpenMeroallasPopup, postData, popMeroallaslWindow);
|
||||
};
|
||||
|
||||
merohelyHelper.OpenMeroallasModositasPopup = function (data) {
|
||||
var postData = {
|
||||
"id": data.MeroallasId,
|
||||
"merohelyId": data.MerohelyId
|
||||
};
|
||||
AjaxHelper.DoPost(url.OpenMeroallasPopup, postData, popMeroallaslWindow);
|
||||
};
|
||||
|
||||
merohelyHelper.OpenMeroallasImagePopup = function (data) {
|
||||
var postData = {
|
||||
"id": data.MeroallasId
|
||||
};
|
||||
AjaxHelper.DoPost(url.OpenMeroallasImagePopup, postData, popMeroallaslImage_Window);
|
||||
};
|
||||
|
||||
function popMeroallaslWindow(data) {
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "Mérőállás";
|
||||
config.maxWidth = "960px";
|
||||
config.maxHeight = "600px";
|
||||
config.height = "600px";
|
||||
config.minHeight = "400px";
|
||||
config.content = data;
|
||||
|
||||
var modal = KretaWindowHelper.createWindow(newModifyMeroallasPopupName, config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
};
|
||||
|
||||
function popMeroallaslImage_Window(data) {
|
||||
var config = KretaWindowHelper.getWindowConfigContainer();
|
||||
config.title = "Mérőállás kép";
|
||||
config.maxWidth = "960px";
|
||||
config.maxHeight = "600px";
|
||||
config.content = data;
|
||||
|
||||
var modal = KretaWindowHelper.createWindow(meroallasImagePopupName, config);
|
||||
KretaWindowHelper.openWindow(modal, true);
|
||||
};
|
||||
|
||||
merohelyHelper.DeleteMeroallasConfirmWindow = function (rowData) {
|
||||
KretaWindowHelper.confirmWindow("Kérdés" /*Kérdés*/, "Biztosan törli?" /*Biztosan törli?*/, deleteMeroallas, rowData.MeroallasId);
|
||||
}
|
||||
|
||||
function deleteMeroallas(data) {
|
||||
AjaxHelper.DoPost(url.DeleteMeroallas, data, deleteMeroallasResponseOk);
|
||||
}
|
||||
|
||||
function deleteMeroallasResponseOk() {
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow);
|
||||
KretaGridHelper.refreshGrid(gridName);
|
||||
}
|
||||
|
||||
merohelyHelper.MeroallasPopupSave = function () {
|
||||
KretaFileUpload.SendAttachmentsAsBase64EncodedString("FotoInputContainer", SaveMeroallas);
|
||||
}
|
||||
|
||||
function SaveMeroallas(lista) {
|
||||
var formData = $("#" + newModifyMeroallasFormName).toObject();
|
||||
formData.MeroallasKep = lista[0];
|
||||
AjaxHelper.DoValidationPost(url.SaveMeroallas, newModifyMeroallasFormName, formData, saveMeroallasResponseOk);
|
||||
}
|
||||
|
||||
function saveMeroallasResponseOk() {
|
||||
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow);
|
||||
KretaGridHelper.refreshGrid(gridName);
|
||||
}
|
||||
|
||||
merohelyHelper.MeroallasPopupCancel = function () {
|
||||
KretaWindowHelper.destroyWindow(newModifyMeroallasPopupName);
|
||||
}
|
||||
|
||||
merohelyHelper.MeroallasImage_PopupCancel = function () {
|
||||
KretaWindowHelper.destroyWindow(meroallasImagePopupName);
|
||||
}
|
||||
|
||||
return merohelyHelper;
|
||||
})();
|
||||
</script>
|
|
@ -0,0 +1,17 @@
|
|||
@using Kreta.Web.Areas.Adatszolgaltatasok.Models
|
||||
@using Kreta.Web.Helpers
|
||||
@using Kreta.Resources
|
||||
@using Kreta.Web.Areas.Intezmeny.Models
|
||||
@using Kreta.Web.Helpers.Grid;
|
||||
@model MeroallasImageModel
|
||||
|
||||
@{
|
||||
var formName = "meroallasImageForm";
|
||||
}
|
||||
|
||||
@using (Html.KretaForm(formName))
|
||||
{
|
||||
<div class="text-center" style="margin-top:30px;">
|
||||
@Html.Base64EncodedImage(Model.ContentAsBase64EncodedString)
|
||||
</div>
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
@using Kreta.Web.Helpers.Grid;
|
||||
@using Kreta.Web.Areas.Adatszolgaltatasok.Models
|
||||
@using Kreta.Web.Helpers
|
||||
@using Kreta.BusinessLogic.Classes
|
||||
@using Kreta.Enums.ManualEnums
|
||||
@using Kreta.Resources
|
||||
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
@model MerohelyGridModel
|
||||
|
||||
<div id="partialDetailGridTanulo_@Model.MerohelyId.ToString()" style="padding-top:10px">
|
||||
@{
|
||||
var rowFunctionList = new List<RowFunction>
|
||||
{
|
||||
new RowFunction { Name = KozmuAdatszolgaltatasResource.FeltoltottKepMegtekintese, ClientAction= "MerohelyHelper.OpenMeroallasImagePopup", IconEnum = GridRowFunctionIconEnum.Kep },
|
||||
};
|
||||
var defaultRowFunctionList = new List<RowFunction>
|
||||
{
|
||||
new RowFunction { Name = IntezmenyResource.Modositas, ClientAction= "MerohelyHelper.OpenMeroallasModositasPopup", IconEnum = GridRowFunctionIconEnum.Modositas },
|
||||
new RowFunction { Name = IntezmenyResource.Torles, ClientAction= "MerohelyHelper.DeleteMeroallasConfirmWindow", IconEnum = GridRowFunctionIconEnum.Torles }
|
||||
};
|
||||
|
||||
}
|
||||
@(
|
||||
Html.KretaGrid<MeroAllasGridModel>(
|
||||
"MeroallasDetailGrid_" + Model.MerohelyId,
|
||||
new GridApiUrl("MerohelyApi", "GetMeroallasDetailGrid", new Dictionary<string, string> { { "merohelyId", Model.MerohelyId.ToString() } }),
|
||||
useToolBar: false,
|
||||
allowPaging: false,
|
||||
allowScrolling: false,
|
||||
showSorszam: false
|
||||
)
|
||||
.Sortable(sortable => sortable
|
||||
.AllowUnsort(true))
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.MeroallasId).Hidden();
|
||||
columns.Bound(c => c.Ertek);
|
||||
columns.Bound(c => c.LeolvasasDatuma).Format(SDAFormat.Format[SDAFormat.FormatType.ShortDate]);
|
||||
columns.Bound(c => c.KeppelRendelkezik_BNAME);
|
||||
})
|
||||
.ConditionalRowFunction(Html, rowFunctionList, "DetailGridHelper.setRowEditing")
|
||||
.RowFunction(Html, defaultRowFunctionList)
|
||||
|
||||
.FunctionCommand(Html, new List<FunctionCommand>
|
||||
{
|
||||
new FunctionCommand { Name = IntezmenyResource.Uj, ClientAction = "function() { MerohelyHelper.OpenMeroallasUjPopup(" + Model.MerohelyId + "); }"}
|
||||
})
|
||||
)
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var DetailGridHelper = (function () {
|
||||
var detailGridHelper = function () { };
|
||||
detailGridHelper.setRowEditing = function (rowData) {
|
||||
return rowData.KeppelRendelkezik_BOOL;
|
||||
}
|
||||
return detailGridHelper;
|
||||
})();
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
td.rowFunction > a > i.fa-image {
|
||||
float: right;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.rowFunction {
|
||||
text-align: left !important;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,200 @@
|
|||
@using Kreta.Web.Areas.Adatszolgaltatasok.Models
|
||||
@using Kreta.Web.Helpers
|
||||
@using Kreta.Resources
|
||||
@using Kreta.Web.Areas.Intezmeny.Models
|
||||
@using Kreta.Web.Helpers.Grid;
|
||||
@model MeroallasModel
|
||||
|
||||
@{
|
||||
var newModifyMeroallasFormName = "meroallasNewModifyForm";
|
||||
}
|
||||
|
||||
@using (Html.KretaForm(newModifyMeroallasFormName))
|
||||
{
|
||||
@Html.KretaValidationSummary()
|
||||
<div class="container-fluid details">
|
||||
@Html.HiddenFor(x => x.Id)
|
||||
@Html.HiddenFor(x => x.MerohelyId)
|
||||
@Html.HiddenFor(x => x.PictureId)
|
||||
@Html.HiddenFor(x => x.IsDeleteImage)
|
||||
<div class="row">
|
||||
@Html.KretaNumericFor(x => x.Meroallas).Min(0.00).Max(Kreta.Core.Constants.MinMaxValues.MerohelyMaxValue).Step(0.01).RenderWithName(3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaDatePickerFor(x => x.LeolvasasDatuma).Min(new DateTime(1900, 1, 1)).Max(DateTime.Today).RenderWithName(3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-6 col-md-3 "><label class="windowInputLabel">@IntezmenyResource.Foto</label></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaFileUpload("FotoInputContainer", onSelectEvent: "function(e){ MeroallasFileUploadHelper.onSelectKep(e); }", allowMultiple: false, selectText: IntezmenyResource.KepTallozasa)
|
||||
</div>
|
||||
<div id="ListViewContainer">
|
||||
<div class="row">
|
||||
<div class="col-md-3" />
|
||||
<div class="col-md-6">
|
||||
@(Html.KretaListView<UploadedFile>(name: "meroallasKepList", tagName: "div", clientTemplateId: "PictureListViewTemplate", getUrl: new ApiUrlBuilder("MerohelyApi", "GetPicture", new Dictionary<string, object> { { "meroallasId", Model.Id.HasValue ? Model.Id : 0 }, { "pictureId", Model.PictureId.HasValue ? Model.PictureId : 0 } })).AutoBind(true))
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<script type="text/javascript">
|
||||
var MeroallasFileUploadHelper = (function () {
|
||||
var meroallasFileUploadHelper = function () { };
|
||||
|
||||
function readFileForPreview(file, listViewId)
|
||||
{
|
||||
listId = listViewId;
|
||||
var reader = new FileReader();
|
||||
|
||||
if (file) {
|
||||
reader.onloadend = function () {
|
||||
var dataSource = new kendo.data.DataSource(
|
||||
{
|
||||
data: [{ ContentAsBase64EncodedString: reader.result }]
|
||||
});
|
||||
var listView = $("#" + listViewId).data("kendoListView");
|
||||
|
||||
listView.setDataSource(dataSource);
|
||||
listView.refresh();
|
||||
};
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
}
|
||||
|
||||
//Edithez kell
|
||||
meroallasFileUploadHelper.getFileForPreview = function (listViewId) {
|
||||
var url = "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.MerohelyApi, action = "GetPicture" })";
|
||||
AjaxHelper.DoPostQuery(url,null,
|
||||
{ meroallasId: @(Model.Id.HasValue ? Model.Id : 0), pictureId: @(Model.PictureId.HasValue ? Model.PictureId : 0)},
|
||||
function (data)
|
||||
{
|
||||
var dataSource = new kendo.data.DataSource();
|
||||
if (data != "") {
|
||||
dataSource.data([data.Data[0]]);
|
||||
}
|
||||
|
||||
var listView = $("#" + listViewId).data("kendoListView");
|
||||
|
||||
listView.setDataSource(dataSource);
|
||||
listView.refresh();
|
||||
});
|
||||
}
|
||||
|
||||
meroallasFileUploadHelper.onSelectKep = function (e) {
|
||||
$('#ListViewContainer').show();
|
||||
KretaFileUpload.StopAnimation();
|
||||
var allowedFileExtensionArray = [".png", ".bmp", ".jpg", ".jpeg"];
|
||||
var attachmentMaxFileSizeInBytes = 1048576;
|
||||
var attachments = e.files;
|
||||
|
||||
for(var i = 0; i < attachments.length;i++){
|
||||
if (attachmentMaxFileSizeInBytes<attachments[i].size){
|
||||
e.preventDefault();
|
||||
var errorMessage = "@ErrorResource.HibaTortentXMBNalNemLehetNagyobbAFajlMerete";
|
||||
errorMessage=errorMessage.replace("{0}",attachmentMaxFileSizeInBytes/(1024*1024));
|
||||
KretaWindowHelper.feedbackWindow("@CommonResource.Hiba", errorMessage, true);
|
||||
$('#ListViewContainer').hide();
|
||||
break;
|
||||
}
|
||||
|
||||
if ($.inArray(attachments[i].extension.toLowerCase(), allowedFileExtensionArray)===-1){
|
||||
e.preventDefault();
|
||||
KretaWindowHelper.feedbackWindow("@CommonResource.Hiba", "@ErrorResource.AFajlKiterjeszteseVagyTipusaNemMegfelelo", true);
|
||||
$('#ListViewContainer').hide();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout(function () {
|
||||
readFileForPreview(e.files[0].rawFile, "meroallasKepList");
|
||||
});
|
||||
}
|
||||
|
||||
meroallasFileUploadHelper.DeleteImageButtonClick = function (imageDivId) {
|
||||
var imageDiv = $('#' + imageDivId);
|
||||
imageDiv.fadeTo(0, 0.55);
|
||||
var formData = $("#meroallasNewModifyForm").toObject();
|
||||
formData.MeroallasKep = [];
|
||||
document.getElementById("IsDeleteImage").value = true;
|
||||
$("#torlesSzoveg").css("visibility", "visible");
|
||||
$("#removeImage").css("visibility", "hidden");
|
||||
}
|
||||
|
||||
return meroallasFileUploadHelper;
|
||||
})();
|
||||
|
||||
$(document).ready(function () {
|
||||
if ("@(Model.PictureId.HasValue)" === "True") {
|
||||
$('#ListViewContainer').show();
|
||||
$('#meroallasWindow').height('600px');
|
||||
|
||||
}
|
||||
else {
|
||||
$('#ListViewContainer').hide();
|
||||
var parentDiv = $('#meroallasWindow').parent();
|
||||
parentDiv.height('300px');
|
||||
parentDiv.css('margin-top',"-120px");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/x-kendo-tmpl" id="PictureListViewTemplate">
|
||||
<div id="imageDiv_@Model.Id" style="margin-top:20px; border-color:white">
|
||||
<div class="UploadedFile meroallasUploadedFile">
|
||||
<span id="removeImage" onclick="MeroallasFileUploadHelper.DeleteImageButtonClick('imageDiv_'+@Model.Id)" class="k-icon k-i-close meroallas-remove-image">X</span>
|
||||
<img class="img-thumbnail" src="#:ContentAsBase64EncodedString#" />
|
||||
</div>
|
||||
</div>
|
||||
<div id="torlesSzoveg" class="meroallasTorlesSzoveg" style="visibility:hidden; color:red"><span>A kép törlése csak az adatok ’Mentés’-e után lesz végleges.</span></div>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.meroallas-remove-image {
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
right: -20px;
|
||||
border-radius: 10em;
|
||||
padding: 2px 4px 4px;
|
||||
text-decoration: none;
|
||||
font: 400 20px/20px sans-serif;
|
||||
background: #555;
|
||||
border: 2px solid #fff;
|
||||
color: #FFF;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 2px 4px rgba(0,0,0,0.3);
|
||||
text-shadow: 0 1px 2px rgba(0,0,0,0.5);
|
||||
-webkit-transition: background 0.5s;
|
||||
transition: background 0.5s;
|
||||
}
|
||||
|
||||
.meroallas-remove-image:hover {
|
||||
background: #E54E4E;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.meroallasUploadedFile {
|
||||
width: auto;
|
||||
height: auto;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.meroallasTorlesSzoveg {
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
#meroallasKepList {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.k-upload .k-upload-action {
|
||||
display: none;
|
||||
}
|
||||
|
||||
</style>
|
|
@ -0,0 +1,25 @@
|
|||
@using Kreta.Web.Areas.Adatszolgaltatasok.Models
|
||||
@using Kreta.Web.Helpers
|
||||
@using Kreta.Resources
|
||||
@model MerohelyModel
|
||||
|
||||
@{
|
||||
var formName = "merohelyNewModifyForm";
|
||||
}
|
||||
|
||||
@using (Html.KretaForm(formName))
|
||||
{
|
||||
<div class="container-fluid details">
|
||||
@Html.HiddenFor(x => x.Id)
|
||||
<div class="row">
|
||||
@Html.KretaTextBoxFor(x => x.Nev).RenderWithName(3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.MerohelyTipusId, Model.MerohelyTipusList).RenderWithName(3, 3)
|
||||
</div>
|
||||
<div class="row">
|
||||
@Html.KretaComboBoxFor(x => x.MukodesiHelyId, Model.MukodesiHelyList).RenderWithName(3, 3)
|
||||
</div>
|
||||
</div>
|
||||
@Html.KretaValidationSummary()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue