MH: Möglichkeit, die Statuszeile ein- und auszublenden, eingebaut

This commit is contained in:
Marcel Hirschle
2022-02-17 13:42:32 +01:00
parent d6c86f94de
commit cdbc1d9f3e
4 changed files with 212 additions and 107 deletions

View File

@@ -68,13 +68,18 @@ namespace BeWo.Service.Dienstplanung
root.DienstDCListe.AddRange(GetDienstvertretungen(wohnheimOid, date.Year, date.Month));
root.DienstDCListe = root.DienstDCListe.OrderBy(d => d.Employee.LastName).ToList();
root.EnableStatuszeile = SetEnableStatuszeile();
root.DienstZeilenListe = new List<DienstZeileDC>();
if (root.EnableStatuszeile)
root.DienstZeilenListe.Add(InitStatusZeile(date));
root.StatusColorTrue = "#FF228B22";
root.StatusColorFalse = "#FFCD5C5C";
var wh = DAOFactory.GenericDAO.GetByID<Wohnheim>(wohnheimOid);
List<long> empOids = new List<long>();
#region EmployeeOids holen für Ist- und Saldoberechnung und die Liste der vorhandenen Mitarbeiter
#region EmployeeOids holen für Ist- und Saldoberechnung und die Liste der vorhandenen Mitarbeiter
// WIEDER EINKOMMENTIEREN FALLS FEHLER AUFTRETEN
//foreach (var item in wh.Employee2WohnheimList)
//{
@@ -95,7 +100,7 @@ namespace BeWo.Service.Dienstplanung
if (!root.AllEmployee.Contains(block.Employee))
root.AllEmployee.Add(block.Employee);
}
#endregion
#endregion
root.MonatsZusammenfassung = BerechneSollSaldoUndIst(root, date, empOids);
@@ -758,5 +763,38 @@ namespace BeWo.Service.Dienstplanung
return bloeckeNeuSortiert;
}
}
public static DienstZeileDC InitStatusZeile(DateTime date)
{
var days = DateTime.DaysInMonth(date.Year, date.Month);
var zeileDC = new DienstZeileDC()
{
Contracts = null,
Date = date,
DienstDict = null,
Employee = null,
StatusListe = new List<BesetzungsstatusDC>(),
Zeile = 0
};
for (int i = 1; i <= days; i++)
{
zeileDC.StatusListe.Add(new BesetzungsstatusDC()
{
DauerhaftBesetztStatus = false,
Stunden = 0,
Tag = i
});
}
return zeileDC;
}
public static bool SetEnableStatuszeile()
{
#if DEBUG
return false;
#endif
return true;
}
}
}