Mehrfache IK Leistungserbringer - Anfang

This commit is contained in:
2024-11-06 12:55:11 +01:00
parent be3d86a7d7
commit 265f2fa829
3 changed files with 27 additions and 0 deletions

View File

@@ -266,5 +266,10 @@ namespace BeWo.Data.Access
return obj;
}
public virtual int GetRowCount<T>() where T : BeWoEntityBase
{
return Session.QueryOver<T>()
.RowCount();
}
}
}

View File

@@ -1,6 +1,8 @@
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BS.Shared.DataContracts;
using System;
namespace BeWo.Service.DCEntityMapper
{
@@ -30,6 +32,7 @@ namespace BeWo.Service.DCEntityMapper
#endif
pDataContract.Apikey = pEntity.Apikey;
pDataContract.IKLeistungserbringer = pEntity.IKLeistungserbringer;
//pDataContract.CanEditIKLeistungserbringer = GetCanEditIKLeistungserbringer();
return pDataContract;
}
@@ -65,5 +68,21 @@ namespace BeWo.Service.DCEntityMapper
return pDC.MandatorOid == pEntity.Oid;
}
private bool GetCanEditIKLeistungserbringer()
{
try
{
var row_count = DAOFactory.GenericDAO.GetRowCount<GkvTransferProtokoll>();
return row_count == 0;
}
catch (Exception)
{
}
return true;
}
}
}

View File

@@ -58,5 +58,8 @@ namespace BS.Shared.DataContracts
[DataMember]
public string IKLeistungserbringer { get; set; }
[DataMember]
public bool CanEditIKLeistungserbringer { get; set; }
}
}