MH: OperationsServiceImp aufgeräumt + Aktenzeichenfeld für Behindertenausweis hinzugefügt
This commit is contained in:
@@ -31,16 +31,23 @@ namespace BeWo.View.Controls
|
||||
double res = 0.0;
|
||||
|
||||
if (dc.Count != 0)
|
||||
{
|
||||
foreach (var x in dc)
|
||||
{
|
||||
res += x.DurationHours;
|
||||
}
|
||||
c.Text = res.ToString("0.##");
|
||||
}
|
||||
|
||||
c.Text = res.ToString("0.##");
|
||||
else
|
||||
{
|
||||
c.BorderBlack.BorderThickness = new Thickness(0, 0, 1, 2);
|
||||
c.Text = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
c.BorderBlack.BorderThickness = new Thickness(0, 0, 1, 2);
|
||||
c.BorderBlack.BorderThickness = new Thickness(0, 0, 1, 1);
|
||||
|
||||
c.Text = "";
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox x:Name="GroupBoxNeueLeistung" Header="Neue Leistung hinzufügen" Padding="0,0,0,0"
|
||||
<GroupBox x:Name="GroupBoxNeueLeistung" Header="Neue Leistung hinzufügen123" Padding="0,0,0,0"
|
||||
Style="{DynamicResource ObjectEditGroupBox}" Margin="0,0,0,-3" Grid.Column="1">
|
||||
<Grid x:Name="GridNeueLeistung">
|
||||
<Grid.ColumnDefinitions>
|
||||
|
||||
@@ -871,7 +871,8 @@
|
||||
ItemsSource="{x:Static core:EnumTranslations.PflegegradTranslations}"
|
||||
SelectedValue="{Binding Path=Pflegegrad}" DisplayMemberPath="Value"
|
||||
SelectedValuePath="Key" />
|
||||
|
||||
<Label Grid.Column="4" Grid.Row="1" Content="Aktenzeichen" VerticalAlignment="Center" />
|
||||
<TextBox Grid.Column="5" Grid.Row="1" Margin="3" Height="23" Width="150" Text="{Binding Path=AusweisAktenzeichen, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
|
||||
@@ -535,17 +535,18 @@ namespace BeWo.View.Detail.Report
|
||||
return;
|
||||
|
||||
case "WE":
|
||||
|
||||
pos = int.Parse(e.Column.FieldName.Remove(e.Column.FieldName.Length - 1));
|
||||
e.Value = selZeile.Zeile == 2 ? _DienstEintragListe.FindAll(x => x.Employee == selZeile.Employee).SelectMany(y => y.GetDienstWoche(pos)).ToList() : null;
|
||||
|
||||
if (selZeile.Zeile == 0 && selZeile.StatusListe != null)
|
||||
{
|
||||
e.Value = new List<DienstInfoDC>();
|
||||
var week = new DPCtrlWeek();
|
||||
week.DienstInfoDCList = e.Value as List<DienstInfoDC>;
|
||||
} // Nutzlos..
|
||||
}
|
||||
|
||||
pos = int.Parse(e.Column.FieldName.Remove(e.Column.FieldName.Length - 1));
|
||||
e.Value = selZeile.Zeile == 2 ? _DienstEintragListe.FindAll(x => x.Employee == selZeile.Employee).SelectMany(y => y.GetDienstWoche(pos)).ToList() : null;
|
||||
|
||||
if(e.Value != null)
|
||||
if (e.Value != null)
|
||||
{
|
||||
// Nur für eigenes Verständnis beim Debuggen
|
||||
}
|
||||
|
||||
@@ -852,9 +852,10 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="1" Content="Betrag" Grid.Column="0" x:Name="lblBetrag" HorizontalAlignment="Right" />
|
||||
|
||||
<dxe:TextEdit x:Name="numerictb_betrag" Grid.Column="1" Grid.Row="1" Height="23" Margin="3,0,3,3" Width="52" HorizontalAlignment="Stretch" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding Path=PrototypeVM.Betrag, UpdateSourceTrigger=PropertyChanged}" Mask="########0.00"/>
|
||||
<Label Grid.Row="0" Content="Betrag" Grid.Column="0" x:Name="lblBetrag" HorizontalAlignment="Right" />
|
||||
<dxe:TextEdit x:Name="numerictb_betrag" Grid.Column="1" Grid.Row="0" Height="23" Margin="3,0,3,3" Width="52" HorizontalAlignment="Stretch" MaskType="Numeric" MaskUseAsDisplayFormat="True" EditValue="{Binding Path=PrototypeVM.Betrag, UpdateSourceTrigger=PropertyChanged}" Mask="########0.00"/>
|
||||
<Label Grid.Row="1" Grid.Column="0" Content="Eintrag markieren" HorizontalAlignment="Right"/>
|
||||
|
||||
|
||||
</Grid>
|
||||
<Grid Margin="0,5,0,0" Grid.Column="0" Grid.Row="11" Grid.ColumnSpan="2">
|
||||
|
||||
@@ -94,6 +94,7 @@ namespace BeWo.ViewModel
|
||||
public static string PropertyName_AusweisGueltigVon = "AusweisGueltigVon";
|
||||
public static string PropertyName_AusweisGueltigBis = "AusweisGueltigBis";
|
||||
public static string PropertyName_AusweisUnbefristetGueltig = "AusweisUnbefristetGueltig";
|
||||
public static string PropertyName_AusweisAktenzeichen = "AusweisAktenzeichen";
|
||||
public static string PropertyName_BeiblattGueltigBis = "BeiblattGueltigBis";
|
||||
public static string PropertyName_GradDerBehinderung = "GradDerBehinderung";
|
||||
public static string PropertyName_MerkzeichenListe = "MerkzeichenListe";
|
||||
@@ -187,7 +188,8 @@ namespace BeWo.ViewModel
|
||||
private DateTime? _AusweisGueltigVon;
|
||||
private DateTime? _AusweisGueltigBis;
|
||||
private bool _AusweisUnbefristetGueltig;
|
||||
private DateTime? _BeiblattGueltigBis;
|
||||
private string _AusweisAktenzeichen;
|
||||
private DateTime? _BeiblattGueltigBis;
|
||||
private string _GradDerBehinderung;
|
||||
private ObservableCollection<Merkzeichen> _MerkzeichenListe;
|
||||
private ObservableCollection<Behinderungsart> _BehinderungsartenListe;
|
||||
@@ -1374,7 +1376,24 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime? BeiblattGueltigBis
|
||||
public string AusweisAktenzeichen
|
||||
{
|
||||
get { return _AusweisAktenzeichen; }
|
||||
|
||||
set
|
||||
{
|
||||
if (AreDifferent(_AusweisAktenzeichen, value))
|
||||
{
|
||||
_AusweisAktenzeichen = value;
|
||||
|
||||
StoreDirtyInformation(AreDifferent(DataContract.AusweisAktenzeichen, value), PropertyName_AusweisAktenzeichen);
|
||||
|
||||
FirePropertyChanged(PropertyName_AusweisAktenzeichen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime? BeiblattGueltigBis
|
||||
{
|
||||
get { return _BeiblattGueltigBis; }
|
||||
|
||||
@@ -1827,6 +1846,7 @@ namespace BeWo.ViewModel
|
||||
_AusstVersAmt = pDataContract.AusstVersAmt;
|
||||
_AusweisGueltigVon = pDataContract.AusweisGueltigVon;
|
||||
_AusweisGueltigBis = pDataContract.AusweisGueltigBis;
|
||||
_AusweisAktenzeichen = pDataContract.AusweisAktenzeichen;
|
||||
_BeiblattGueltigBis = pDataContract.BeiblattGueltigBis;
|
||||
_GradDerBehinderung = pDataContract.GradDerBehinderung;
|
||||
_MerkzeichenListe = new ObservableCollection<Merkzeichen>(pDataContract.MerkzeichenListe);
|
||||
@@ -1953,6 +1973,7 @@ namespace BeWo.ViewModel
|
||||
pDataContract.AusweisGueltigVon = _AusweisGueltigVon;
|
||||
pDataContract.AusweisGueltigBis = _AusweisGueltigBis;
|
||||
pDataContract.AusweisUnbefristetGueltig = _AusweisUnbefristetGueltig;
|
||||
pDataContract.AusweisAktenzeichen = _AusweisAktenzeichen;
|
||||
pDataContract.BeiblattGueltigBis = _BeiblattGueltigBis;
|
||||
pDataContract.GradDerBehinderung = _GradDerBehinderung;
|
||||
pDataContract.Nationalitaet = _Nationalitaet;
|
||||
|
||||
@@ -42,6 +42,7 @@ namespace BeWo.Data.Entities
|
||||
public static string PropertyName_AusweisGueltigVon = "AusweisGueltigVon";
|
||||
public static string PropertyName_AusweisGueltigBis = "AusweisGueltigBis";
|
||||
public static string PropertyName_AusweisUnbefristetGueltig = "AusweisUnbefristetGueltig";
|
||||
public static string PropertyName_AusweisAktenzeichen = "AusweisAktenzeichen";
|
||||
public static string PropertyName_BeiblattGueltigBis = "BeiblattGueltigBis";
|
||||
public static string PropertyName_GradDerBehinderung = "GradDerBehinderung";
|
||||
public static string PropertyName_MerkzeichenListe = "MerkzeichenListe";
|
||||
@@ -91,8 +92,9 @@ namespace BeWo.Data.Entities
|
||||
private DateTime? _AusweisGueltigVon;
|
||||
private DateTime? _AusweisGueltigBis;
|
||||
private bool? _AusweisUnbefristetGueltig;
|
||||
private string _AusweisAktenzeichen;
|
||||
private DateTime? _BeiblattGueltigBis;
|
||||
private string _GradDerBehinderung;
|
||||
private string _GradDerBehinderung;
|
||||
private IList<Merkzeichen> _MerkzeichenListe;
|
||||
private IList<Behinderungsart> _BehinderungsartenListe;
|
||||
private string _CustomerAlias;
|
||||
@@ -586,7 +588,20 @@ namespace BeWo.Data.Entities
|
||||
}
|
||||
}
|
||||
|
||||
public virtual DateTime? BeiblattGueltigBis
|
||||
public virtual string AusweisAktenzeichen
|
||||
{
|
||||
get { return _AusweisAktenzeichen; }
|
||||
|
||||
set
|
||||
{
|
||||
if (AreDifferent(_AusweisAktenzeichen, value))
|
||||
{
|
||||
_AusweisAktenzeichen = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual DateTime? BeiblattGueltigBis
|
||||
{
|
||||
get { return _BeiblattGueltigBis; }
|
||||
|
||||
|
||||
@@ -37,7 +37,8 @@
|
||||
<property column="AusweisGueltigVon" type="DateTime" name="AusweisGueltigVon" />
|
||||
<property column="AusweisGueltigBis" type="DateTime" name="AusweisGueltigBis" />
|
||||
<property column="AusweisUnbefristetGueltig" type="Boolean" name="AusweisUnbefristetGueltig" />
|
||||
<property column="BeiblattGueltigBis" type="DateTime" name="BeiblattGueltigBis" />
|
||||
<property column="AusweisAktenzeichen" type="String" name="AusweisAktenzeichen" />
|
||||
<property column="BeiblattGueltigBis" type="DateTime" name="BeiblattGueltigBis" />
|
||||
<property column="GradDerBehinderung" type="String" name="GradDerBehinderung" />
|
||||
|
||||
<property column="Pflegegrad" type="BS.Shared.Pflegegrad, BS.Shared" name="Pflegegrad" />
|
||||
|
||||
@@ -65,6 +65,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pDataContract.AusweisGueltigVon = pEntity.AusweisGueltigVon;
|
||||
pDataContract.AusweisGueltigBis = pEntity.AusweisGueltigBis;
|
||||
pDataContract.AusweisUnbefristetGueltig = pEntity.AusweisUnbefristetGueltig;
|
||||
pDataContract.AusweisAktenzeichen = pEntity.AusweisAktenzeichen;
|
||||
pDataContract.BeiblattGueltigBis = pEntity.BeiblattGueltigBis;
|
||||
pDataContract.GradDerBehinderung = pEntity.GradDerBehinderung;
|
||||
pDataContract.Pflegegrad = pEntity.Pflegegrad;
|
||||
@@ -199,6 +200,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pEntity.AusweisGueltigVon = pDataContract.AusweisGueltigVon;
|
||||
pEntity.AusweisGueltigBis = pDataContract.AusweisGueltigBis;
|
||||
pEntity.AusweisUnbefristetGueltig = pDataContract.AusweisUnbefristetGueltig;
|
||||
pEntity.AusweisAktenzeichen = pDataContract.AusweisAktenzeichen;
|
||||
pEntity.BeiblattGueltigBis = pDataContract.BeiblattGueltigBis;
|
||||
pEntity.GradDerBehinderung = pDataContract.GradDerBehinderung;
|
||||
pEntity.BehinderungsartenListe = pDataContract.BehinderungsartenListe;
|
||||
|
||||
138
Service/Dienstplanung/DienstplanungsManager.cs
Normal file
138
Service/Dienstplanung/DienstplanungsManager.cs
Normal file
@@ -0,0 +1,138 @@
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.Core;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BeWo.Service.Dienstplanung
|
||||
{
|
||||
internal class DienstplanungsManager
|
||||
{
|
||||
public static List<DienstInfoDC> GetAllDienste()
|
||||
{
|
||||
var temp = DAOFactory.GenericDAO.GetAllActive<DienstInfo>();
|
||||
return MapperFactory.DienstInfoDC_DienstInfo.MapToNewDCs(temp);
|
||||
}
|
||||
public static void InsertNewDienst(List<DienstInfoDC> dienst)
|
||||
{
|
||||
var temp = MapperFactory.DienstInfoDC_DienstInfo.MapToNewEntities(dienst);
|
||||
DAOFactory.GenericDAO.Insert(temp);
|
||||
}
|
||||
public static void DeactivateDienst(Dictionary<long, long> pOid2Version)
|
||||
{
|
||||
ServiceLogic.SetActivationType<DienstInfo>(pOid2Version, ActivationTypeId.Deleted);
|
||||
}
|
||||
public static void UpdateDienst(List<DienstInfoDC> dienste)
|
||||
{
|
||||
|
||||
var temp = DAOFactory.GenericDAO.LoadByIDs<DienstInfo>(dienste.Select(sc => sc.Oid.Value));
|
||||
|
||||
MapperFactory.DienstInfoDC_DienstInfo.MergeWithEntitys(dienste, temp);
|
||||
|
||||
DAOFactory.GenericDAO.Update(temp);
|
||||
|
||||
}
|
||||
public static List<DienstBlockDC> GetDienstEintraege(long wOid, int year, int month)
|
||||
{
|
||||
|
||||
var res = new List<DienstBlockDC>();
|
||||
var date = new DateTime(year, month, 1);
|
||||
var date2 = date.AddMonths(1).AddTicks(-1);
|
||||
|
||||
var dienstEintraege = DAOFactory.GenericDAO.GetAllActive<DienstEintrag>().Where(x =>
|
||||
x.WohnheimOid == wOid &&
|
||||
x.Datum.Month == month &&
|
||||
x.Datum.Year == year);
|
||||
|
||||
var dienstEintraegeDC = MapperFactory.DienstEintragDC_DienstEintrag.MapToNewDCs(dienstEintraege);
|
||||
|
||||
var wh = DAOFactory.GenericDAO.GetByID<Wohnheim>(wOid);
|
||||
var whDC = MapperFactory.CompactWohnheimDC_Wohnheim.MapToNewDC(wh);
|
||||
|
||||
var emps = wh.Employee2WohnheimList.Select(x => x.Employee);
|
||||
var empsDC = MapperFactory.EmployeeDC_Employee.MapToNewDCs(emps).Distinct();
|
||||
|
||||
foreach (var emp in empsDC)
|
||||
{
|
||||
var contracts = emp.Contracts.Where(x => (!x.EntryDate.HasValue || x.EntryDate.Value <= date2) &&
|
||||
(!x.ContractEndDate.HasValue || x.ContractEndDate.Value >= date))
|
||||
.OrderBy(x => x.EntryDate)
|
||||
.ToList();
|
||||
|
||||
if (!contracts.Any())
|
||||
continue;
|
||||
|
||||
var zeile = new DienstBlockDC
|
||||
{
|
||||
Employee = emp,
|
||||
Contracts = contracts,
|
||||
Wohnheim = whDC,
|
||||
DienstDictArray = new Dictionary<int, long>[3]
|
||||
};
|
||||
|
||||
for (int i = 0; i < zeile.DienstDictArray.Length; i++)
|
||||
{
|
||||
var empDienste = dienstEintraegeDC
|
||||
.Where(x => x.EmployeeOid == emp.EmployeeOid && x.Zeile == i); //i + 1 wegen der Statuszeile, die jetzt die vorherige erste Zeile mach unten geschoben hat
|
||||
|
||||
zeile.DienstDictArray[i] = empDienste
|
||||
.ToDictionary(x => x.Datum.Day, x => x.DienstOid);
|
||||
}
|
||||
|
||||
res.Add(zeile);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
public static void InsertNewDienstEintrag(DienstEintragDC dienstEintrag)
|
||||
{
|
||||
DAOFactory.GenericDAO.Insert(MapperFactory.DienstEintragDC_DienstEintrag.MapToNewEntity(dienstEintrag));
|
||||
}
|
||||
public static void DeleteDienstEintrag(long empId, long wohnId, int zeile, DateTime date)
|
||||
{
|
||||
var toDel = DAOFactory.GenericDAO.GetAll<DienstEintrag>()
|
||||
.FirstOrDefault(x =>
|
||||
x.EmployeeOid == empId &&
|
||||
x.WohnheimOid == wohnId &&
|
||||
x.Zeile == zeile &&
|
||||
x.Datum == date);
|
||||
|
||||
if (toDel != null)
|
||||
DAOFactory.GenericDAO.Delete(toDel);
|
||||
}
|
||||
public static void DeleteCertainDienstEintragOutOfTable(long dienstEintragOid)
|
||||
{
|
||||
var toDelete = DAOFactory.GenericDAO.GetAll<DienstEintrag>();
|
||||
for (int i = toDelete.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (toDelete[i].DienstOid == dienstEintragOid)
|
||||
DAOFactory.GenericDAO.Delete(toDelete[i]);
|
||||
}
|
||||
}
|
||||
public static void RemoveAllDiensteForOneMonth(DateTime month)
|
||||
{
|
||||
var alleDienste = DAOFactory.GenericDAO.GetAll<DienstEintrag>();
|
||||
foreach (var dienst in alleDienste)
|
||||
{
|
||||
if (dienst.Datum.Month == month.Month)
|
||||
DAOFactory.GenericDAO.Delete(dienst);
|
||||
|
||||
}
|
||||
}
|
||||
public static string GetColorForStatus(bool status)
|
||||
{
|
||||
return (status) ? "#FF228B22" : "#FFCD5C5C";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
237
Service/Dokumentverwaltung/DokumentManager.cs
Normal file
237
Service/Dokumentverwaltung/DokumentManager.cs
Normal file
@@ -0,0 +1,237 @@
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BeWo.Service.Dokumentverwaltung
|
||||
{
|
||||
internal class DokumentManager
|
||||
{
|
||||
public static List<BeWoFolderDC> GetFolderTree(TableID pObjectTid, long pObjectOid)
|
||||
{
|
||||
|
||||
IList<BeWoFolder> folder = DAOFactory.SearchDAO.FindBeWoFolders(pObjectTid, pObjectOid);
|
||||
bool templateFolder = folder.Any(f => f.SystemEntryID.Equals(SystemEntryID.TemplateDirectory));
|
||||
var folderDCList = new List<BeWoFolderDC>();
|
||||
|
||||
foreach (BeWoFolder item in folder)
|
||||
{
|
||||
folderDCList.Add(MapperFactory.BeWoFolderDC_BeWoFolder.MapToNewDC(item));
|
||||
}
|
||||
|
||||
IEnumerable<FileAttachmentInfo> files = DAOFactory.SearchDAO.FindFileAttachmentInfos(pObjectTid, pObjectOid);
|
||||
var fileDCList = new List<FileAttachmentDC>();
|
||||
|
||||
foreach (FileAttachmentInfo item in files)
|
||||
{
|
||||
fileDCList.Add(MapperFactory.FileAttachmentDC_FileAttachmentInfo.MapToNewDC(item));
|
||||
}
|
||||
|
||||
Thread.Sleep(500);
|
||||
|
||||
return CreateFolderTree(folderDCList, fileDCList, pObjectTid, pObjectOid, templateFolder);
|
||||
|
||||
}
|
||||
private static List<BeWoFolderDC> CreateFolderTree(List<BeWoFolderDC> folderDCList, List<FileAttachmentDC> fileDCList, TableID pObjectTid, long pObjectOid, bool templateFolder = false)
|
||||
{
|
||||
Dictionary<long, BeWoFolderDC> folderDict = folderDCList.ToDictionary(fo => fo.BeWoFolderOid.Value);
|
||||
Dictionary<long, FileAttachmentDC> fileDict = fileDCList.ToDictionary(fi => fi.FileAttachmentOid.Value);
|
||||
|
||||
var resultList = new List<BeWoFolderDC>();
|
||||
|
||||
var root = new BeWoFolderDC
|
||||
{
|
||||
ObjectTid = pObjectTid,
|
||||
ObjectOid = pObjectOid,
|
||||
Name = "Alle Ordner",
|
||||
SubFolders = new List<BeWoFolderDC>(),
|
||||
Files = new List<FileAttachmentDC>()
|
||||
};
|
||||
|
||||
if (templateFolder)
|
||||
root = folderDCList.First(f => f.Name.Equals("Vorlagen"));
|
||||
|
||||
resultList.Add(root);
|
||||
|
||||
foreach (BeWoFolderDC cfo in folderDCList)
|
||||
{
|
||||
if (root.Equals(cfo))
|
||||
continue;
|
||||
|
||||
if (cfo.ParentBeWoFolderOid.HasValue)
|
||||
{
|
||||
if (folderDict.ContainsKey(cfo.ParentBeWoFolderOid.Value))
|
||||
{
|
||||
BeWoFolderDC parent = folderDict[cfo.ParentBeWoFolderOid.Value];
|
||||
parent.SubFolders.Add(cfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
root.SubFolders.Add(cfo);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
root.SubFolders.Add(cfo);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (FileAttachmentDC fi in fileDCList)
|
||||
{
|
||||
if (fi.BeWoFolderOid.HasValue)
|
||||
{
|
||||
if (folderDict.ContainsKey(fi.BeWoFolderOid.Value))
|
||||
{
|
||||
BeWoFolderDC parent = folderDict[fi.BeWoFolderOid.Value];
|
||||
parent.Files.Add(fi);
|
||||
}
|
||||
else
|
||||
{
|
||||
root.Files.Add(fi);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
root.Files.Add(fi);
|
||||
}
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
public static void DeleteFolder(long pBeWoFolderOid, long pVersion)
|
||||
{
|
||||
var origFolder = DAOFactory.GenericDAO.LoadByID<BeWoFolder>(pBeWoFolderOid);
|
||||
MapperFactory.BeWoFolderDC_BeWoFolder.ConcurrencyCheck(pVersion, origFolder);
|
||||
|
||||
DAOFactory.GenericDAO.Delete(origFolder);
|
||||
}
|
||||
public static long InsertNewFolder(BeWoFolderDC folder)
|
||||
{
|
||||
BeWoFolder newFolder = MapperFactory.BeWoFolderDC_BeWoFolder.MapToNewEntity(folder);
|
||||
|
||||
DAOFactory.GenericDAO.Insert(newFolder);
|
||||
BeWoFolderDC newFolderDC = MapperFactory.BeWoFolderDC_BeWoFolder.MapToNewDC(newFolder);
|
||||
|
||||
return newFolderDC.BeWoFolderOid.Value;
|
||||
}
|
||||
public static BeWoFolderDC UpdateFolder(BeWoFolderDC folder)
|
||||
{
|
||||
//Root Folder kann nicht umbenannt werden
|
||||
var origFolder = DAOFactory.GenericDAO.LoadByID<BeWoFolder>(folder.BeWoFolderOid.Value);
|
||||
|
||||
MapperFactory.BeWoFolderDC_BeWoFolder.MergeWithEntity(folder, origFolder);
|
||||
|
||||
DAOFactory.GenericDAO.Update(origFolder);
|
||||
BeWoFolderDC updatedFolderDC = MapperFactory.BeWoFolderDC_BeWoFolder.MapToNewDC(origFolder);
|
||||
|
||||
return updatedFolderDC;
|
||||
}
|
||||
public static FileAttachmentDC UpdateFileAttachment(FileAttachmentDC file)
|
||||
{
|
||||
var origFile = DAOFactory.GenericDAO.LoadByID<FileAttachmentInfo>(file.FileAttachmentOid.Value);
|
||||
MapperFactory.FileAttachmentDC_FileAttachmentInfo.MergeWithEntity(file, origFile);
|
||||
|
||||
DAOFactory.GenericDAO.Update(origFile);
|
||||
|
||||
FileAttachmentDC updatedFileDC = MapperFactory.FileAttachmentDC_FileAttachmentInfo.MapToNewDC(origFile);
|
||||
return updatedFileDC;
|
||||
}
|
||||
public static FileAttachmentDC DoTheRealFileUpdate(FileAttachmentDC file)
|
||||
{
|
||||
var origFile = DAOFactory.GenericDAO.LoadByID<FileAttachment>(file.FileAttachmentOid.Value);
|
||||
if (!origFile.Data.Equals(file.BinaryData))
|
||||
{
|
||||
}
|
||||
|
||||
MapperFactory.FileAttachmentDC_FileAttachment.MergeWithEntity(file, origFile);
|
||||
|
||||
DAOFactory.GenericDAO.Update(origFile);
|
||||
|
||||
FileAttachmentDC updatedFileDC = MapperFactory.FileAttachmentDC_FileAttachment.MapToNewDC(origFile);
|
||||
return updatedFileDC;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
public static void InsertFileAttachment(FileAttachmentDC fileAttachmentDC)
|
||||
{
|
||||
var entity = new FileAttachment()
|
||||
{
|
||||
BeWoFolderOid = fileAttachmentDC.BeWoFolderOid,
|
||||
Data = fileAttachmentDC.BinaryData,
|
||||
InsTs = fileAttachmentDC.InsertedOn,
|
||||
InsUser = fileAttachmentDC.InsertedBy,
|
||||
IsActive = ActivationTypeId.Active,
|
||||
ObjectOid = fileAttachmentDC.ObjectOid,
|
||||
ObjectTid = fileAttachmentDC.ObjectTid,
|
||||
Type = FileAttachmentType.NotSpecified,
|
||||
Version = 1,
|
||||
Path = fileAttachmentDC.FileName
|
||||
};
|
||||
entity = MapperFactory.FileAttachmentDC_FileAttachment.MergeWithEntity(fileAttachmentDC, entity);
|
||||
|
||||
DAOFactory.GenericDAO.Insert(entity);
|
||||
}
|
||||
public static List<FileAttachmentDC> SearchForFiles(string nutzereingabe)
|
||||
{
|
||||
List<FileAttachmentDC> allFiles = MapperFactory.FileAttachmentDC_FileAttachment.MapToNewDCs(DAOFactory.GenericDAO.GetAllActive<FileAttachment>());
|
||||
var list = DAOFactory.SearchDAO.FindFileattachmentOids(nutzereingabe);
|
||||
|
||||
List<FileAttachmentDC> files = new List<FileAttachmentDC>();
|
||||
|
||||
foreach (object[] info in list)
|
||||
{
|
||||
|
||||
var dc = new FileAttachmentDC();
|
||||
dc.FileAttachmentOid = info[0] as long?;
|
||||
dc.BeWoFolderOid = info[1] as long?;
|
||||
dc.ObjectOid = info[2] as long?;
|
||||
dc.ObjectTid = (TableID)info[3];
|
||||
dc.FileName = info[4].ToString();
|
||||
files.Add(dc);
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
public static string GetObjectForFilePath(TableID table, long? oid)
|
||||
{
|
||||
string objectName = "";
|
||||
|
||||
switch (table)
|
||||
{
|
||||
case TableID.ApplicationUser: objectName = (DAOFactory.GenericDAO.GetByID<ApplicationUser>((long)oid)).LoginName; break;
|
||||
case TableID.SupportConcept:
|
||||
var sc = DAOFactory.GenericDAO.GetByID<SupportConcept>((long)oid);
|
||||
objectName = sc.Customer.Person.LastNameFirstName + " " + CustomizeDates(sc.StartDate, sc.EndDate); break;
|
||||
case TableID.Customer: objectName = (DAOFactory.GenericDAO.GetByID<Customer>((long)oid)).Person.LastNameFirstName; break;
|
||||
case TableID.Organisation: objectName = (DAOFactory.GenericDAO.GetByID<Organisation>((long)oid)).Name; break;
|
||||
case TableID.Person: objectName = (DAOFactory.GenericDAO.GetByID<Person>((long)oid)).LastNameFirstName; break;
|
||||
case TableID.Employee: objectName = (DAOFactory.GenericDAO.GetByID<Employee>((long)oid)).Person.LastNameFirstName; break;
|
||||
case TableID.Team: objectName = (DAOFactory.GenericDAO.GetByID<Team>((long)oid)).Name; break;
|
||||
case TableID.UserGroup: objectName = (DAOFactory.GenericDAO.GetByID<UserGroup>((long)oid)).Name; break;
|
||||
}
|
||||
|
||||
return objectName;
|
||||
}
|
||||
private static string CustomizeDates(DateTime? startdate, DateTime? enddate)
|
||||
{
|
||||
string span = "";
|
||||
string startday, endday, startmonth, endmonth;
|
||||
|
||||
startday = (startdate.Value.Day < 10) ? "0" + startdate.Value.Day : startdate.Value.Day.ToString();
|
||||
endday = (enddate.Value.Day < 10) ? "0" + enddate.Value.Day : enddate.Value.Day.ToString();
|
||||
startmonth = (startdate.Value.Month < 10) ? "0" + startdate.Value.Month : startdate.Value.Month.ToString();
|
||||
endmonth = (enddate.Value.Month < 10) ? "0" + enddate.Value.Month : enddate.Value.Month.ToString();
|
||||
|
||||
span = "(" + startday + "." + startmonth + "." + startdate.Value.Year + " - " + endday + "." + endmonth + "." + enddate.Value.Year + ")";
|
||||
|
||||
return span;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -310,6 +310,8 @@
|
||||
<Compile Include="DCEntityMapper\UserGroupDC_UserGroup.cs" />
|
||||
<Compile Include="DCEntityMapper\ValueListEntryDC_ValueListEntry.cs" />
|
||||
<Compile Include="DCEntityMapper\VarFieldDC_VarFieldDefMapper.cs" />
|
||||
<Compile Include="Dienstplanung\DienstplanungsManager.cs" />
|
||||
<Compile Include="Dokumentverwaltung\DokumentManager.cs" />
|
||||
<Compile Include="Invoicing\ApprovalPeriod.cs" />
|
||||
<Compile Include="Invoicing\SbdDefaultInvoiceCreation.cs" />
|
||||
<Compile Include="Invoicing\EquityInvoiceCreation.cs" />
|
||||
@@ -406,6 +408,7 @@
|
||||
<Compile Include="UnitOfWork\HibernateSessionEndpointBehavior.cs" />
|
||||
<Compile Include="UnitOfWork\HibernateSessionBehaviorExtension.cs" />
|
||||
<Compile Include="UnitOfWork\HibernateSessionContextInitializer.cs" />
|
||||
<Compile Include="Vorlagen\VorlagenManager.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Data\Data.csproj">
|
||||
@@ -435,7 +438,6 @@
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Dienstplanung\" />
|
||||
<Folder Include="Utils\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1033
Service/Vorlagen/VorlagenManager.cs
Normal file
1033
Service/Vorlagen/VorlagenManager.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -144,6 +144,9 @@ namespace BS.Shared.DataContracts
|
||||
[DataMember]
|
||||
public bool? AusweisUnbefristetGueltig { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public String AusweisAktenzeichen { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public DateTime? BeiblattGueltigBis { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user